
So here in this post, I will introduce 31 most commonly used FFmpeg commands with examples to perform various tasks like converting media formats, trimming videos, extracting audio/video streams, etc. You will need to type commands with your keyboard to transcode multimedia files and streams. It packs many encoders and decoders, making it powerful enough to support almost all common and uncommon multimedia formats.įFmpeg comes with a learning curve especially if you are new to a command line tool. If you run the commands again, the output video will be correct.FFmpeg is a free and open-source command line-based tool to handle video, audio, and other multimedia files. You can test the patch using a special docker-image:ĭocker build images -f images/Dockerfile.fixed -t ffmpeg-scale-10bit-test To solve the problem we should not divide the input frame planes' linesizes by 2 ( 1, 2) and leave them as they are. You will immediately see that the picture is distorted. I prepared a sample video with yuv420p10le pixel format samples/input.ts.ĭocker run -it -v $(pwd)/samples:/samples -rm ffmpeg-scale-10bit-test ffmpeg -y -hwaccel cuvid -c:v hevc_cuvid -i /samples/input.ts -map 0:0 -c:v hevc_nvenc -vf scale_cuda=1280:720 /samples/problem.tsĪfter the ffmpeg process completes try playing the output file samples/problem.ts. Nvidia docker runtime installed (if using docker).ĭocker build images -f images/Dockerfile -t ffmpeg-scale-10bit-test Reproducing the problem.Using docker is not mandatory, but recommended, as it simplifies the process of building Docker installed (for building and running FFmpeg).Nvidia graphic card with cuvid/nvenc support and latest drivers installed (I tested on GTX 1080, GTX 1050 and 430.09/418.56 drivers).In order to reproduce the problem, you should have: This repository is intended to prove that such problem exists and to show, how to solve it. I suppose it has something to do with the differences in processing between cuda_sdk and ffnvcodec with cuda_nvcc (the problem appears after this commit ). When scaling a 10bit video using scale_cuda filter (witch uses pixel format AV_PIX_FMT_P010LE), the output video gets distorted. In addition, other improvements were made Description The problem was fixed by ffmpeg-developers.
