[FFmpeg-user] Rip DVD with ffmpeg

Adi Marvillo adi5 at gmx.at
Sat Feb 24 17:04:57 EET 2018



Am 2018-02-22 um 14:43 schrieb Nicolas George:
> Adi Marvillo (2018-02-22):
>> Thanks Steve and ZikZak. I've dumped the DVD with mencoder onto the HDD
>> but the chapters are still lost. I thought the chapter marks are stored
>> in Stream #0:0 below but they are not as VLC nor ffprobe don't show them...
>> I wanted to process the vob-file with ffmpeg afterwards ;)
>> FYI: I didn't encode anything in this dumping-step in order not to loose
>> quality.
>> I don't understand where the chapter information is stored in the DVDs.
>> Anybody knows?
> On DVDs, the chapter information, like all the rest of the metadata
> (language of the streams, palette of the subtitles, etc.), is stored in
> the IFO files. MPlayer can read them when reading the DVD directly
> through libdvdread/libdvdcss. FFmpeg, on the other hand, does not know
> how to read DVDs directly, and the information is not present in the VOB
> files.
>
> Also, concatenating the VOB files like you did will not work correctly,
> due to timestamps resets and menu data interleaved with the actual video
> data. You can use the "dvd2concat" script distributed along with FFmpeg
> to generate a concat script that only takes the relevant part of the VOB
> files and controls the timestamp resets. It does not handle chapters,
> but that could be added with a little effort.
>
>> Am 2018-02-21 um 17:27 schrieb Steve Boyer:
> Please remember that top-posting is forbidden on this list. If you do
> not know what it means, look it up.
>
> Regards,
>
>
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
Hi Nicolas, thanks for your support!
Meanwhile I managed to extract the chapterinformation with the command
"mplayer dvd://TITLE -identify >> chapterfile.txt". This command dumps
all metainformation of the current title into chapterfile.txt. TITLE has
to be replaced by the number indicating the correct title on the current
source - in this case it's 7 .
I think this is "ID_DVD_TITLE_8_CHAPTERS=38" in chapterfile.txt (see
below) when beginning to count with the index 0 instead of
ID_DVD_TITLE_1_CHAPTERS=5

Here a part of chapterfile-dump:
adi at HOST:/media/adi/bd29891a-00d1-42f2-997c-6d3073626884/Videos/monsterBox$
cat chapterfile.txt
MPlayer 1.3.0 (Debian), built with gcc-6.2.1 (C) 2000-2016 MPlayer Team
Playing dvd://11.
ID_DVD_TITLES=15
ID_DVD_TITLE_1_CHAPTERS=5
ID_DVD_TITLE_1_ANGLES=1
ID_DVD_TITLE_2_CHAPTERS=11
ID_DVD_TITLE_2_ANGLES=1
ID_DVD_TITLE_3_CHAPTERS=4
ID_DVD_TITLE_3_ANGLES=1
ID_DVD_TITLE_4_CHAPTERS=4
ID_DVD_TITLE_4_ANGLES=1
ID_DVD_TITLE_5_CHAPTERS=5
ID_DVD_TITLE_5_ANGLES=1
ID_DVD_TITLE_6_CHAPTERS=3
ID_DVD_TITLE_6_ANGLES=1
ID_DVD_TITLE_7_CHAPTERS=2
ID_DVD_TITLE_7_ANGLES=1
ID_DVD_TITLE_8_CHAPTERS=38
ID_DVD_TITLE_8_ANGLES=1
ID_DVD_TITLE_9_CHAPTERS=3
ID_DVD_TITLE_9_ANGLES=1
ID_DVD_TITLE_10_CHAPTERS=3
ID_DVD_TITLE_10_ANGLES=1
ID_DVD_TITLE_11_CHAPTERS=14
ID_DVD_TITLE_11_ANGLES=1
ID_DVD_TITLE_12_CHAPTERS=3
ID_DVD_TITLE_12_ANGLES=1
ID_DVD_TITLE_13_CHAPTERS=3
ID_DVD_TITLE_13_ANGLES=1
ID_DVD_TITLE_14_CHAPTERS=3
ID_DVD_TITLE_14_ANGLES=1
ID_DVD_TITLE_15_CHAPTERS=3
ID_DVD_TITLE_15_ANGLES=1
ID_DVD_TITLE_1_LENGTH=5.000
ID_DVD_TITLE_2_LENGTH=174.960
ID_DVD_TITLE_3_LENGTH=74.960
ID_DVD_TITLE_4_LENGTH=74.960
ID_DVD_TITLE_5_LENGTH=99.960
ID_DVD_TITLE_6_LENGTH=49.960
ID_DVD_TITLE_7_LENGTH=127.920
ID_DVD_TITLE_8_LENGTH=258.960
ID_DVD_TITLE_9_LENGTH=138.400
ID_DVD_TITLE_10_LENGTH=170.040
ID_DVD_TITLE_11_LENGTH=6092.080
ID_DVD_TITLE_12_LENGTH=138.880
ID_DVD_TITLE_13_LENGTH=126.760
ID_DVD_TITLE_14_LENGTH=100.040
ID_DVD_TITLE_15_LENGTH=128.000
ID_DVD_DISC_ID=5FFA8A29BAAD6646A0683DA76B86EC39
ID_DVD_VOLUME_ID=XXXXXXXXXXXXXX
There are 15 titles on this DVD.

