nyanmisaka / ffmpeg-rockchip

FFmpeg with async and zero-copy Rockchip MPP & RGA support
Other
326 stars 48 forks source link

lavf/rkrga: format map support #13

Closed hbiyik closed 5 months ago

hbiyik commented 5 months ago

With this option, user can set dynamically the the output format of rkrga_scale & rkrga_vpp filters, according to the input format. User gives a pixel format map separated with + and and coupled with - sign. Ie: formatmap=nv15-nv12+nv20-nv16 means that if the in input pixel format is nv15, the output must be nv21, or if the input format is nv20 then the output format must be nv16. The mapping can be extended as wished.

fmt1=fmt2:fmt3=fmt4... s specifically because players already serialize the filter inputs with the same/similar syntax, therefore parsing of individual avoptions together with dict type avoption is not always possible due this restriction.

i have tested and good to go from my pov.

Some side note:

I think vpp scale and overlay filter can be seperated cleaner in the code.

Specificly:

seperate scale filter to a new c file. Merge common context stuff scale,vpp,overlay to rgacontext Use one single filtercontext containing rgacontext, vppcontext, scalecontext, and overlay structs in it. And so, on. I did not get in to this task not no annoy you with more refactoring things, so this format map thing is only for vpp+scale, overlay has its own thing atm.