<p>The chapter marks are part of the DVD metadata that's on the disc (or its ripped contents). It's not contained in the nav packets.</p>

<p>If you want to get the chapters, you're going to have to use a separate application to get them out. There's two applications that I know of that can do it -- dvd_info (which I wrote, see github) and ogmtools.</p>

<p>mkvmerge supports two chapter formats -- the spec one of the XML with lots of detailed information in it, or the simplified OGM format designed for that container, which is a simple chapter name + start time format on each line. I recommend using that one.</p>

<p>Using those two apps, here's how, assuming you're using track 1.</p>

<pre><code>$ dvd_info --ogm -t 1 /media/cdrom/video_ts &gt; chapters.txt
$ dvdxchap --title 1 /media/cdrom/video_ts &gt; chapters.txt
</code></pre>

<p>Here's a sample output:</p>

<pre><code>CHAPTER01=00:00:00.000
CHAPTER01NAME=Chapter 01
CHAPTER02=00:00:13.500
CHAPTER02NAME=Chapter 02
CHAPTER03=00:06:04.867
CHAPTER03NAME=Chapter 03
CHAPTER04=00:13:42.667
CHAPTER04NAME=Chapter 04
CHAPTER05=00:22:37.867
CHAPTER05NAME=Chapter 05
CHAPTER06=00:28:29.933
CHAPTER06NAME=Chapter 06
CHAPTER07=00:28:42.433
CHAPTER07NAME=Chapter 07
</code></pre>

<p>I don't know how to get the chapter metadata in a matroska file using libav directly, or if it even supports doing that, but mkvmerge certainly can.</p>

<pre><code>$ mkvmerge -o track1.mkv --chapters chapters.txt track1.vob
</code></pre>

<p>On a side note, if you don't want to cat the VOBs into one giant file, you can use dvd_copy to extract it and dump it directly into a MKV. You'd still have to mux in the chapters, but it would skip the step of having to use cat. Note that I've only tested this with libav:</p>

<pre><code>$ dvd_copy -t 1 /media/cdrom/video_ts -o - | avconv -i - -codec copy dvd.mkv
</code></pre>

CC BY-SA 4.0
2018-12-21T11:16:14.900Z
Where do you get `dvd_copy`? I can't find it using file search on packages.ubuntu.com and having such a generic name google is not much help.
soger
CC BY-SA 4.0
2018-12-21T11:21:30.313Z
Never mind I found it, it's in your github project (beandog/dvd_info).
soger
CC BY-SA 4.0
2018-05-30T06:23:11.330Z
2018-05-30T06:23:11.330Z
Steve Dibb
<p>I am trying to grab my DVD into an mkv-Container without loosing the predefined chapters on the DVD disk. I suppose, the chapter information is in the &quot;Stream #0:0[0x1bf]: Data: dvd_nav_packet&quot; track - right? Anyhow the Stream is not supprted by avconv... see last line</p>
<pre><code>adi@venus /media/cdrom/video_ts $ ls
video_ts.bup  vts_01_0.vob  vts_02_1.vob  vts_04_0.bup  vts_05_0.ifo  vts_06_0.vob  vts_07_1.vob  vts_09_0.bup  vts_10_0.ifo  vts_10_4.vob  vts_11_0.vob  vts_12_1.vob  vts_14_0.bup
video_ts.ifo  vts_01_1.vob  vts_03_0.bup  vts_04_0.ifo  vts_05_0.vob  vts_06_1.vob  vts_08_0.bup  vts_09_0.ifo  vts_10_0.vob  vts_10_5.vob  vts_11_1.vob  vts_13_0.bup  vts_14_0.ifo
video_ts.vob  vts_02_0.bup  vts_03_0.ifo  vts_04_0.vob  vts_05_1.vob  vts_07_0.bup  vts_08_0.ifo  vts_09_0.vob  vts_10_1.vob  vts_10_6.vob  vts_12_0.bup  vts_13_0.ifo  vts_14_0.vob
vts_01_0.bup  vts_02_0.ifo  vts_03_0.vob  vts_04_1.vob  vts_06_0.bup  vts_07_0.ifo  vts_08_0.vob  vts_09_1.vob  vts_10_2.vob  vts_11_0.bup  vts_12_0.ifo  vts_13_0.vob  vts_14_1.vob
vts_01_0.ifo  vts_02_0.vob  vts_03_1.vob  vts_05_0.bup  vts_06_0.ifo  vts_07_0.vob  vts_08_1.vob  vts_10_0.bup  vts_10_3.vob  vts_11_0.ifo  vts_12_0.vob  vts_13_1.vob  
adi@venus /media/cdrom/video_ts $ avprobe vts_10_1.vob 
ffprobe version 3.2.10-1~deb9u1 Copyright (c) 2007-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, mpeg, from 'vts_10_1.vob':
  Duration: 00:17:09.44, start: 0.287267, bitrate: 8340 kb/s
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 8000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Unsupported codec with id 100357 for input stream 0
</code></pre>
<p>The important files for me are merged vts_10_1.vob...vts_10_6.vob. In other words:</p>
<p>for var in {1..6}; do cat vts_10_$var.vob &gt;&gt; total.vob; done        #concatenate the files</p>
<p>and afterwards encode total.vob with avconv.</p>
<h1>Questions:</h1>
<ol>
<li>Where are the chapter marks saved and how to include them in the mkv?</li>
<li>How can I see the content of &quot;dvd_nav_packet&quot;?</li>
<li>How can I definde my own chapters in a video-file? Is it a kind of a text-file in the container?</li>
</ol>
<p>Thanks</p>

