Ffmpeg scale up
Only a single algorithm should be selected. This is also used to set the scaling algorithm. For programmatic use, they can be set explicitly in the SwsContext options or through the libavutil/opt.h API. But it doesn't seem that important as far as I can tell. Options may be set by specifying -option value in the FFmpeg tools, with a few API-only exceptions noted below. Impossible to convert between the formats supported by the filter 'Parsed_scale_npp_0' and the filter 'auto_scaler_0' Error reinitializing filters! Failed to inject frame into filter network: Function not implemented Error while processing the decoded data for stream #0:0 Conversion failed!Īlso there's things like hardware upload and download which I can't figure out. ffmpeg -i input.avi -vf scale'720:480' output.avi.
#Ffmpeg scale up code#
This code ffmpeg -y -hwaccel cuvid -i INPUT c:a copy -c:v hevc_nvenc -vf "scale_npp=w=1920:h:-1:format=yuv420p:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" OUTPUT I use following commands to do rescaling for videos and images. This code can't leave the video as it is if it's smaller than FHD. If you run the commands again, the output.
#Ffmpeg scale up Patch#
You can test the patch using a special docker-image: docker build images -f images/Dockerfile.fixed -t ffmpeg-scale-10bit-test. Video was first developed for mechanical television systems, which were quickly replaced by cathode-ray tube (CRT) systems which, in turn, were replaced by flat panel displays of several types. To solve the problem we should not divide the input frame planes linesize s by 2 ( 1, 2) and leave them as they are. I'm not sure if I'm going to have problems using -hwaccel cuvid and nvenc but it seems to work fine. Video is an electronic medium for the recording, copying, playback, broadcasting, and display of moving visual media. ffmpeg -y -hwaccel cuvid -i INPUT -c:a copy -c:v hevc_nvenc -vf "scale_npp=1920:1080" OUTPUT Some codecs require the size of width and height to be a multiple of n. The resulting image will have a dimension of 320×207 pixels. I want to use something like this -filter:v "scale='min(1920,iw)':min'(1080,ih)':force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2"īut I've only gotten a very limited version of it to work. ffmpeg -i input.jpg -vf scale320:-1 output320.png will set the width of the output image to 320 pixels and will calculate the height of the output image according to the aspect ratio of the input image. I have a 1070 with a recently compiled version of ffmpeg with just about everything enabled. (Not sure about OpenCL but it probably can) I'm aware that Scale_Cuda, Scale_NPP and Vulkan that can do this. Software filters take forever, and since my encodes use nvenc anyway I thought I might as well give gpu resizing a shot.