Answers.Body: <p>I found a way to resolve this jittering issue. The root cause is that mpeg file doesn't have full PTS info. There's a closed ticket of FFmpeg talking about exactly this problem:</p>
  
  <p><a href="https://trac.ffmpeg.org/ticket/974" rel="nofollow">FFmpeg ticket #974</a></p>
  
  <p>In order to solve this problem, add <code>-fflags +genpts</code> before the input file. Here is a sample FFmpeg command:</p>
  
  <pre><code>ffmpeg -fflags +genpts -i /Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob -c:a copy -c:v copy -threads 8 -sn -y /Users/yusizhang/Movies/vod2Mov_clean/Episode1_clean.mov
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-01T07:38:07.380Z
Answers.Text: I re-opened the FFmpeg ticket, retitled it to: `genpts not enabled automatically when remuxing from VOB to MOV`.  It's silly that users have to run into a problem and then discover an obscure option.
Answers.UserDisplayName: Peter Cordes
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-01T11:01:14.357Z
Answers.Text: Great retitled, I totally agree with it. Hope FFmpeg developers can take it into consideration. Thank you!
Answers.UserDisplayName: Ellis Shen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-21T11:29:56.907Z
Answers.Text: did they ever fix this?
Answers.UserDisplayName: quiquelhappy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-30T23:56:32.147Z
Answers.LastActivityDate: 2015-01-31T23:19:13.583Z
Answers.LastEditDate: 2015-01-31T23:19:13.583Z
Answers.UserDisplayName: Ellis Shen
Body: <p>Does anyone know how to do lossless conversion from *.mpeg/mpg to mov?</p>
  
  <p>I was asked to extract video from DVDs and do editings in FCPX, however FCPX cannot edit *.mpeg/mpg file natively, therefore I need a way to convert it from mpeg.</p>
  
  <p><strong>I have tried two applications to convert mpeg files:</strong></p>
  
  <p>a) <strong>FFmpeg:</strong> I used <code>c:v copy</code> to do file wrapping to Mov file, but the conversion was failed, each frame of converted video file is jittering. Looks like there're some information missed in Mov header. </p>
  
  <pre><code>ffmpeg -i {input_file}.vob -c:v copy -copyts -threads 8 -sn -y {output_file}.mov
  
  ffmpeg started on 2015-01-30 at 16:48:48
  Report written to "ffmpeg-20150130-164848.log"
  Command line:
  ffmpeg -i /Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob -c:v copy -sn -t 30 -report -y /Users/yusizhang/Movies/vod2Mov.mov
  ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
    built on Jan  1 2015 20:24:48 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
    configuration: --prefix=/Volumes/tempdisk/sw --as=yasm --enable-gpl --enable-pthreads --disable-ffplay --disable-ffserver --disable-shared --enable-static --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-zlib --enable-avfilter --enable-fontconfig --enable-libfreetype --enable-libass --enable-libutvideo --enable-filters --enable-postproc --enable-runtime-cpudetect
    libavutil      54. 15.100 / 54. 15.100
    libavcodec     56. 13.100 / 56. 13.100
    libavformat    56. 15.102 / 56. 15.102
    libavdevice    56.  3.100 / 56.  3.100
    libavfilter     5.  2.103 /  5.  2.103
    libswscale      3.  1.101 /  3.  1.101
    libswresample   1.  1.100 /  1.  1.100
    libpostproc    53.  3.100 / 53.  3.100
  Splitting the commandline.
  Reading option '-i' ... matched as input file with argument '/Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob'.
  Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'copy'.
  Reading option '-sn' ... matched as option 'sn' (disable subtitle) with argument '1'.
  Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '30'.
  Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
  Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
  Reading option '/Users/yusizhang/Movies/vod2Mov.mov' ... matched as output file.
  Finished splitting the commandline.
  Parsing a group of options: global .
  Applying option report (generate a report) with argument 1.
  Applying option y (overwrite output files) with argument 1.
  Successfully parsed a group of options.
  Parsing a group of options: input file /Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob.
  Successfully parsed a group of options.
  Opening an input file: /Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob.
  [mpeg @ 0x7fbc5201dc00] Format mpeg probed with size=8192 and score=52
  [mpeg @ 0x7fbc5201dc00] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0
  [mpeg @ 0x7fbc5201dc00] probing stream 0 pp:2500
  [mpeg @ 0x7fbc5201dc00] Probe with size=2012, packets=1 detected mpegvideo with score=25
  [mpeg @ 0x7fbc5201dc00] probed stream 0
  [mpeg @ 0x7fbc5201dc00] max_analyze_duration 5000000 reached at 5005000 microseconds
  [mpeg @ 0x7fbc5201dc00] After avformat_find_stream_info() pos: 0 bytes read:4542608 seeks:2 frames:466
  Input #0, mpeg, from '/Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob':
    Duration: 00:58:50.56, start: 0.233567, bitrate: 2887 kb/s
      Stream #0:0[0x1e0], 152, 1/90000: 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[0x80], 157, 1/90000: Audio: ac3, 48000 Hz, stereo, fltp, 128 kb/s
      Stream #0:2[0x81], 157, 1/90000: Audio: ac3, 48000 Hz, stereo, fltp, 128 kb/s
  Successfully opened the file.
  Parsing a group of options: output file /Users/yusizhang/Movies/vod2Mov.mov.
  Applying option c:v (codec name) with argument copy.
  Applying option sn (disable subtitle) with argument 1.
  Applying option t (record or transcode "duration" seconds of audio/video) with argument 30.
  Successfully parsed a group of options.
  Opening an output file: /Users/yusizhang/Movies/vod2Mov.mov.
  Successfully opened the file.
  detected 8 logical cores
  [graph 0 input from stream 0:1 @ 0x7fbc51501240] Setting 'time_base' to value '1/48000'
  [graph 0 input from stream 0:1 @ 0x7fbc51501240] Setting 'sample_rate' to value '48000'
  [graph 0 input from stream 0:1 @ 0x7fbc51501240] Setting 'sample_fmt' to value 'fltp'
  [graph 0 input from stream 0:1 @ 0x7fbc51501240] Setting 'channel_layout' to value '0x3'
  [graph 0 input from stream 0:1 @ 0x7fbc51501240] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
  [audio format for output stream 0:1 @ 0x7fbc515008e0] Setting 'sample_fmts' to value 'fltp'
  [audio format for output stream 0:1 @ 0x7fbc515008e0] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
  [AVFilterGraph @ 0x7fbc51501880] query_formats: 5 queried, 12 merged, 0 already done, 0 delayed
  [aac @ 0x7fbc52022000] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.
  [AVIOContext @ 0x7fbc5154cb80] Statistics: 0 seeks, 0 writeouts
  [AVIOContext @ 0x7fbc51501b20] Statistics: 4542608 bytes read, 2 seeks
  </code></pre>
  
  <p>b) <strong>Qucktime X:</strong> I use Quicktime x to open mpeg files and "Save" it into another file. I thought it would be a lossless conversion, but the color was shifting and I saw the bitrate of video was drop.</p>
  
  <p>Is there any good mpeg/mpg to mov wrapper tool which can do the "wrapping" lossless? Or is there a suggested conversion method?</p>
  
  <p>Thanks!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-30T21:26:17.423Z
