[FFmpeg-user] ffmpeg convert to wrong duration using dvd2concat

Etienne Desautels etienne.desautels at gmail.com
Wed Jan 20 17:31:50 CET 2016


Hi,

I'm analyzing/converting video from DVD .iso and I use dvd2concat for this. For at least 2 DVD, when using dvd2concat, ffmpeg return a video that is 1.5 x longer then the original. ffmpeg report the good duration in the stream info at the start, but the wrong duration at the end of the process. The problem is not present if I don't use dvd2concat (by specifying .iso directly as the input or by specifying .VOB of the mounted .iso). Also, video converted with the concat file will have the same frame repeated for the extra duration (almost 5 min. in the case below).

00:09:55 is the good duration (or 595 seconds) and 00:14:52.67 is wrong.

------------------------------------------------
I'm producing the concat file like this:
/usr/local/bin/dvd2concat -title 1 /home/mmac/iso/mountpoint >  /tmp/dvd_concat.txt

------------------------------------------------
The dvd_concat.txt content (looks fine to me):
ffconcat version 1.0

stream
exact_stream_id 0x1E0

stream
exact_stream_id 0x80

file 'subfile,,start,0,end,312870912,,:/home/mmac/iso/mountpoint/VIDEO_TS/VTS_01_1.VOB'
duration 00:04:57.734

file 'subfile,,start,312870912,end,625534976,,:/home/mmac/iso/mountpoint/VIDEO_TS/VTS_01_1.VOB'
duration 00:04:57.433

------------------------------------------------
The command with the concat file (duration is wrong at end):
ffmpeg -f concat -safe 0 -i /tmp/dvd_concat.txt -f null -af ebur128=peak=true:framelog=verbose -vf idet,cropdetect=0.14:2:1 -y /dev/nullffmpeg version N-75845-g079d553 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
  configuration: --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  4.100 / 57.  4.100
  libavformat    57.  3.100 / 57.  3.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 10.100 /  6. 10.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, concat, from '/tmp/dvd_concat.txt':
  Duration: 00:09:55.17, start: 0.228411, bitrate: 0 kb/s
    Stream #0:0: Video: mpeg2video (Main), yuv420p(tv), 720x480 [SAR 8:9 DAR 4:3], 8000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
Output #0, null, to '/dev/null':
  Metadata:
    encoder         : Lavf57.3.100
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x480 [SAR 8:9 DAR 4:3], q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc57.4.100 rawvideo
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      encoder         : Lavc57.4.100 pcm_s16le
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> rawvideo (native))
  Stream #0:1 -> #0:1 (ac3 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[null @ 0x40b5400] Encoder did not produce proper pts, making some up.
[Parsed_cropdetect_1 @ 0x40b8900] x1:719 x2:0 y1:479 y2:0 w:-718 h:-478 x:720 y:480 pts:6006 t:0.066733 crop=-718:-478:720:480
[Parsed_cropdetect_1 @ 0x40b8900] x1:719 x2:0 y1:479 y2:0 w:-718 h:-478 x:720 y:480 pts:9009 t:0.100100 crop=-718:-478:720:480
[Parsed_cropdetect_1 @ 0x40b8900] x1:719 x2:0 y1:479 y2:0 w:-718 h:-478 x:720 y:480 pts:12012 t:0.133467 crop=-718:-478:720:480
[Parsed_cropdetect_1 @ 0x40b8900] x1:719 x2:0 y1:479 y2:0 w:-718 h:-478 x:720 y:480 pts:15015 t:0.166833 crop=-718:-478:720:480
...
[Parsed_cropdetect_1 @ 0x40b8900] x1:719 x2:0 y1:479 y2:0 w:-718 h:-478 x:720 y:480 pts:80331005 t:892.566722 crop=-718:-478:720:480
[Parsed_cropdetect_1 @ 0x40b8900] x1:719 x2:0 y1:479 y2:0 w:-718 h:-478 x:720 y:480 pts:80334008 t:892.600089 crop=-718:-478:720:480
[Parsed_cropdetect_1 @ 0x40b8900] x1:719 x2:0 y1:479 y2:0 w:-718 h:-478 x:720 y:480 pts:80337011 t:892.633456 crop=-718:-478:720:480
frame=17837 fps=348 q=-0.0 Lsize=N/A time=00:14:52.67 bitrate=N/A    
video:1672kB audio:111594kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[Parsed_idet_0 @ 0x40b8220] Repeated Fields: Neither: 17837 Top:     0 Bottom:     0
[Parsed_idet_0 @ 0x40b8220] Single frame detection: TFF:    66 BFF:    43 Progressive:  1031 Undetermined: 16697
[Parsed_idet_0 @ 0x40b8220] Multi frame detection: TFF:    34 BFF:     7 Progressive: 17604 Undetermined:   192
[Parsed_ebur128_0 @ 0x40c8280] Summary:

  Integrated loudness:
    I:         -23.6 LUFS
    Threshold: -34.9 LUFS

  Loudness range:
    LRA:        15.0 LU
    Threshold: -44.8 LUFS
    LRA low:   -35.7 LUFS
    LRA high:  -20.7 LUFS

  True peak:
    Peak:       -9.4 dBFS

