Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE

This forum has not been maintained for a long time and will probably get deleted in the near future.
For faster responses to your questions, please use StackOverflow instead and tag your questions with "FFmpeg".
If you need a backup of the posts from this forum, please contact me directly.

Video encoder & segmenter for HLS VoD poor quality

Discussions about problems encountered using ffmpeg.
Forum rules
FFmpeg is in a state of perpetual development and we do not currently have the person power to backport fixes to official releases. As such, if you wish to query or report a bug, you must try with the latest development branch revision of FFmpeg to confirm the issue still exists. The latest FFmpeg can be downloaded from here: http://www.ffmpeg.org/download.html

Video encoder & segmenter for HLS VoD poor quality

Postby murilozilli » Fri Jul 07, 2017 8:10 pm

I am trying to encode and segment video for HLS on demand(VoD).
I am using the following code for such:

Code: Select all
 ffmpeg -i 20170706_174314.mp4 -c 24 \
            -vcodec libx264 -acodec aac -ac 1 -strict -2 -b:v 128k \
            -profile:v baseline -maxrate 400k -bufsize 1835k \
            -hls_time 10 -hls_playlist_type vod -vsync 1 \
            video_chunks/index1.m3u8 \
            -c 24 -vcodec libx264 -acodec aac -ac 1 -strict -2 -b:v 128k \
            -profile:v baseline -maxrate 700k -bufsize 1835k \
            -hls_time 10 -hls_playlist_type vod -vsync 1 \

I tried this other code also just for segmenting but had the same exactly problem:

Code: Select all
 ffmpeg -i 20170706_174314.mp4 \
    -c:a libmp3lame -ar 48000 -ab 64k  -c:v libx264 -b:v 128k -flags \
    -global_header -map 0 -f segment \
    -segment_list video_chunks/test.m3u8 -segment_time 10 -segment_format mpegts \

Later on I create another playlist with bandwidth separators to call on the two other playlists generated with the code above.

This code was working great on some videos but yesterday I recorded a video with my Samsung J7 Prime phone to test since the videos will be generated by phone and this video was poorly encoded. The quality sucks and some parts of the video turned Black&White.

Another thing I noticed on this video is that the following message kept appearing in loop until the end of the encoding&segmenting process.

Past duration X too large

Where X is a decimal really close to


The Dropbox link to the video is below:


My FFmpeg version:

Code: Select all
 ffmpeg --version
    ffmpeg version N-86482-gbc40674 Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 7.1.0 (GCC)
      configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
      libavutil      55. 66.100 / 55. 66.100
      libavcodec     57. 99.100 / 57. 99.100
      libavformat    57. 73.100 / 57. 73.100
      libavdevice    57.  7.100 / 57.  7.100
      libavfilter     6. 92.100 /  6. 92.100
      libswscale      4.  7.101 /  4.  7.101
      libswresample   2.  8.100 /  2.  8.100
      libpostproc    54.  6.100 / 54.  6.100

SO: Windows 10
Posts: 3
Joined: Fri Jul 07, 2017 8:03 pm

Return to ffmpeg

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests