sufehmi

ffmpeg FASTEST WAT TO RESIZE / SCALE A VIDEO

Aug 22nd, 2021 (edited)
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.97 KB | None | 0 0
  1. # RESIZE / SCALE  ffmpeg encoding with VAAPI / hardware acceleration
  2. # I got about 7x speed up + very low CPU usage
  3. # (so I'm able do other stuff while ffmpeg is busy doing the decoding/encoding)
  4.  
  5. # need this installed first
  6. apt-get install intel-media-va-driver-non-free
  7. # if you keep getting the following error - that means you need to execute that command above:
  8. # Failed to create processing pipeline config: 12 (the requested VAProfile is not supported)
  9.  
  10. # let's go
  11. time ffmpeg -init_hw_device vaapi=foo:/dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -hwaccel_device foo -i INPUT-720p.mp4 -filter_hw_device foo -vf 'format=nv12|vaapi,hwupload,scale_vaapi=iw/2:ih/2:mode=hq,fps=fps=25' -c:v h264_vaapi  -compression_level 1 -y -c:a copy OUTPUT-360p.mp4
  12.  
  13. # to find your vaapi device, type : ls  /dev/dri/*
  14.  
  15. # see list of standard resolutions here : https://levvvel.com/169-resolutions/
  16.  
  17. # remove ",fps=fps=25" bit if you're not changing the fps rate
Add Comment
Please, Sign In to add comment