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

Marc Barrett mnealbarrett at gmail.com
Sun Oct 25 20:21:45 EET 2020


I have been making a personal Plex movie library by ripping DVDs and
Blu-Rays with MakeMKV. MakeMKV works very, very well, except the MKV files
it produces are very large. A Blu-Ray typically produces a 40-50GB MKV file
and a DVD produces a 6GB MKV file.

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 does two things for me. Since I have a halfway decent graphics
card (Nvidia geforce RTX 2060), it gives me the hardware acceleration I
desire. It also retains all subtitles when recompacting the files.

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
[h264 @ 0x555573579a80] data partitioning is not implemented. Update your
FFmpeg version to the newest one from Git. If the problem still occurs, it
means that your file has a feature which has not been implemented.
[h264 @ 0x555573579a80] If you want to help, upload a sample of this file
to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing
list. (ffmpeg-devel at ffmpeg.org)
[h264 @ 0x555573579a80] data partitioning is not implemented. Update your
FFmpeg version to the newest one from Git. If the problem still occurs, it
means that your file has a feature which has not been implemented.
[h264 @ 0x555573579a80] If you want to help, upload a sample of this file
to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing
list. (ffmpeg-devel at ffmpeg.org)
[h264 @ 0x555573579a80] data partitioning is not implemented. Update your
FFmpeg version to the newest one from Git. If the problem still occurs, it
means that your file has a feature which has not been implemented.
[h264 @ 0x555573579a80] If you want to help, upload a sample of this file
to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing
list. (ffmpeg-devel at ffmpeg.org)
[h264 @ 0x555573579a80] A non-intra slice in an IDR NAL unit.
[h264 @ 0x555573579a80] decode_slice_header error
[h264 @ 0x555573579a80] SEI type 70 size 1120 truncated at 932
[h264 @ 0x555573579a80] crop values invalid 1 5 11 5 / 48 64
    Last message repeated 2 times
[h264 @ 0x555573579a80] sps_id 0 out of range
[h264 @ 0x555573579a80] no frame!
[h264 @ 0x555573579a80] non-existing PPS 0 referenced
[h264 @ 0x555573579a80] Invalid NAL unit 1, skipping.
[h264 @ 0x555573579a80] non-existing PPS 0 reference


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).

BTW, I noticed that, by default, ffmpeg on Ubuntu 20.04 is installed with
Snap. I hate Snap. I had nothing but problems with MakeMKV installed with
Snap, and had to compile MakeMKV from scratch. I tried doing that with
ffmpeg, but I couldn't get it to install absolutely everything I needed. I
ended up with no Nvidia hardware support, for example.

If someone could help me with this, I would really appreciate it.


More information about the ffmpeg-user mailing list