Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I use FFMPEG to convert a video from MP4 to M3U8, using the following command,

ffmpeg -i op.mp4  -b:v 128k -flags -global_header -map 0:0 -map 0:1 -f segment -segment_time 4 -segment_list_size 0 -segment_list op.m3u8 -segment_format mpegts op%05d.ts

I get the below warning :

Non-monotonous DTS in output stream 0:1; previous: 347527, current: 346508; changing to 347528. This may result in incorrect timestamps in the output file.

The M3U8 is generated, but only audio is coming up on quicktime player.

Both the Sample MP4 and M3U8 are available here

So, I would like to know

  1. Reason behind this error. Is it a corrupt mp4 or problem during conversion. The m3u8 is playable is not playable on quicktime properly. Only audio comes up, no video.

  2. How can I possibly fix this

Complete FFMPEG Console Output :

ffmpeg version git-2013-06-06-c51654f Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun  6 2013 12:54:24 with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
  configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
  libavutil      52. 35.100 / 52. 35.100
  libavcodec     55. 15.100 / 55. 15.100
  libavformat    55.  8.102 / 55.  8.102
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 75.101 /  3. 75.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'op.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.8.102
  Duration: 00:00:06.00, start: 0.010000, bitrate: 679 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 640x364 [SAR 1:1 DAR 160:91], 590 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 130 kb/s
    Metadata:
      handler_name    : SoundHandler
[segment @ 0x32e1d60] Codec for stream 0 does not use global headers but container format requires global headers
[segment @ 0x32e1d60] Codec for stream 1 does not use global headers but container format requires global headers
Output #0, segment, to 'op%05d.ts':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.8.102
    Stream #0:0(eng): Video: mpeg2video, yuv420p, 640x364 [SAR 1:1 DAR 160:91], q=2-31, 128 kb/s, 90k tbn, 25 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: mp2, 44100 Hz, stereo, s16, 128 kb/s
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg2video)
  Stream #0:1 -> #0:1 (aac -> mp2)
Press [q] to stop, [?] for help
[segment @ 0x32e1d60] Non-monotonous DTS in output stream 0:1; previous: 347527, current: 346508; changing to 347528. This may result in incorrect timestamps in the output file.
frame=  109 fps=0.0 q=31.0 size=N/A time=00:00:04.29 bitrate=N/A dup=14 drop=0  frame=  151 fps=0.0 q=24.8 Lsize=N/A time=00:00:06.00 bitrate=N/A dup=14 drop=0    
video:350kB audio:96kB subtitle:0 global headers:0kB muxing overhead -100.004823%

With vsync and async options, the error that appears is "Codec for stream 0 does not use global headers but container format requires global headers". Here is the console output :

ffmpeg -i op.mp4  -b:v 128k -flags -global_header -map 0:0 -map 0:1 -f segment -segment_time 4 -segment_list_size 0 -segment_list nop.m3u8 -segment_format mpegts nop%05d.ts  
ffmpeg version git-2013-06-06-c51654f Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun  6 2013 12:54:24 with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
  configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
  libavutil      52. 35.100 / 52. 35.100
  libavcodec     55. 15.100 / 55. 15.100
  libavformat    55.  8.102 / 55.  8.102
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 75.101 /  3. 75.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'op.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.8.102
  Duration: 00:00:06.00, start: 0.010000, bitrate: 679 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 640x364 [SAR 1:1 DAR 160:91], 590 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 130 kb/s
    Metadata:
      handler_name    : SoundHandler
[segment @ 0x3bf3d60] Codec for stream 0 does not use global headers but container format requires global headers
[segment @ 0x3bf3d60] Codec for stream 1 does not use global headers but container format requires global headers
Output #0, segment, to 'nop%05d.ts':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.8.102
    Stream #0:0(eng): Video: mpeg2video, yuv420p, 640x364 [SAR 1:1 DAR 160:91], q=2-31, 128 kb/s, 90k tbn, 25 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: mp2, 44100 Hz, stereo, s16, 128 kb/s
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg2video)
  Stream #0:1 -> #0:1 (aac -> mp2)
Press [q] to stop, [?] for help
[segment @ 0x3bf3d60] Non-monotonous DTS in output stream 0:1; previous: 347527, current: 346508; changing to 347528. This may result in incorrect timestamps in the output file.
frame=  119 fps=0.0 q=31.0 size=N/A time=00:00:04.68 bitrate=N/A dup=14 drop=0  frame=  151 fps=0.0 q=24.8 Lsize=N/A time=00:00:06.00 bitrate=N/A dup=14 drop=0    
video:350kB audio:96kB subtitle:0 global headers:0kB muxing overhead -100.004823%
share|improve this question
    
Please include the complete ffmpeg console output. –  LordNeckbeard Jun 10 '13 at 18:02
    
Edited to add the complete ffmpeg console output –  Divya Bhargov Jun 11 '13 at 1:52
    
What happens if you add the parameters -vsync 1 -async 1 ? –  harrymc Jun 17 '13 at 7:47
    
Updated above the console output with vsync and async options –  Divya Bhargov Jun 18 '13 at 5:24
    
Does this happen for any .mp4 file? –  soandos Mar 12 at 18:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.