-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It suddenly stops while playing an online video #317
Comments
The URL is invalid and I also cannot play any videos on that site without creating an account and logging in. Please check the debug output and post end of output. I guess we either get EOF, or there is some error. Debug output might help identifying the issue. You could also check the FormatInfo property to see which streaming format is used. We might be able to find a similar sample stream from a site that does not require registration. I have been seeing EOF in rtsp streams (#280). There was not much I could do about that. It was FFmpeg reporting EOF and there was no way of recovering. |
Sorry, I can't find any debug outputs and there is the video information.
I download this video and compress it with 7zip, please remove “.zip” from the filename.(There is file size and file name limits.) It also works well with VLC. |
Does the problem also occur when playing the downloaded file? I'd guess it only happens when playing through streaming. I have played the downloaded file twice and it plays fine till the end. Our lib, as well as ffmpeg will write debug output that can be seen in VS output window while debugging the app. This is what I see in VS on end of local file playback:
VLC has its own custom stream parsing and download implementation. It only uses FFmpeg for the actual decoding. That is why you cannot really compare VLC to our lib when it comes to streaming scenarios. You should rather use ffplay for comparison, since it will also use FFmpeg for stream parsing (and best use the exact same version that we are using as a lib). |
I think (might be mistaken) that you need either mixed or native debugger to see that output. |
Thanks for your quick reply! I tried many times and it looks like that there are always some exceptions when the media stops.
This is the permanent link: https://raw.githubusercontent.com/yikuo123/ffmepg-test/master/test.mp4 or https://cdn.jsdelivr.net/gh/yikuo123/ffmepg-test/test.mp4
|
I played this online video with ffplay and it also suddenly stops. It looks like this issue is about ffmpeg. What else we can do?
Playing local file is OK. If I replace "https" in URL to "http", the error information will be
|
I also noticed some video files suddenly becoming very choppy or outright video playback freezes, and this happens on local files. I too suspect the latest ffmpeg is a bit flimsy. |
I just tried ffplay version 4.4.1, 5.0.1, 5.1.2, but all of them don't work. |
It sounds like the server just drops the connection occasionally (or sends response data too late / timeout). The ffplay.exe you have use gnutls for https, ours use openssl for https, when using http, it is ffmpeg internal http handler. If all these three handlers show the same behavior, then it is probably just an unreliable server. I found these ffmpeg options, which sound like they could help: reconnect_at_eof
reconnect_streamed
reconnect_on_network_error
reconnect_on_http_error
reconnect_delay_max
Put these to FFmpegOptions in our config class with value "1" to enable an option. Not sure if this will help, but it sounds like you can use them so ffmpeg will retry transmission on error or incorrect eof. |
Oh and for streaming I'd recommend trying the new ReadAheadBuffer in our lib (enable it in the config class). This will download and buffer a configurable amount of data, to allow uninterrupted playback of streams. This is available in the latest prerelease nuget package. |
@lukasf Thanks! It almost works! The most important thing is ffplay with these options works very well:
It outputs as below:
I'll try these options with FFmpegInteropX. Thanks again! |
I found that FFmpegInteropX with these options works very well too!
Thank both of you! These problems have bothered me for a long time and now they have gone! By the way, is it ok to add these tips to README? I think there may be other people like me. |
Cool, this is really good to hear! Yes I think we should add a readme section for streaming, and describe the recommended parameters. |
Closing this, since the issue is solved and documentation has been added. |
Just like #238.
I tried FFmepgInteropX version 0.9.4, 1.0.1 and 1.1.0-pre24, but all of them are the same. A few minutes later (about 3 minutes), MediaPlayer will stop and the timeline just jump to the end.
I also tried playing video with the original
Windows.Media.Core.MediaSource
and it's ok.The text was updated successfully, but these errors were encountered: