MPEG-2 export preset - video does not work

Hi everyone!

I tried to render a 11minute movie using the MPEG-2 export preset. However, the video causes trouble when played back, e.g. in VLC.

The first 30seconds or so seem to be fine. After that, the video stutters and VLC stops playing the video stream (while it sometimes keeps the audio running). When jumping to a later/earlier position in the movie, there is no image, just audio. Or I have image but no audio. When I do a single frame step in VLC, the images reveal significant artifacts as shown in the following image, where a hand is moving in front of a blue background. The edge of the hand seems to show rectangles of the previous frame:

grafik

Is this a Shotcut problem? Something wrong in the presets / the encoder? Is it just me/my computer?

What surprises me is that the mpg file has 421MB (for 11 minutes). This seems rather big to me.

I’m using Shotcut version 20.04.12 on Win 7 prof. 64 Bit.

Try playing it in Shotcut. I bet it will be fine. The export preset is not perfectly compatible with everything on its own. I think that is because MPEG-2 typically requires some specification details ala DVD, HDV, or ATSC. The preset is generic, so it just creates a generic average bitrate. When you view the export job log it typically shows something like:

mpeg @ 0x7f9308000f40] VBV buffer size not set, using default size of 230KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
[mpeg @ 0x7f9308000f40] buffer underflow st=0 bufi=2002 size=58390

with additonal buffer underflow warnings.
You can switch to constant bitrate to set a buffer size, but the messages and problem in VLC does not go away. Even when I choose a DVD preset the log messages do not go away. I think some FFmpeg changes impaired our MPEG-2 encoding, but at least the DVD presets play fine for me in VLC.

As for the size, the preset sets the video to 8 Mb/s, so the size is lower than expected: 1 MB/sec * 60 sec/min * 11 min = 660 MB. MPEG-2 needs a fairly high bitrate.

Is there a particular reason why you are using MPEG-2?

Hi & Thank you for your answer.

Indeed it plays fine in Shotcut. I will try some different bit rate modes then and see what happens in VLC.

As for the MPEG-2 choice:
The videos shall be archived and may be converted in other formats in the future. When searching through the net (some years ago) I found that most people said that MPEG-2 would be the right choice. It produces bigger files but with less loss than MP4. So I assumed this would be the best format for file archival.

Or is this obsolete nowadays?

If the edit is for archive, there are lossless codecs implemented in the export menu in Shotcut.
FFV1
H.264
HuffYUV
UTVideo

MPEG-2 is pretty obsolete these days. (The television guys may disagree with me, but they are a specialized case.)

As @ejmillan pointed out, there are a number of lossless formats available if you want to retain maximum quality. FFV1 is very capable, but I would recommend testing a one-minute export with it first then try playing it back. Particularly at 4K, playback of FFV1 is so processor-intensive that many computers can’t decode in real-time, and the video stutters. Hence, it’s inconvenient to verify that your exported video looks good if you can’t play it back. So yeah, test for that, and if it works, great, you have a serious computer.

Also consider testing that your media player of choice can decode Lossless H.264. Some players can’t. But Shotcut and FFmpeg always can if you make conversions with those tools in the future.

Huffyuv and Ut Video are widely recognized and don’t usually have problems. But they do make big files.

If you aren’t interested in the big file sizes that come with lossless perfection, there’s the option of H.264 at CRF 16 (libx264 Shotcut export quality 68%), which matches human vision, and very gracefully survives a single conversion while keeping the file size way down. It would both look better and be smaller than MPEG-2.

3 Likes

Thank you for your suggestions. I will give them a try and compare the results to find a good compromise between quality and file size. (Complete lossless might produce files which a far too big. I also have movies of one hour or more. So I will do some tests with higher quality settings and see what happens.)