<p>I finally made it work in splicing directly the VOB files with the commands below :</p>

<pre class="lang-bash prettyprint-override"><code>ffmpeg -i VTS_01_2.VOB -ss 463 -c copy -vframes 325 2-manuchoisit.vob

ffmpeg -i VTS_01_2.VOB -ss 353 -t 16 -c copy 3-manutombe.vob
</code></pre>

<p>and then concat the extracts and convert with</p>

<pre class="lang-bash prettyprint-override"><code>ffmpeg -analyzeduration 200M -probesize 150M -i "concat:1-manubus.vob|2-manuchoisit.vob|3-manutombe.vob" -vcodec libx264 -preset veryslow -crf 18 -acodec libfaac -aq 100 -ac 2 -vol 2048 1990-Manu_Redpants.mp4
</code></pre>

<p>No frames lost, precise cuts.</p>

CC BY-SA 3.0
2015-06-04T16:03:24.270Z
2015-06-12T00:45:26.997Z
2015-06-12T00:45:26.997Z
Manuhoz
<p>In the first step you are doing a lossy conversion, you transcode from vob to mp4, and then to ts. For a lossless re-mux you should just re-mux, better to specify both video and audio:</p>

<pre class="lang-bash prettyprint-override"><code>ffmpeg -i VTS_01_1.VOB -c:v copy -c:a copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
</code></pre>

<p>However, if you re-mux for the purpose of slicing then you should be aware that with this method it is possible only on exact keyframe boundary, so you might want to reconsider whether you want to do it this way. For a detailed explanation please see in <a href="https://superuser.com/questions/921066/how-to-cut-unwanted-video-parts-and-join-the-rest-ones-into-one-video-using-ffmp/921680#921680">this answer</a>.</p>

CC BY-SA 3.0
2015-06-04T12:52:56.697Z
After reading your interesting article link, and as I want to precisely cut the extracts, my understanding is that I should have placed -ss after the -i input_file.mp4, and this will be particulary slow, do you confirm ?
Manuhoz
CC BY-SA 3.0
2015-06-04T13:01:42.510Z
Yes, transcoding requires more time and also some quality loss, but gives you better control on the result. If you want a precise cut you should operate on the original VOB file, placing the -ss and -t before the output file (in your case it looks the same as placing after the input file, but to be precise we want the skipping to be done while producing the output). You should generate TS files, so that you don't transcode during concatenation. Once you have all you segments you can merge them and mux the merged movie into the final mp4 without any additional transcoding.
avnr
CC BY-SA 3.0
2015-06-05T19:22:47.497Z
You'll get better results (avoiding timestamp / av-sync glitches) by using DVD tools to get a .ts from a collection of .VOB/.IFO files.  Like `mplayer -dumpfile title1.ts  -dvd-device /path/to/the/dir dvd://1` I think.  I forget what command I used to use for this.  >.<
Peter Cordes
CC BY-SA 3.0
2015-06-05T21:03:50.040Z
I found the command I've used before for dumping a .ts for a DVD title: `tccat`, from the `transcode` package.  Should be equivalent to anything else that knows about dvd structures, and isn't just accessing the VOBs directly.
Peter Cordes
CC BY-SA 3.0
2015-06-04T11:30:28.460Z
2015-06-12T00:45:06.270Z
2017-03-20T10:18:33.487Z
avnr
<p>I read that it is better to extract from vob H264 files within a .ts to have a lossless and more accurate sample, easy to cut, is that correct ?</p>

<p>I used these commands :</p>

<pre><code>ffmpeg -i VTS_01_1.VOB  -acodec libfaac -aq 100 -ac 2 -vol 2048 -vcodec libx264 -preset veryslow -crf 18 -threads 2 manu1.mp4

ffmpeg -i manu1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
</code></pre>

<p>I did extract two video samples from the intermediate .ts file with that kind of command : </p>

<pre><code>ffmpeg -ss 43 -i intermediate1.ts -vcodec copy -vframes 1400 -acodec copy 1-manubus.ts
</code></pre>

<p>if I play separately this .ts files in vlc, they are both completely decoded, no frames are missing</p>

<p>Finalization :</p>

<pre><code>ffmpeg -analyzeduration 200M -probesize 150M -i "concat:1-manubus.ts|2-manuchoisit.ts" -c:v libx264 -crf 18 -preset slow -bsf:a aac_adtstoasc -force_key_frames 0 1990-Manu_Redpants.mp4 
</code></pre>

