Log in

View Full Version : MPEG2 to MKV with re-encoding


lyra
15th June 2013, 08:29
I have mpeg2 file which I want to put into mkv container. I usually use mkvtoolnix package for this. However, my current video file is not accepted by mmg. I am getting: Error: Found B frame without second reference in a non closed GOP. Fix the MPEG2 video stream before attempting to multiplex it.
Mosu is aware of this problem, but he is not going to fix it any time soon.
Question is: what would be the easiest way to re-encode this video without getting too much into technical details and without loosing video quality?

Here is a sample of that file. (http://www.megafileupload.com/en/file/426429/sample-mpv.html)

filler56789
15th June 2013, 08:55
I have mpeg2 file which I want to put into mkv container. I usually use mkvtoolnix package for this. However, my current video file is not accepted by mmg. I am getting: Error: Found B frame without second reference in a non closed GOP. Fix the MPEG2 video stream before attempting to multiplex it.
Mosu is aware of this problem, but he is not going to fix it any time soon.

I may be wrong, but since that file itself was produced incorrectly, it wouldn't be Mosu's job to make mkvmerge accept b0rked inputs.

Question is: what would be the easiest way to re-encode this video without getting too much into technical details and without loosing video quality?

Without ANY loss of quality: only by recompressing with a LOSSLESS codec, and MPEG-2 is not lossless.

With a minimal loss of quality: not compatible with "easiest" or "without getting too much into technical details", I believe :)

lyra
15th June 2013, 09:47
I may be wrong, but since that file itself was produced incorrectly, it wouldn't be Mosu's job to make mkvmerge accept b0rked inputs.
I believe, file is perfectly fine. I have checked it with avconv and no problems were found. It also plays with VLC, MPC-HC and others.

I have found this example for lossless encoding. But it increases output file size 8x times.
ffmpeg -i input -c:v libx264 -preset veryslow -qp 0 output.mkv

setarip_old
15th June 2013, 19:05
Hi!

Perhaps a "long way around the horn" but it might serve your purpose:

1) Convert your MPEG-2 to DVD

2) Use MakeMKV to convert the DVD to MKV

paradoxical
17th June 2013, 16:48
I believe, file is perfectly fine. I have checked it with avconv and no problems were found. It also plays with VLC, MPC-HC and others.

I have found this example for lossless encoding. But it increases output file size 8x times.
ffmpeg -i input -c:v libx264 -preset veryslow -qp 0 output.mkv

Well, yes. Lossless encoding is always going to be many times larger than lossy encoding.