[FFmpeg-user] Video output distortion on ffpmeg live stream

Ben Houghton ben at ivent-hq.com
Tue Sep 10 15:30:34 EEST 2019


Hi Moritz,
Many thanks for the detailed response. 

>> I am helping build a node server that runs ffmpeg to stream a live
>> WebRTC input to HLS and MPEGDASH. Often when the encoding starts it
>> produces a corrupted video output that looks something like this
>> (viewed using VLC):
> 
> Are you saying that after a few frames the video becomes correct?

No, once it starts “bad", it stays “bad".

>> Does anyone have any ideas on what might cause this type of
>> distortion on the output stream or how I can test further to track it
>> down?
> 
> To see what ffmpeg is doing with your input, it would have been helpful
> to look at ffmpeg's complete log output. But:
> 
>> ffmpeg -re -y -loglevel error -hide_banner
> 
> Without "-loglevel error" and without "-hide_banner" please.

I’ve attached the stout produced from ffmpeg when the issue is occurring with just those options removed.  I don’t see any issues there so I am thinking you may be right about it being an issue with the Web RTC input.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ffmpeg stout - visual distortion issue.txt
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20190910/0ae99715/attachment.txt>
-------------- next part --------------

If you do spot anything "interesting" please let me know.

> To see whether the input is at fault, you would strip all the output
> magic and just dump a few seconds to file, by keeping all the input
> options, but just writing a simple file, for example:
> 
> $ ffmpeg { input options } -map 0:v -map 1:a -t 5 testout.mp4
> 
> to check whether the same effects are to be seen in that file.

Yes, I’ll try this - but because it’s all being run programmatically using nodeJS it will take me a little while to make the code so that all commands are running under the same conditions.

>> ffmpeg version 3.4.6 Copyright (c) 2000-2019 the FFmpeg developers
> 
> Though it probably isn't part of your issue, we always recommend to
> test (or even use) a very recent version of ffmpeg. This rules out
> debugging fixed bugs. If you can't find a newer ffmpeg in some other
> repository, and you don't want to build yourself, you can grab a static
> binary from here and test with that:
> 
> https://johnvansickle.com/ffmpeg/
> 
> (Left column, "git master", please.)


Yes - again this is inside a docker build so it will take a little while to bring it up to date, but if it is looking like ffmpeg is the issue then I’ll give it a go.

Thank you
Ben

> On 10 Sep 2019, at 10:41, Moritz Barsnick <barsnick at gmx.net> wrote:
> 
> Hi Ben,
> 
> On Tue, Sep 10, 2019 at 06:09:30 +0100, Ben Houghton wrote:
>> I am helping build a node server that runs ffmpeg to stream a live
>> WebRTC input to HLS and MPEGDASH. Often when the encoding starts it
>> produces a corrupted video output that looks something like this
>> (viewed using VLC):
> 
> Are you saying that after a few frames the video becomes correct?
> 
>> HLS output distorted image <https://i.stack.imgur.com/Dxx03.png>
>> MPEGDASH output distorted image <https://i.stack.imgur.com/9YQri.png>
> 
> This doesn't look like an encoding error by ffmpeg, but it could be a
> decoding artifact. In particular if the first frame is not a keyframe
> or just partially received. There's possibly nothing you can do,
> because that's the way the stream is initially picked up. (Just
> guessing so far.)
> 
>> Does anyone have any ideas on what might cause this type of
>> distortion on the output stream or how I can test further to track it
>> down?
> 
> To see what ffmpeg is doing with your input, it would have been helpful
> to look at ffmpeg's complete log output. But:
> 
>> ffmpeg -re -y -loglevel error -hide_banner
> 
> Without "-loglevel error" and without "-hide_banner" please.
> 
> To see whether the input is at fault, you would strip all the output
> magic and just dump a few seconds to file, by keeping all the input
> options, but just writing a simple file, for example:
> 
> $ ffmpeg { input options } -map 0:v -map 1:a -t 5 testout.mp4
> 
> to check whether the same effects are to be seen in that file.
> 
>> ffmpeg version 3.4.6 Copyright (c) 2000-2019 the FFmpeg developers
> 
> Though it probably isn't part of your issue, we always recommend to
> test (or even use) a very recent version of ffmpeg. This rules out
> debugging fixed bugs. If you can't find a newer ffmpeg in some other
> repository, and you don't want to build yourself, you can grab a static
> binary from here and test with that:
> 
> https://johnvansickle.com/ffmpeg/
> 
> (Left column, "git master", please.)
> 
> Regards,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list