[FFmpeg-devel] [PATCH 0/3] Patch set to delay output live stream

Marton Balint cus at passwd.hu
Mon May 4 22:48:05 EEST 2020



On Sat, 2 May 2020, Tao Zhang wrote:

> Marton Balint <cus at passwd.hu> 于2020年5月2日周六 下午7:05写道:

[...]

>> I see. But you could add an option to the fifo muxer to only write header
>> when the first packet arrives. This way you will be able to use a
>> bitstream filter to buffer packets and the fifo muxer will only write
>> header when the first packet passes through the bitstream filter. Does
>> this seem OK?
> It seems OK. If nobody object it, I'm glad to add
> write_header_on_first_packet option on fifo muxer and create a new
> bitstream filter which buffers fixed duration packets.

Great. I suggest a shorter name for the option of the fifo muxer, 
delay_write_header I think is enough, you can explain the details in the 
docs.

Also it should be pretty straightforward to add this feature to fifo.c, 
from a quick look at the code one approach is to add a NOOP message type, 
and if the option is set, then use that message type for the first 
message, if it is not set, use the WRITE_HEADER message type, as it is 
used now.

Also we should find a good name for the bitstream filter, maybe "buffer", 
or "fifo", or if you want to better refer to the use case, then 
"timeshift" can also work.

Another thing you should think about is what should happen at the end of 
the stream, when flushing the bitstream filter:
- drop pending packets
- flush pending packets as fast as possible
- flush pendning packets realtime
Maybe it should be selectable between the 3 options? I can imagine use 
cases for all three possibilities.

Thanks,
Marton


More information about the ffmpeg-devel mailing list