ID_DVD_CURRENT_TITLE=11
There are 1 angles in this DVD title.
audio stream: 0 format: ac3 (stereo) language: de aid: 128.

ID_AUDIO_ID=128
ID_AID_128_LANG=de
number of audio channels on disk: 1.
subtitle ( sid ): 0 language: de

ID_SUBTITLE_ID=0
ID_SID_0_LANG=de
number of subtitles on disk: 1

CHAPTERS:
00:00:00.000,00:07:30.720,00:14:29.280,00:24:08.640,00:32:42.240,00:41:30.400,00:49:51.040,00:57:35.200,01:05:51.040,01:11:55.360,01:19:26.560,01:25:59.200,01:30:36.640,01:35:31.840,
ID_VIDEO_ID=0
MPEG-PS file format detected.
ID_AUDIO_ID=128
VIDEO:  MPEG2  720x576  (aspect 3)  25.000 fps  8000.0 kbps (1000.0 kbyte/s)

Please see the line beginning with "CHAPTERS:"
Interesting: The chaptermarks are exactly 5 sec too late - might be
because of "ID_DVD_TITLE_1_LENGTH=5.000" in chapterfile.txt - anyhow I
don't understand it, but I accept it.

After ripping the XXX.vob with ffmpeg to an XXX.mkv the chaptermarks can
easily be included with mkvmerge. Please assure the Syntax below
(chapterfile2.txt)

adi at HOST:mkvmerge -o OUTPUT.mkv --chapters chapterfile2.txt XXX.mkv
adi at HOST:cat chapterfile2.txt         # Syntax of chapter textfile for
mkvmerge
CHAPTER01=00:00:00.000
CHAPTER01NAME=Intro
CHAPTER02=00:00:53.500
CHAPTER02NAME=Baby prepares to rock

I am not happy with using mkvmerge, because it's much better to combine
the chaptermarks with forced keyframes 0.1 sec  after the chaptermarks
(- forced_key_frames chapter+0.1 ).
Please can you help me with this? - I couldn't find the command after
searching quite a time in the documentation - it simply didn't work.

Questions:
How does ffmpeg write chapter marks from a textfile into a
mkv-container? Could the option be -map_chapters and what is the correct
syntax to use?!?
How should the chapter textfile for ffmpeg look - syntax?
How can I include a forced keyframe 0.1 sec after the chaptermarks and
at certain points? (this test did not work:
ffmpeg -i VTS_08_1.VOB -t 00:02:00 -force_key_frames 00:00:05 -g 300
-aspect "16:9" -map 0:v -c:v libx264 -map 0:a -c:a copy forcedkeyframe.mkv)

THX Adi


More information about the ffmpeg-user mailing list