Results 1 to 3 of 3

Thread: Keyframe alignment problem with Wowza and FFMPEG

  1. #1
    Join Date
    Dec 2012
    Posts
    28

    Default Keyframe alignment problem with Wowza and FFMPEG

    Hi guys.

    I have a problem which I don't know how to solve it. The problem is our customers have an unstable bandwidth and when they watch videos, changing bitrate happens a lot. For example they start with 128kbps but after 3 seconds they go up to 5mbps and after 10 seconds they'll back down on 64kbps. After sometimes, video freeze or going back and forward automatically. Its like i'm watching 3rd bitrate on 00:01:30, when I shift to 4th bitrate video jump to 00:01:35. Sometimes picture freeze, audio go back on beginning of chunk and start playing! When audio reaches to video, video will continue to playback!
    It happens a lot and I really don't know how to fix it. I encoded my videos with FFMPEG exactly as Wowza instructed but I still have the problem. It seems I have keyframe alignment problem but I don't know how to fix it.

    I use Wowza perpetual 4.1.0 (build 12602) with JW Premium.
    My protocol is HLS.

    Here is the way I encoded videos to 7 bitrates:
    ffmpeg.exe -y -i Input.mp4 -s 400x224 -y -strict experimental -acodec aac -ab 64k -ac 2 -ar 48000 -vcodec libx264 -vprofile baseline -level 30 -g 48 -b 50000 -threads 64 output_50.mp4
    ffmpeg.exe -y -i Input.mp4 -s 512x288 -y -strict experimental -acodec aac -ab 64k -ac 2 -ar 48000 -vcodec libx264 -vprofile baseline -level 30 -g 48 -b 150000 -threads 64 output_150.mp4
    ffmpeg.exe -y -i Input.mp4 -s 640x360 -y -strict experimental -acodec aac -ab 64k -ac 2 -ar 48000 -vcodec libx264 -vprofile baseline -level 30 -g 48 -b 300000 -threads 64 output_300.mp4
    ffmpeg.exe -y -i Input.mp4 -s 704x400 -y -strict experimental -acodec aac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -vprofile baseline -level 30 -g 48 -b 500000 -threads 64 output_500.mp4
    ffmpeg.exe -y -i Input.mp4 -s 898x480 -y -strict experimental -acodec aac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -vprofile baseline -level 30 -g 48 -b 700000 -threads 64 output_700.mp4
    ffmpeg.exe -y -i Input.mp4 -s 960x540 -y -strict experimental -acodec aac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -vprofile baseline -level 30 -g 48 -b 1000000 -threads 64 output_1000.mp4
    ffmpeg.exe -y -i Input.mp4 -s 1280x720 -y -strict experimental -acodec aac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -vprofile baseline -level 30 -g 48 -b 1500000 -threads 64 output_1500.mp4

    And here is latest video which has the same problem:
    http://tv.digikala.com/Video/Review/...Phone_6_Review

  2. #2

    Default

    Hi,

    The issue you may be experiencing is that unless 2 pass encoding is used the output from each encode will not be aligned to each other.

    Please see this article

    Frequently-requested-FFMPEG-command-examples-for-Wowza

    Specifically the example at

    6. Generate keyframe aligned multi-bitrate VOD rendition (Linux)

    Andrew

  3. #3
    Join Date
    Dec 2014
    Posts
    16

    Default

    Quote Originally Posted by andrew_k View Post
    The issue you may be experiencing is that unless 2 pass encoding is used the output from each encode will not be aligned to each other.
    Hello,

    As far as I know two-pass encoding is used for bitrate estimation: first pass is used to analyze the media and the second for actual encoding at the target bitrate.

    In the example, keyframe alignment is achieved using:

    -g 48 -sc_threshold 0
    aka setting the GOP size to 48 (one key-frame every 48 frames) and setting the scene cut detection threshold to 0.

    You can also use -force_key_frames.
    https://ffmpeg.org/ffmpeg.html

    The original poster didn't use -sc_threshold 0.

    Best regards.
    Last edited by aergistal; 01-07-2015 at 11:49 AM.

Similar Threads

  1. Keyframe Alignment for VOD
    By iomatrix in forum Video On Demand Streaming Discussion
    Replies: 1
    Last Post: 06-23-2013, 05:46 AM
  2. ModuleSecureToken blocking ffmpeg publisher problem
    By gcowie in forum Server-side Modules and Code Samples Discussion
    Replies: 3
    Last Post: 05-29-2013, 03:58 PM
  3. How to debug DVR ABR stream alignment
    By ScottKell in forum Hidden
    Replies: 0
    Last Post: 10-29-2012, 03:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •