On 10/10/18 17:48, Steven Toth wrote:
Hey, a question on the VPPs capabilities.
Can the VPP do frame dropping? For example, every other frame, or one
frame every N?
Some context: Imagine I have a previously compressed 1280x720p60 h264
video stream, from some arbitrate network encoder. I'd like to decode
and re-encode this entirely on the GPU, using VAAPI (intel), have it
decompress, drop every other frame, scale remaining frames downwards,
re-compress as (for example) p30 with a lower bitrate.
A quick look at the VPP implementation suggests 'no'. Am I wrong?
VPP for scaling only works at the level of the individual frames given to it - there is no
sense that the input has to be a consistent stream of frames from some other source like a
decoder. Therefore, just discard every second frame instead of giving it to VPP.
For example, with ffmpeg:
$ ffprobe in.mp4
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1
DAR 16:9], 4001 kb/s, 60 fps, 60 tbr, 60k tbn, 120 tbc (default)
$ ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -hwaccel_device /dev/dri/renderD128
-i in.mp4 -an -vf 'fps=30,scale_vaapi=1280:720' -c:v h264_vaapi -b:v 2M out.mp4
$ ffprobe out.mp4
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1
DAR 16:9], 1944 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
(The fps filter here just drops/duplicates frames to make its output the specified
framerate, not caring what is in them.)