[FFmpeg-user] Rip DVD with ffmpeg

Adi Marvillo adi5 at gmx.at
Wed Feb 21 18:06:46 EET 2018


Hello everyone - I am trying hard to rip my own DVD collection onto my
fileserver but it doesn't work properly.
Input-streams are:
Stream #0:0: Data: dvd_nav_packet
Stream #0:1: Video: mpeg2video (Main), yuv420p(tv, top first), 720x576
[SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 90k tbc
Stream #0:2: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s

I made a list of the biggest files on the DVD which are supposed to be
the entire film if concatenated.
files adi at HOST ~/Videos $ cat mylist.txt
file '/media/cdrom/video_ts/vts_09_1.vob'
file '/media/cdrom/video_ts/vts_09_2.vob'
file '/media/cdrom/video_ts/vts_09_3.vob'
file '/media/cdrom/video_ts/vts_09_4.vob'
file '/media/cdrom/video_ts/vts_09_5.vob'
file '/media/cdrom/video_ts/vts_09_6.vob'

the command to start ripping is this one:
avconv -safe 0 -f concat -i mylist.txt -g 25 -keyint_min 3 -aspect
"16:9" -map 0:1 -c:v libx264 -map 0:2 -c:a copy ~/Videos/testvideo.mkv

Error message after half an hour:
Non-monotonous DTS in output stream 0:1; previous: 17992, current:
17960; changing to 17992. This may result in incorrect timestamps in the
output file.

As much as I understood the options "-copyts -start_at_zero" sync the
timestamp=1 with the beginning of the video-track and don't check it
afterwards... So I thought, I'll bind the timestamp to the begin of the
video-stream
avconv -safe 0 -f concat -i mylist13.txt -g 25 -keyint_min 3 -vf
"crop=x=22:out_w=in_w-52:y=4:out_h=in_h-6" -aspect "16:9" -map 0:1 -c:v
libx264 -map 0:2 -c:a copy ~/Videos/testvideo.mkv -copyts -start_at_zero

Same error again. I searched a lot and couldn't find any solution to my
Problem - maybe anybody has an advice?

Then I tried to encode the audio-track as a new:

adi at HOST ~/Videos $ avconv -safe 0 -f concat -i mylist.txt -ss 00:18:15
-t 00:00:30 -g 25 -keyint_min 3 -vf
"crop=x=22:out_w=in_w-52:y=4:out_h=in_h-6" -aspect "16:9" -map 0:1 -c:v
libx264 -map 0:2 -c:a ac3_fixed ~/Videos/testvideo.mkv
ffmpeg version 3.2.10-1~deb9u1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
  configuration: --prefix=/usr --extra-version='1~deb9u1'
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping
--enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libebur128 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg
--enable-libopenmpt --enable-libopus --enable-libpulse
--enable-librubberband --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora
--enable-libtwolame --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid
--enable-libzmq --enable-libzvbi --enable-omx --enable-openal
--enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264
--enable-shared
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, concat, from 'mylist13.txt':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Data: dvd_nav_packet
    Stream #0:1: Video: mpeg2video (Main), yuv420p(tv, top first),
720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 90k tbc
    Stream #0:2: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
[libx264 @ 0x5581377c0120] using SAR=760/501
[libx264 @ 0x5581377c0120] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.1 Cache64
[libx264 @ 0x5581377c0120] profile High, level 3.0
[libx264 @ 0x5581377c0120] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4
AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html -
options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7
psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1
8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3
lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=25 keyint_min=3
scenecut=40 intra_refresh=0 rc_lookahead=25 rc=crf mbtree=1 crf=23.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to '/home/adi/Videos/testvideo.mkv':
  Metadata:
    encoder         : Lavf57.56.101
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p,
668x570 [SAR 760:501 DAR 16:9], q=-1--1, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.64.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: ac3 (ac3_fixed) ([0] [0][0] / 0x2000), 48000 Hz,
stereo, s16p, 192 kb/s
    Metadata:
      encoder         : Lavc57.64.101 ac3_fixed
Stream mapping:
  Stream #0:1 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:2 -> #0:1 (ac3 (native) -> ac3 (ac3_fixed))
Press [q] to stop, [?] for help
[ac3 @ 0x5581377be520] incomplete frame5kB time=00:00:17.33
bitrate=1873.5kbits/s speed=0.377x    
[ac3 @ 0x5581377be520] frame sync error
Error while decoding stream #0:2: Invalid data found when processing input
frame=  750 fps= 13 q=-1.0 Lsize=    7745kB time=00:00:30.01
bitrate=2114.1kbits/s speed=0.539x   
video:7026kB audio:705kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.181954%
[libx264 @ 0x5581377c0120] frame I:36    Avg QP:23.15  size: 47989
[libx264 @ 0x5581377c0120] frame P:189   Avg QP:25.96  size: 14971
[libx264 @ 0x5581377c0120] frame B:525   Avg QP:28.48  size:  5022
[libx264 @ 0x5581377c0120] consecutive B-frames:  6.4%  0.5%  0.8% 92.3%
[libx264 @ 0x5581377c0120] mb I  I16..4:  4.2% 60.4% 35.4%
[libx264 @ 0x5581377c0120] mb P  I16..4:  0.9% 14.6%  5.3%  P16..4:
39.4% 18.0% 10.9%  0.0%  0.0%    skip:10.9%
[libx264 @ 0x5581377c0120] mb B  I16..4:  0.1%  2.4%  0.7%  B16..8:
44.9%  8.7%  2.5%  direct: 2.9%  skip:37.7%  L0:42.3% L1:47.3% BI:10.4%
[libx264 @ 0x5581377c0120] 8x8 transform intra:66.9% inter:67.1%
[libx264 @ 0x5581377c0120] coded y,uvDC,uvAC intra: 89.2% 81.3% 50.7%
inter: 24.8% 17.9% 1.3%
[libx264 @ 0x5581377c0120] i16 v,h,dc,p: 46%  9%  3% 42%
[libx264 @ 0x5581377c0120] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 10% 11% 
6%  9% 13%  7% 11%  7%
[libx264 @ 0x5581377c0120] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 11% 10% 
6%  9% 12%  7%  9%  5%
[libx264 @ 0x5581377c0120] i8c dc,h,v,p: 46% 15% 30%  9%
[libx264 @ 0x5581377c0120] Weighted P-Frames: Y:0.5% UV:0.0%
[libx264 @ 0x5581377c0120] ref P L0: 57.8% 19.6% 17.7%  4.9%  0.0%
[libx264 @ 0x5581377c0120] ref B L0: 93.1%  5.6%  1.3%
[libx264 @ 0x5581377c0120] ref B L1: 96.8%  3.2%
[libx264 @ 0x5581377c0120] kb/s:1918.31


I'd like to rip my DVD to mkv
video h264
audio copy
chapter separations which are on the DVD should be in the mky as well #
until now I haven't found a way to do this...

What is your workflow to do this?

Thanks a lot!
Adi


More information about the ffmpeg-user mailing list