------------------------------------------------
And the command calling the .VOB directly (duration is good at end):
ffmpeg -i /home/mmac/iso/mountpoint/VIDEO_TS/VTS_01_1.VOB -f null -af ebur128=peak=true:framelog=verbose -vf idet,cropdetect=0.14:2:1 -y /dev/null
ffmpeg version N-75845-g079d553 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
  configuration: --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  4.100 / 57.  4.100
  libavformat    57.  3.100 / 57.  3.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 10.100 /  6. 10.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mpeg, from '/home/mmac/iso/mountpoint/VIDEO_TS/VTS_01_1.VOB':
  Duration: 00:09:55.14, start: 0.228411, bitrate: 8408 kb/s
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x480 [SAR 8:9 DAR 4:3], 8000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
Output #0, null, to '/dev/null':
  Metadata:
    encoder         : Lavf57.3.100
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x480 [SAR 8:9 DAR 4:3], q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc57.4.100 rawvideo
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      encoder         : Lavc57.4.100 pcm_s16le
Stream mapping:
  Stream #0:1 -> #0:0 (mpeg2video (native) -> rawvideo (native))
  Stream #0:2 -> #0:1 (ac3 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[null @ 0x2f52800] Encoder did not produce proper pts, making some up.
[Parsed_cropdetect_1 @ 0x2f57a00] x1:719 x2:0 y1:479 y2:0 w:-718 h:-478 x:720 y:480 pts:6006 t:0.066733 crop=-718:-478:720:480
[Parsed_cropdetect_1 @ 0x2f57a00] x1:719 x2:0 y1:479 y2:0 w:-718 h:-478 x:720 y:480 pts:9009 t:0.100100 crop=-718:-478:720:480
[Parsed_cropdetect_1 @ 0x2f57a00] x1:719 x2:0 y1:479 y2:0 w:-718 h:-478 x:720 y:480 pts:12012 t:0.133467 crop=-718:-478:720:480
...
[Parsed_cropdetect_1 @ 0x2f57a00] x1:719 x2:0 y1:479 y2:0 w:-718 h:-478 x:720 y:480 pts:53555502 t:595.061133 crop=-718:-478:720:480
[Parsed_cropdetect_1 @ 0x2f57a00] x1:719 x2:0 y1:479 y2:0 w:-718 h:-478 x:720 y:480 pts:53558505 t:595.094500 crop=-718:-478:720:480
[Parsed_cropdetect_1 @ 0x2f57a00] x1:719 x2:0 y1:479 y2:0 w:-718 h:-478 x:720 y:480 pts:53561508 t:595.127867 crop=-718:-478:720:480
frame=17837 fps=351 q=-0.0 Lsize=N/A time=00:09:55.16 bitrate=N/A    
video:1672kB audio:111594kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[Parsed_idet_0 @ 0x2f57320] Repeated Fields: Neither: 17837 Top:     0 Bottom:     0
[Parsed_idet_0 @ 0x2f57320] Single frame detection: TFF:    66 BFF:    43 Progressive:  1031 Undetermined: 16697
[Parsed_idet_0 @ 0x2f57320] Multi frame detection: TFF:    34 BFF:     7 Progressive: 17604 Undetermined:   192
[Parsed_ebur128_0 @ 0x345bde0] Summary:

  Integrated loudness:
    I:         -23.6 LUFS
    Threshold: -34.9 LUFS

  Loudness range:
    LRA:        15.0 LU
    Threshold: -44.8 LUFS
    LRA low:   -35.7 LUFS
    LRA high:  -20.7 LUFS

  True peak:
    Peak:       -9.4 dBFS


Regards,
Etienne Desautels



More information about the ffmpeg-user mailing list