Export - preserve aspect ratio

Hi - I’m editing a .ts file and exporting to H.264 - Main profile.

When playing the original .ts file it plays well in Plex on both TV, PC and phone.

But when playing the mp4 H.264 file, it is either stretched horizontally or not scaling to fill the whole screen.

I would like the export to play as the original - what am I missing?

Set your Video Mode the same as your source file, before you bring in any source files.

Thank you for a quick reply.

What I forgot to include in my question was that I use Shotcut to generate the xml-file for my project, which i run through qmelt on a server in order to move the load away from my laptop.
When i use your advice in Shotcut running on my laptop it works. But when i send the xml file to qmelt and let it render the project, i get the problem mentioned.
Am I missing some setting or…?

Do you have any hard-coded parameters in the qmelt script that could be conflicting? Is qmelt the same version as the Shotcut that generated the file? The MLT format evolves a little over time.

A diagnostic step could be doing an export on the laptop, right-click the finished job in the Jobs panel and look at the logs, then compare those to qmelt logs to see if there are differences.