[FFmpeg-user] Trying to Reduce Sizes of Movies Ripped with MakeMKV

Moritz Barsnick barsnick at gmx.net
Mon Oct 26 11:31:17 EET 2020


Hi Marc

On Sun, Oct 25, 2020 at 13:21:45 -0500, Marc Barrett wrote:
> I have been using the following command to recompact the Blu-Ray MKV files:
>
> ffmpeg -y -hwaccel cuvid -c:v h264_cuvid -vsync 0 -i in.mkv -map 0 -codec:v
> h264_nvenc -codec:a copy -codec:s copy -max_muxing_queue_size 4096 out.mkv
[...]
> That command works very well for Blu-Rays. It can reduce a 40-50GB MKV file
> to about 7GB. The problem is, that only works on files produced by ripping
> Blu-Rays. If I try it on DVD files, I get errors.
>
>
> [h264 @ 0x555573579a80] Invalid NAL unit 0, skipping.
>     Last message repeated 5 times
> [h264 @ 0x555573579a80] non-existing PPS 2 referenced
> [h264 @ 0x555573579a80] Invalid NAL unit 0, skipping.
>     Last message repeated 4 times
> [h264 @ 0x555573579a80] non-existing PPS 2 referenced
> [h264 @ 0x555573579a80] decode_slice_header error

As Carl/z pointed out:
> But there _is_ output from ffmpeg, and that can tell us a lot about the files.

You never actually showed us the complete output from ffmpeg. Even just
an ffprobe of the input file would suffice.

> I am using ffmpeg version n4.1.4 on a Ubuntu Mate 20.04 system, Intel X64
> PC. Everything is up-to-date (I run apt update/upgrade regularly).

(As others mentionend: That ffmpeg version is not up to date, though.
You should try to get hold of a recent binary.)


As far as I remember MakeMKV, and from the sizes you posted, it creates
a non-reencoded dump of the disk's contents.

DVDs are *not* encoded with H.264, but rather MPEG-2 video. So you
simply cannot use the h264_cuvid decoder on that material. ffmpeg
should have shown you what it thinks the video codec is. Check with

$ ffmpeg -i in.mkv

and if that confirms my suspicion, use the "mpeg2_cuvid" input codec on
your command line.

Let us know,
cheers,
Moritz


More information about the ffmpeg-user mailing list