<video><editing><avconv>
avconv grab DVD with chapter seperations - dvd_nav_packet
Muppetshow12
# avconv grab DVD with chapter seperations - dvd_nav_packet

(Asked by: username_0 on 2018-02-12)

I am trying to grab my DVD into an mkv-Container without loosing the predefined chapters on the DVD disk. I suppose, the chapter information is in the "Stream #0:0[0x1bf]: Data: dvd_nav_packet" track - right? Anyhow the Stream is not supprted by avconv... see last line
adi@venus /media/cdrom/video_ts $ ls
video_ts.bup  vts_01_0.vob  vts_02_1.vob  vts_04_0.bup  vts_05_0.ifo  vts_06_0.vob  vts_07_1.vob  vts_09_0.bup  vts_10_0.ifo  vts_10_4.vob  vts_11_0.vob  vts_12_1.vob  vts_14_0.bup
video_ts.ifo  vts_01_1.vob  vts_03_0.bup  vts_04_0.ifo  vts_05_0.vob  vts_06_1.vob  vts_08_0.bup  vts_09_0.ifo  vts_10_0.vob  vts_10_5.vob  vts_11_1.vob  vts_13_0.bup  vts_14_0.ifo
video_ts.vob  vts_02_0.bup  vts_03_0.ifo  vts_04_0.vob  vts_05_1.vob  vts_07_0.bup  vts_08_0.ifo  vts_09_0.vob  vts_10_1.vob  vts_10_6.vob  vts_12_0.bup  vts_13_0.ifo  vts_14_0.vob
vts_01_0.bup  vts_02_0.ifo  vts_03_0.vob  vts_04_1.vob  vts_06_0.bup  vts_07_0.ifo  vts_08_0.vob  vts_09_1.vob  vts_10_2.vob  vts_11_0.bup  vts_12_0.ifo  vts_13_0.vob  vts_14_1.vob
vts_01_0.ifo  vts_02_0.vob  vts_03_1.vob  vts_05_0.bup  vts_06_0.ifo  vts_07_0.vob  vts_08_1.vob  vts_10_0.bup  vts_10_3.vob  vts_11_0.ifo  vts_12_0.vob  vts_13_1.vob  
adi@venus /media/cdrom/video_ts $ avprobe vts_10_1.vob 
ffprobe version 3.2.10-1~deb9u1 Copyright (c) 2007-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, mpeg, from 'vts_10_1.vob':
  Duration: 00:17:09.44, start: 0.287267, bitrate: 8340 kb/s
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 8000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Unsupported codec with id 100357 for input stream 0

The important files for me are merged vts_10_1.vob...vts_10_6.vob. In other words:
for var in {1..6}; do cat vts_10_$var.vob >> total.vob; done        #concatenate the files
and afterwards encode total.vob with avconv.
Questions:

Where are the chapter marks saved and how to include them in the mkv?
How can I see the content of "dvd_nav_packet"?
How can I definde my own chapters in a video-file? Is it a kind of a text-file in the container?

Thanks

**Tags:** video, editing, avconv


---

## 1 answers

### Answer by username_1 on 2018-05-30. Score: 2

The chapter marks are part of the DVD metadata that's on the disc (or its ripped contents). It's not contained in the nav packets.
If you want to get the chapters, you're going to have to use a separate application to get them out. There's two applications that I know of that can do it -- dvd_info (which I wrote, see github) and ogmtools.
mkvmerge supports two chapter formats -- the spec one of the XML with lots of detailed information in it, or the simplified OGM format designed for that container, which is a simple chapter name + start time format on each line. I recommend using that one.
Using those two apps, here's how, assuming you're using track 1.
$ dvd_info --ogm -t 1 /media/cdrom/video_ts > chapters.txt
$ dvdxchap --title 1 /media/cdrom/video_ts > chapters.txt

Here's a sample output:
CHAPTER01=00:00:00.000
CHAPTER01NAME=Chapter 01
CHAPTER02=00:00:13.500
CHAPTER02NAME=Chapter 02
CHAPTER03=00:06:04.867
CHAPTER03NAME=Chapter 03
CHAPTER04=00:13:42.667
CHAPTER04NAME=Chapter 04
CHAPTER05=00:22:37.867
CHAPTER05NAME=Chapter 05
CHAPTER06=00:28:29.933
CHAPTER06NAME=Chapter 06
CHAPTER07=00:28:42.433
CHAPTER07NAME=Chapter 07

I don't know how to get the chapter metadata in a matroska file using libav directly, or if it even supports doing that, but mkvmerge certainly can.
$ mkvmerge -o track1.mkv --chapters chapters.txt track1.vob

On a side note, if you don't want to cat the VOBs into one giant file, you can use dvd_copy to extract it and dump it directly into a MKV. You'd still have to mux in the chapters, but it would skip the step of having to use cat. Note that I've only tested this with libav:
$ dvd_copy -t 1 /media/cdrom/video_ts -o - | avconv -i - -codec copy dvd.mkv

> **Comments:**
> **username_2**: Where do you get `dvd_copy`? I can't find it using file search on packages.ubuntu.com and having such a generic name google is not much help.  
> **username_2**: Never mind I found it, it's in your github project (beandog/dvd_info).  

---

