> I am experimenting with the encoder > example<https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/encode_video.c>. > According to the FFmpeg encoding and decoding API > overview<https://ffmpeg.org/doxygen/3.3/group__lavc__encdec.html>, > the codec might accept multiple input frames without returning a > packet, until its internal buffers are filled. > > Is there a way to receive a packet as soon as I send a frame?
I am no expert but I imagine it is keeping the old packets around so it can refer to them from later packets, and it only sends them when it no longer needs to refer back to them. > Specifically, I am using libx265. The first frame is always an I > frame (key frame) which can be encoded without later frames. However, > I have to send quite a few following frames to obtain the first > packet, and this leads to severe latency. I suppose you could configure the codec to send an I fraame for every frame or every second frame? You'd get almost no compression but the latency would probably be quite low. You could also consider increasing the frame rate, e.g. 30 fps in, 120 fps out. Since you'd be submitting each input frame multiple times, the encoder would produce an output packet sooner. There are probably much better ways than this but I imagine you'd have to delve into the codec source code. Cheers, Adam. _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".