I want to generate a h.264 stream in which P-frames are using references exclusively using a long-term reference to the first frame (an IDR frame). This would also require the first frame to be an IDR frame.
This is an academic experiment to understand the encoding behavior of long-term references and the consequences of forcing frames to refer to a specific (single) frame rather than several.
It would be great if I could do this from the command line, but if not possible I am open to modifying x264 for this purpose.
Could anyone point me to where in the source code it is determined:
- the reference frame / macroblock / partition for the current macroblock
- changes made to the short term, long term reference frame list
- whether to use a short term reference frame or a long term reference frame.
Using another encoder like nvenc is also acceptable.