Comments.Text: Why does FC not support MPEG-2 video in MPG container? That sounds ridiculous. Can you show your `ffmpeg` command and the complete console output?
Comments.UserDisplayName: llogan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-30T21:37:12.917Z
Comments.Text: Hi LordNeckbread, I updated the description with ffmpeg command. FCPX cannot edit any file with Mpeg container... it really makes me headache.
Comments.UserDisplayName: Ellis Shen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-30T21:41:30.423Z
Comments.Text: You forgot the console output from your `ffmpeg` command.
Comments.UserDisplayName: llogan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-30T21:42:38.673Z
Comments.Text: ffmpeg -i {input_file}.vob -c:v copy -copyts -threads 8 -sn -y {output_file}.mov
Comments.UserDisplayName: Ellis Shen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-30T21:43:44.560Z
Comments.Text: That's the command, and I saw that in your question. I want to see what `ffmpeg` says after you enter that and complete the encoding. You can add `-t 30` to output a 30 second video so you don't have to wait long.
Comments.UserDisplayName: llogan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-30T21:47:33.043Z
Comments.Text: Just a guess, try without `-copyts`. Timestamps are different in mov (it doesn't use frame timestamps, it uses frame durations)
Comments.UserDisplayName: SlimSCSI
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-30T22:01:16.093Z
Comments.Text: Sorry, my bad. I pasted console output to the question. I tried withouut -copyts, but output mov file still has problem...
Comments.UserDisplayName: Ellis Shen
Tags: <ffmpeg><mpeg>
Title: How to do mpeg/mpg to mov lossless conversion?
UserDisplayName: Ellis Shen
ThreadText: # How to do mpeg/mpg to mov lossless conversion?
  
  (Asked by: username_0 on 2015-01-30)
  
  Does anyone know how to do lossless conversion from \*.mpeg/mpg to mov?
  
  I was asked to extract video from DVDs and do editings in FCPX, however FCPX cannot edit \*.mpeg/mpg file natively, therefore I need a way to convert it from mpeg.
  
  **I have tried two applications to convert mpeg files:**
  
  a) **FFmpeg:** I used `c:v copy` to do file wrapping to Mov file, but the conversion was failed, each frame of converted video file is jittering. Looks like there're some information missed in Mov header.
  
  ```
  ffmpeg -i {input_file}.vob -c:v copy -copyts -threads 8 -sn -y {output_file}.mov
  
  ffmpeg started on 2015-01-30 at 16:48:48
  Report written to "ffmpeg-20150130-164848.log"
  Command line:
  ffmpeg -i /Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob -c:v copy -sn -t 30 -report -y /Users/yusizhang/Movies/vod2Mov.mov
  ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
    built on Jan  1 2015 20:24:48 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
    configuration: --prefix=/Volumes/tempdisk/sw --as=yasm --enable-gpl --enable-pthreads --disable-ffplay --disable-ffserver --disable-shared --enable-static --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-zlib --enable-avfilter --enable-fontconfig --enable-libfreetype --enable-libass --enable-libutvideo --enable-filters --enable-postproc --enable-runtime-cpudetect
    libavutil      54. 15.100 / 54. 15.100
    libavcodec     56. 13.100 / 56. 13.100
    libavformat    56. 15.102 / 56. 15.102
    libavdevice    56.  3.100 / 56.  3.100
    libavfilter     5.  2.103 /  5.  2.103
    libswscale      3.  1.101 /  3.  1.101
    libswresample   1.  1.100 /  1.  1.100
    libpostproc    53.  3.100 / 53.  3.100
  Splitting the commandline.
  Reading option '-i' ... matched as input file with argument '/Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob'.
  Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'copy'.
  Reading option '-sn' ... matched as option 'sn' (disable subtitle) with argument '1'.
  Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '30'.
  Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
  Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
  Reading option '/Users/yusizhang/Movies/vod2Mov.mov' ... matched as output file.
  Finished splitting the commandline.
  Parsing a group of options: global .
  Applying option report (generate a report) with argument 1.
  Applying option y (overwrite output files) with argument 1.
  Successfully parsed a group of options.
  Parsing a group of options: input file /Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob.
  Successfully parsed a group of options.
  Opening an input file: /Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob.
  [mpeg @ 0x7fbc5201dc00] Format mpeg probed with size=8192 and score=52
  [mpeg @ 0x7fbc5201dc00] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0
  [mpeg @ 0x7fbc5201dc00] probing stream 0 pp:2500
  [mpeg @ 0x7fbc5201dc00] Probe with size=2012, packets=1 detected mpegvideo with score=25
  [mpeg @ 0x7fbc5201dc00] probed stream 0
  [mpeg @ 0x7fbc5201dc00] max_analyze_duration 5000000 reached at 5005000 microseconds
  [mpeg @ 0x7fbc5201dc00] After avformat_find_stream_info() pos: 0 bytes read:4542608 seeks:2 frames:466
  Input #0, mpeg, from '/Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob':
    Duration: 00:58:50.56, start: 0.233567, bitrate: 2887 kb/s
      Stream #0:0[0x1e0], 152, 1/90000: 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[0x80], 157, 1/90000: Audio: ac3, 48000 Hz, stereo, fltp, 128 kb/s
      Stream #0:2[0x81], 157, 1/90000: Audio: ac3, 48000 Hz, stereo, fltp, 128 kb/s
  Successfully opened the file.
  Parsing a group of options: output file /Users/yusizhang/Movies/vod2Mov.mov.
  Applying option c:v (codec name) with argument copy.
  Applying option sn (disable subtitle) with argument 1.
  Applying option t (record or transcode "duration" seconds of audio/video) with argument 30.
  Successfully parsed a group of options.
  Opening an output file: /Users/yusizhang/Movies/vod2Mov.mov.
  Successfully opened the file.
  detected 8 logical cores
  [graph 0 input from stream 0:1 @ 0x7fbc51501240] Setting 'time_base' to value '1/48000'
  [graph 0 input from stream 0:1 @ 0x7fbc51501240] Setting 'sample_rate' to value '48000'
  [graph 0 input from stream 0:1 @ 0x7fbc51501240] Setting 'sample_fmt' to value 'fltp'
  [graph 0 input from stream 0:1 @ 0x7fbc51501240] Setting 'channel_layout' to value '0x3'
  [graph 0 input from stream 0:1 @ 0x7fbc51501240] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
  [audio format for output stream 0:1 @ 0x7fbc515008e0] Setting 'sample_fmts' to value 'fltp'
  [audio format for output stream 0:1 @ 0x7fbc515008e0] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
  [AVFilterGraph @ 0x7fbc51501880] query_formats: 5 queried, 12 merged, 0 already done, 0 delayed
  [aac @ 0x7fbc52022000] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.
  [AVIOContext @ 0x7fbc5154cb80] Statistics: 0 seeks, 0 writeouts
  [AVIOContext @ 0x7fbc51501b20] Statistics: 4542608 bytes read, 2 seeks
  
  ```
  
  b) **Qucktime X:** I use Quicktime x to open mpeg files and "Save" it into another file. I thought it would be a lossless conversion, but the color was shifting and I saw the bitrate of video was drop.
  
  Is there any good mpeg/mpg to mov wrapper tool which can do the "wrapping" lossless? Or is there a suggested conversion method?
  
  Thanks!
  
  **Tags:** ffmpeg, mpeg
  
  > **Comments:**
  > **username_1**: Why does FC not support MPEG-2 video in MPG container? That sounds ridiculous. Can you show your `ffmpeg` command and the complete console output?  
  > **username_0**: Hi LordNeckbread, I updated the description with ffmpeg command. FCPX cannot edit any file with Mpeg container... it really makes me headache.  
  > **username_1**: You forgot the console output from your `ffmpeg` command.  
  > **username_0**: ffmpeg -i {input_file}.vob -c:v copy -copyts -threads 8 -sn -y {output_file}.mov  
  > **username_1**: That's the command, and I saw that in your question. I want to see what `ffmpeg` says after you enter that and complete the encoding. You can add `-t 30` to output a 30 second video so you don't have to wait long.  
  > **username_2**: Just a guess, try without `-copyts`. Timestamps are different in mov (it doesn't use frame timestamps, it uses frame durations)  
  > **username_0**: Sorry, my bad. I pasted console output to the question. I tried withouut -copyts, but output mov file still has problem...  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-01-30. Score: 5
  
  I found a way to resolve this jittering issue. The root cause is that mpeg file doesn't have full PTS info. There's a closed ticket of FFmpeg talking about exactly this problem:
  
  [FFmpeg ticket #974](https://trac.ffmpeg.org/ticket/974)
  
  In order to solve this problem, add `-fflags +genpts` before the input file. Here is a sample FFmpeg command:
  
  ```
  ffmpeg -fflags +genpts -i /Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob -c:a copy -c:v copy -threads 8 -sn -y /Users/yusizhang/Movies/vod2Mov_clean/Episode1_clean.mov
  
  ```
  
  > **Comments:**
  > **username_3**: I re-opened the FFmpeg ticket, retitled it to: `genpts not enabled automatically when remuxing from VOB to MOV`.  It's silly that users have to run into a problem and then discover an obscure option.  
  > **username_0**: Great retitled, I totally agree with it. Hope FFmpeg developers can take it into consideration. Thank you!  
  > **username_4**: did they ever fix this?  
  
  ---
  
  