Flyleaf icon indicating copy to clipboard operation
Flyleaf copied to clipboard

To play a video file currently being written

Open sharmasulekh87 opened this issue 1 year ago • 5 comments

If I try to play a video .ts file that I am currently writing with the help of ffmpeg, the player set its duration and play up to the specified duration only and stop, on the other side the writing has not been ended yet. I have tried to play the same file with vlc as well as ffplay, they continue to play till the file is being written. With flyleaf player, it do play after the loaded duration only if i seek the file to little earlier than end time. I have attached the screenshot as well. Is there any way to accomplish same thing with flyleaf player?

image

image

sharmasulekh87 avatar Jan 02 '23 08:01 sharmasulekh87

Hi @sharmasulekh87, that's an interesting case. I'm just wondering if this is should be consider as Live stream or not and how Flyleaf will be informed with the new Duration as it has been changed. Can you help me reproduce it as I'm not very familiar with FFmpeg commands and see how I can support it?

SuRGeoNix avatar Jan 03 '23 04:01 SuRGeoNix

Thanks for your reply. I am using simple ffmpeg command to split a big mp4 file into smaller .ts file, and while writing them I try to play it with the flyleaf, vlc and ffplay as I have already told. So here is the command I am using

ffmpeg -re -i input.mp4 -c copy -map 0 -segment_time 00:00:20 -f segment output%03d.ts

Here input.mp4 is the large input file which I am splitting in small .ts segment named as output000.ts,output001.ts etc.

I just wanted to ask one more question that in flyleaf player, when using reverse playback, the speed can't be increased or decreased. How can we do that? And while playing normal the speed can be increased upto 8x only, can we not increase beyond that?

sharmasulekh87 avatar Jan 03 '23 08:01 sharmasulekh87

@sharmasulekh87 for the reverse playback currently speed cannot be changed. For the normal playback you can go up to 16. Performance wise it will be really bad for the GPU to use so high speed. As other users mention this, I guess what you are trying to do is to just skip larger parts of the media and not actually increasing the speed which is different. If that's the case please provide more details so I will consider adding this in the future.

SuRGeoNix avatar Jan 10 '23 07:01 SuRGeoNix

I have a question that i don't know if it's 100% related to this. Is it possible to view an udp or rtsp livestreaming and go back 10 minutes and then go back to live?

The idea i had is to save in file the live and what i play in flyleaf is that file that is recording all time so i guess i could play passed minutes and then go back to live. @SuRGeoNix Thank you!

navarrillo avatar Feb 16 '23 17:02 navarrillo

Hi @navarrillo, this is not related to this issue, but your workaround sounds as the best solution as currently flyleaf does not support temporary save of previous packets. You can seek forward to the already demuxed packets (eg. if you pause the live stream it will store the future packets for Config.Demuxer.BufferDuration time) but this will not currently work for the backward seeking (as it will discard all the previous packets on each seek request). I'm planning to support this in the future (to set through config the previous packets duration).

Another possible solution it would be trans muxing/coding your udp/rtsp to hls with 10 minutes cache, then you could use Flyleaf to seek on HLS live stream within 10 minutes range.

SuRGeoNix avatar Feb 16 '23 22:02 SuRGeoNix