{"id":8628,"date":"2020-07-29T21:25:05","date_gmt":"2020-07-29T20:25:05","guid":{"rendered":"https:\/\/stevepedwards.today\/DebianAdmin\/?p=8610"},"modified":"2024-06-18T09:31:32","modified_gmt":"2024-06-18T08:31:32","slug":"converting-dvd-vob-files-to-smaller-vob-and-mkv","status":"publish","type":"post","link":"https:\/\/stevepedwards.today\/DebianAdmin\/converting-dvd-vob-files-to-smaller-vob-and-mkv\/","title":{"rendered":"Converting DVD VOB Files to Smaller VOB and MKV with ffmpeg"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_8628\" class=\"pvc_stats all  \" data-element-id=\"8628\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p><span style=\"color: #0000ff;\">cat *.VOB &gt; output.vob<\/span><\/p>\n<p>Now let's inspect the newly created file: we want to find what kind of stuff it contains. Use FFmpeg for that, as follows:<\/p>\n<pre><code>ffmpeg -i output.vob\r\n<\/code><\/pre>\n<p>For example, you might end up with something like:<\/p>\n<pre class=\"\"><code>Input #0, mpeg, from 'output.vob':\r\n  Duration: 01:50:40.99, start: 0.287267, bitrate: 7581 kb\/s\r\n    Stream #0:0[0x1bf]: Data: dvd_nav_packet\r\n    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc\r\n    Stream #0:2[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb\/s\r\n    Stream #0:3[0x89]: Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 768 kb\/s\r\n    Stream #0:4[0x82]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb\/s<\/code><\/pre>\n<h3>Mind the deep-buried streams!<\/h3>\n<p>Normally, while looking for streams, FFmpeg parses only few seconds of the input data as most formats have a global header there that describes everything present in the file. Unfortunately VOBs have no headers and it is likely to find movies that hold additional streams further down the VOB file.<\/p>\n<p>Let FFmpeg scan it thoroughly by adding two more flags:\u00a0<code>-analyzeduration<\/code>\u00a0(in microseconds) and\u00a0<code>-probesize<\/code>\u00a0(in bytes). Honestly I'm not able to tell the difference between those options: put in there some fairly large numbers and tweak them until you are satisfied. For example:<\/p>\n<pre><code>ffmpeg -analyzeduration 100M -probesize 100M -i output.vob\r\n<\/code><\/pre>\n<p>And, not surprisingly, two more streams are found:<\/p>\n<pre class=\"\"><code>...\r\n    Stream #0:5[0x21]: Subtitle: dvd_subtitle\r\n    Stream #0:6[0x20]: Subtitle: dvd_subtitle<\/code><\/pre>\n<p>We are ready to pack our DVD into an .mkv\/vob file. The command looks like:<\/p>\n<pre class=\"\"><code>ffmpeg \\\r\n  -analyzeduration 100M -probesize 100M \\\r\n  -i output.vob \\\r\n  -map 0:1 -map 0:3 -map 0:4 -map 0:5 -map 0:6 \r\n  -codec:v libx264 -crf 21 \\\r\n  -codec:a libmp3lame -qscale:a 2 \\\r\n  -codec:s copy \\\r\n  -threads N\r\n  output.mkv<\/code><\/pre>\n<p>Threads N is No. of CPU cores if CPU supports it.<\/p>\n<p><span style=\"color: #0000ff;\">ffmpeg -analyzeduration 100M -probesize 100M -i Aristocrats.vob -codec:v libx264 -crf 21 -codec:a libmp3lame -qscale:a 2 -codec:s copy <\/span><span style=\"color: #0000ff;\">-threads 2\u00a0 AristocratsLive.vob<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_8628\" class=\"pvc_stats all  \" data-element-id=\"8628\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>cat *.VOB &gt; output.vob Now let's inspect the newly created file: we want to find what kind of stuff it contains. Use FFmpeg for that, as follows: ffmpeg -i output.vob For example, you might end up with something like: Input #0, mpeg, from 'output.vob': Duration: 01:50:40.99, start: 0.287267, bitrate: 7581 kb\/s Stream #0:0[0x1bf]: Data: dvd_nav_packet <a href=\"https:\/\/stevepedwards.today\/DebianAdmin\/converting-dvd-vob-files-to-smaller-vob-and-mkv\/\" class=\"more-link\">...<span class=\"screen-reader-text\">\u00a0 Converting DVD VOB Files to Smaller VOB and MKV with ffmpeg<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8628","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"a3_pvc":{"activated":true,"total_views":1,"today_views":0},"_links":{"self":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/8628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/comments?post=8628"}],"version-history":[{"count":2,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/8628\/revisions"}],"predecessor-version":[{"id":10186,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/8628\/revisions\/10186"}],"wp:attachment":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/media?parent=8628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/categories?post=8628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/tags?post=8628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}