<p>But then, When I play the final file, the first 6 sec are a frozen frame and then comes the audio and video streams perfectly synchro until the end. If I play the first part 1-manubus.ts, the 6 first seconds exists and are not missing, what's happening ? Something related to first frame not being the I-frames ?</p>

CC BY-SA 3.0
2015-06-03T19:07:51.543Z
Please include the complete console output from each command.
llogan
<editing><ffmpeg><dvd><libx264>
VOB editing with FFMPEG
Manuhoz
# VOB editing with FFMPEG

(Asked by: username_0 on 2015-06-03)

I read that it is better to extract from vob H264 files within a .ts to have a lossless and more accurate sample, easy to cut, is that correct ?
I used these commands :
ffmpeg -i VTS_01_1.VOB  -acodec libfaac -aq 100 -ac 2 -vol 2048 -vcodec libx264 -preset veryslow -crf 18 -threads 2 manu1.mp4

ffmpeg -i manu1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts

I did extract two video samples from the intermediate .ts file with that kind of command : 
ffmpeg -ss 43 -i intermediate1.ts -vcodec copy -vframes 1400 -acodec copy 1-manubus.ts

if I play separately this .ts files in vlc, they are both completely decoded, no frames are missing
Finalization :
ffmpeg -analyzeduration 200M -probesize 150M -i "concat:1-manubus.ts|2-manuchoisit.ts" -c:v libx264 -crf 18 -preset slow -bsf:a aac_adtstoasc -force_key_frames 0 1990-Manu_Redpants.mp4 

But then, When I play the final file, the first 6 sec are a frozen frame and then comes the audio and video streams perfectly synchro until the end. If I play the first part 1-manubus.ts, the 6 first seconds exists and are not missing, what's happening ? Something related to first frame not being the I-frames ?

**Tags:** editing, ffmpeg, dvd, libx264

> **Comments:**
> **username_1**: Please include the complete console output from each command.  

---

## 2 answers

### Answer by username_0 on 2015-06-04. Score: 2

I finally made it work in splicing directly the VOB files with the commands below :
ffmpeg -i VTS_01_2.VOB -ss 463 -c copy -vframes 325 2-manuchoisit.vob

ffmpeg -i VTS_01_2.VOB -ss 353 -t 16 -c copy 3-manutombe.vob

and then concat the extracts and convert with
ffmpeg -analyzeduration 200M -probesize 150M -i "concat:1-manubus.vob|2-manuchoisit.vob|3-manutombe.vob" -vcodec libx264 -preset veryslow -crf 18 -acodec libfaac -aq 100 -ac 2 -vol 2048 1990-Manu_Redpants.mp4

No frames lost, precise cuts.


---

### Answer by username_2 on 2015-06-04. Score: 2

In the first step you are doing a lossy conversion, you transcode from vob to mp4, and then to ts. For a lossless re-mux you should just re-mux, better to specify both video and audio:
ffmpeg -i VTS_01_1.VOB -c:v copy -c:a copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts

However, if you re-mux for the purpose of slicing then you should be aware that with this method it is possible only on exact keyframe boundary, so you might want to reconsider whether you want to do it this way. For a detailed explanation please see in this answer.

> **Comments:**
> **username_0**: After reading your interesting article link, and as I want to precisely cut the extracts, my understanding is that I should have placed -ss after the -i input_file.mp4, and this will be particulary slow, do you confirm ?  
> **username_2**: Yes, transcoding requires more time and also some quality loss, but gives you better control on the result. If you want a precise cut you should operate on the original VOB file, placing the -ss and -t before the output file (in your case it looks the same as placing after the input file, but to be precise we want the skipping to be done while producing the output). You should generate TS files, so that you don't transcode during concatenation. Once you have all you segments you can merge them and mux the merged movie into the final mp4 without any additional transcoding.  
> **username_3**: You'll get better results (avoiding timestamp / av-sync glitches) by using DVD tools to get a .ts from a collection of .VOB/.IFO files.  Like `mplayer -dumpfile title1.ts  -dvd-device /path/to/the/dir dvd://1` I think.  I forget what command I used to use for this.  >.<  
> **username_3**: I found the command I've used before for dumping a .ts for a DVD title: `tccat`, from the `transcode` package.  Should be equivalent to anything else that knows about dvd structures, and isn't just accessing the VOBs directly.  

---

