server icon indicating copy to clipboard operation
server copied to clipboard

Async creation of ffmpeg producer never throws

Open pkeuter opened this issue 6 years ago • 6 comments

This makes ffmpeg accept every (even unplayable) file and return a 200 PLAY OK, even when it fails afterwards. It also breaks playing PLAY 1-1 http://google.com (which is less important). We might be able to still asynchronously create the producer, but await it with a promise (and a timeout, because the creation might stall indefinitely).

pkeuter avatar Mar 06 '18 21:03 pkeuter

I'm not keen to change this. And it kind of goes with my future wish, file extension always required :).

We should change so that ffmpeg, if HTTP and no file extension don't play it.

ronag avatar Mar 07 '18 09:03 ronag

Are you sure? There are HLS streams not specifically using an extension, because it's not mandatory. Of course it's good practice to use a .mpd or .m3u8 extension, but this not always happens. #905 gave us a chance to catch the ffmpeg producer not being able to play something, and feed it to other producers. For example PLAY 1-1 http://google.com. This doesn't have an extension, but it would be unfortunate if we weren't able to play those anymore. Currently this will only work if you explicitly tell the HTML producer it's for it ([HTML]), but wouldn't you want CasparCG to find out itself which producer is able to play it?

We should change so that ffmpeg, if HTTP and no file extension don't play it.

This would indeed fix for almost every use case, except for DASH/HLS streams without an extension. If you are okay with this, I'm happy to create a PR. Maybe we should allow for a specific [FFMPEG] prefix as well for that specific case. Then you have all situations covered.

pkeuter avatar Mar 07 '18 09:03 pkeuter

This would indeed fix for almost every use case, except for DASH/HLS streams without an extension. If you are okay with this, I'm happy to create a PR. Maybe we should allow for a specific [FFMPEG] prefix as well for that specific case. Then you have all situations covered.

I vote for this! PR please.

ronag avatar Mar 07 '18 09:03 ronag

@ronag How do we go with the 200 PLAY OK then? Is this wanted behaviour? This would make it a 'Producer has accepted the play request', but not a specific PLAY OK, because that's to be determined later.

pkeuter avatar Mar 07 '18 09:03 pkeuter

@pkeuter that's the problem with AMCP. For now we'll have to live with it. 200 should say ok the command is valid and has been accepted. Not whether it has succeeded or not... because that can take an indeterminate amount of time which will block everything.

ronag avatar Mar 07 '18 09:03 ronag

@ronag Thinking about this, we can also check specifically for .m3u8 or .mpd files. Combined with the [FFMPEG] prefix (for other, or no extensions) this would handle all possible scenarios as well. Agreed?

pkeuter avatar Mar 07 '18 17:03 pkeuter