[FFmpeg-user] What is the interpolation algorithm in cuvid decoder?
Hello, All FFmpeg users. I'm looking at video frame resizing feature which used under nvidia acceleration. One of them feature, the h264_cuvid decoder have resize option for video frame. but I can't find what interpolation algorithm was used in that decoder when I query "ffmpeg -h decoder=h264_cuvid". I wonder know that.. Anyone can you help me out? Thanks a lot :) ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] The option of -hwaccel device doesn't works well(FFmpeg n3.4)
Hello, I'm using a machone of FFmpeg n3.4 verison and 2 Nvidia P4 devices. As a wiki page of HwAcceleration(https://trac.ffmpeg.org/wiki/HWAccelIntro), I known that I could be select hw device using "-hwaccel device" option. However It seems hwaccel_device options doesn't work me when I use filter_complex what included hwupload_cuda. In case of below example, first deivce(index is 0) is always busy for encoding job while second device is always free. I think it would be a problem because I couldn't load balancing the encoding request to the Gpu devices. Could you tell me how can I select gpu device with FFmpeg CLI in this problem? Thanks BRs PS. Sorry to low english skills ** *Below is the information what needed to test.* 1. "nvidia-smi -a -q -d utilization" command gave me what number of device are working now. 2. Nvidia driver : 384.81, Cuda : 9.0 3. OS : CentOS 6.9 CPU : Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz * 32 RAM : 128GB, 4. Input media is like this Duration: 00:01:37.58, start: 0.00, bitrate: 1642 kb/s Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 1507 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default) ** *Below is test command* 1. The first gpu device(index is 0) is always working although input option is hwaccel_device 1. $) ffmpeg -hwaccel_device 1 -y -i ./input.mp4 -filter_complex "[0:v]hwupload_cuda,scale_npp=w=960:h=540:format=yuv420p:interp_algo=lanczos,setsar=1[map0]" -map [map0] -c:v h264_nvenc -vprofile high -map 0:a -c:a copy ./output.mp4 2. If I remove "hwupload_cuda" options in filter_complex, hwaccel_device option works well. $) ffmpeg -hwaccel_device 1 -hwaccel cuvid -y -c:v h264_cuvid -i ./input.mp4 -filter_complex "[0:v]scale_npp=w=960:h=540:format=yuv420p:interp_algo=lanczos,setsar=1[map0]" -map [map0] -c:v h264_nvenc -vprofile high -map 0:a -c:a copy ./output.mp4 ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] The option of -hwaccel device doesn't works well(FFmpeg n3.4)
Hello, Thanks to your reply :-) As your mentions, Hw decoder already has resize option. Why I use scale_npp filter with Sw decoder is Hw decoder(=cuvid) couldn't read some of video files while Sw decoder(=h264) could read it. So I choose a decoder this way -> use the Sw decoder if Hw decoder failed read video file. Your reply message is helpful to me ^^. But I have a problem what same as previous mail. In case that I use both Sw decoder and Hw encoder with below command, and Only GPU0 encoder have working. I did change option as -gpu 0 or -gpu 1, it doesn't affect. I assume that "hwupload_cuda" have a unknown bug because "gpu" option was works well when I remove "hwupload_cuda". *[FFmpeg command]* > ffmpeg -y -i ./input.mp4 -filter_complex "[0:v]hwupload_cuda,scale_npp=w=960:h=540,setsar=1[map0]" -map [map0] -c:v h264_nvenc -gpu "1" -vprofile high -map 0:a -c:a copy ./output.mp4 (Only Gpu0 decoder will be working) -> I want to assign encoding job to gpu1 > ffmpeg -y -i ./input.mp4 -filter_complex "[0:v]setsar=1[map0]" -map [map0] -c:v h264_nvenc -gpu "1" -vprofile high -map 0:a -c:a copy ./output.mp4 Would you hele me out one more to solve this problem ? Thanks to read this mail. BRs, 2017-11-03 13:07 GMT+09:00 James Girotti : > Hello, > > Let me start by saying that I only have one NVENC capable GPU, so I cannot > test this. I hope to point you in the right direction though. > > On Thu, Nov 2, 2017 at 7:38 PM, Baek Seung Hoon > wrote: > > > Could you tell me how can I select gpu device with FFmpeg CLI in this > > problem? > > > > For all of the nvenc encoders there is a '-gpu' option: "Selects which > NVENC capable GPU to use. First GPU is 0, second is 1, and so on. (from -2 > to INT_MAX) (default any)" > > The cuvid decoders have similar '-gpu' options. > > > > ** > > *Below is test command* > > 1. The first gpu device(index is 0) is always working although input > option > > is hwaccel_device 1. > > $) ffmpeg -hwaccel_device 1 -y -i ./input.mp4 -filter_complex > > "[0:v]hwupload_cuda,scale_npp=w=960:h=540:format=yuv420p: > > interp_algo=lanczos,setsar=1[map0]" > > -map [map0] -c:v h264_nvenc -vprofile high -map 0:a -c:a copy > ./output.mp4 > > > > > The above command doesn't use a hw-decoder (not a real problem if that's > what you want.) But I'm not sure if the '-hwaccel_device' option does > anything without something like '-hwaccel cuvid' and specifying '-c:v > h264_cuvid' before '-i ./input.mp4'. > > > > 2. If I remove "hwupload_cuda" options in filter_complex, hwaccel_device > > option works well. > > $) ffmpeg -hwaccel_device 1 -hwaccel cuvid -y -c:v h264_cuvid -i > > ./input.mp4 -filter_complex > > "[0:v]scale_npp=w=960:h=540:format=yuv420p:interp_algo= > > lanczos,setsar=1[map0]" > > -map [map0] -c:v h264_nvenc -vprofile high -map 0:a -c:a copy > ./output.mp4 > > > > This command is significantly different from the previous. It's more than > just removing "hwupload_cuda". This command uses hw-decoding, which is why > you don't have to "hwupload_cuda" because the frames are already in GPU > memory. Also, likely why '-hwaccel_device 1' works. > > I see that you are using scale_npp to resize your video and I would be > amiss if I did not mention that the cuvid decoders have resizing and > cropping built in now. You don't need to use scale_npp to scale/resize, you > could do something as simple as: > > ffmpeg -hwaccel_device 1 -hwaccel cuvid -c:v h264_cuvid -resize 960x540 -i > ./input.mp4 -vf "setsar=sar=1" -c:v h264_nvenc -vprofile high -map 0:a -c:a > copy ./output.mp4 > > I hope that help! > -J > ___ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] The option of -hwaccel device doesn't works well(FFmpeg n3.4)
Hello, I will share you ffmpeg tests. Please refer the following results. *1. Use Sw-decder, Hw-Encoder with gpu 0* > ffmpeg -y -i ./input.mp4 -c:v h264_nvenc -gpu 0 -c:a copy ./output.mp4 +-+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=| |0 69091 C ffmpeg 167MiB | +-+ *2. Use Sw-decoder, Hw-Encoder with gpu 1* > ffmpeg -y -i ./input.mp4 -c:v h264_nvenc -gpu 1 -c:a copy ./output.mp4 +-+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=| |1 68417 C ffmpeg 167MiB | +-+ *3. Use Sw-decoder, Hw-Encoder with gpu 0 and scale_npp* > ffmpeg -y -i ./input.mp4 -filter_complex "[0:v]hwupload_cuda,scale_npp=w=960:h=540[map0]" -map "[map0]" -c:v h264_nvenc -gpu 0 -c:a copy ./output.mp4 +-+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=| |0 72208 C ffmpeg 147MiB | +-+ *4. Use Sw-decoder, Hw-Encoder with gpu 1 and scale_npp* > ffmpeg -y -i ./input.mp4 -filter_complex "[0:v]hwupload_cuda,scale_npp=w=960:h=540[map0]" -map "[map0]" -c:v h264_nvenc -gpu 1 -c:a copy ./output.mp4 +-+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=| |0 71589 C ffmpeg 147MiB | +-+ Please look the number 4 result. Process GPU is only 0 even if Hw-encoder have gpu 1 option. I wonder if Gpu devices can not be selected if hwupload_cuda filter is present. Thanks BRs, 2017-11-05 3:50 GMT+09:00 James Girotti : > On Fri, Nov 3, 2017 at 7:48 PM, Baek Seung Hoon > wrote: > > > Hello, > > Thanks to your reply :-) > > > > As your mentions, Hw decoder already has resize option. > > Why I use scale_npp filter with Sw decoder is Hw decoder(=cuvid) couldn't > > read some of video files while Sw decoder(=h264) could read it. > > So I choose a decoder this way -> use the Sw decoder if Hw decoder failed > > read video file. > > > > Like I mentioned; not really a problem to use sw-decoder. You should use > whatever you want/need. > > > > Your reply message is helpful to me ^^. > > But I have a problem what same as previous mail. > > In case that I use both Sw decoder and Hw encoder with below command, and > > Only GPU0 encoder have working. > > I did change option as -gpu 0 or -gpu 1, it doesn't affect. > > > > Have you tried using sw-decoder->hw-decoder without scale-npp? Something > like: > > ffmpeg -i ./input.mp4 -c:v h264_nvenc -gpu 1 -c:a copy ./output.mp4 > > Does that use the correct GPU? > > I assume that "hwupload_cuda" have a unknown bug because "gpu" option was > > works well when I remove "hwupload_cuda". > > > > I think it's uploading to GPU 0 by default. There is an option 'device' for > hwupload_cuda. Could you try specifying the device for hwupload_cuda? > ___ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". > ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] The option of -hwaccel device doesn't works well(FFmpeg n3.4)
(Its mail continuous previous my one.. sorry) I wonder know what is different ffmpeg internal sequence following 2 commands.. 1. > ffmpeg -y -i ./input.mp4 -filter_complex "[0:v]hwupload_cuda=device=0,scale_npp=w=960:h=540[map0]" -map "[map0]" -c:v h264_nvenc -c:a copy ./output.mp4 2. > ffmpeg -y -hwaccel cuvid -i ./input.mp4 -filter_complex "[0:v]hwupload_cuda=device=0,scale_npp=w=960:h=540[map0]" -map "[map0]" -c:v h264_nvenc -c:a copy ./output.mp4 In fact, the performance is similar as 861 fps for encoding. Could I ask you what role "hwaccel cuvid" is in the above command? Thanks again :) BRs, ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] The option of -hwaccel device doesn't works well(FFmpeg n3.4)
Hello, Sorry to my mistake for your reply ^^; 'device' option for hwupload_cuda is working well. *1. Device option is 0 for hwupload_cuda* > ffmpeg -y -i ./input.mp4 -filter_complex "[0:v]hwupload_cuda=device=0,scale_npp=w=960:h=540[map0]" -map "[map0]" -c:v h264_nvenc -c:a copy ./output.mp4 +-+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=| |0101825 C ffmpeg 147MiB | +-+ *2. Device option is 1 for hwupload_cuda* > ffmpeg -y -i ./input.mp4 -filter_complex "[0:v]hwupload_cuda=device=1,scale_npp=w=960:h=540[map0]" -map "[map0]" -c:v h264_nvenc -c:a copy ./output.mp4 +-+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=| |1102185 C ffmpeg 147MiB | +-+ Thanks you for your detailed explanation. Could I ask one things about "-hwaccel cuvid" option for related above commands? 2017-11-06 1:41 GMT+09:00 James Girotti : > I wonder if Gpu devices can not be selected if hwupload_cuda filter is > present. > > > > > I think it's uploading to GPU 0 by default. There is an option 'device' > for > > hwupload_cuda. Could you try specifying the device for hwupload_cuda? > > > Could you try the 'device' option for hwupload_cuda? > ___ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". > ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] The official documents of threads option
Hi folks, I'm trying to find the 'threads' option in ffmpeg.org site. It seems not existed in there, could you know where is it the description? I'm sorry such basic question. Thanks! ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] The official documents of threads option
@Venkateswarn.S , @Gyan Thanks for your reply! I had tried to search it in the section of global option. Thanks and have a nice day. On Wed, Sep 4, 2019 at 2:52 PM Gyan wrote: > > > On 04-09-2019 10:34 AM, Baek Seung Hoon wrote: > > Hi folks, > > > > I'm trying to find the 'threads' option in ffmpeg.org site. > > It seems not existed in there, could you know where is it the > description? > > > > I'm sorry such basic question. > > You'll find it in this section: > http://ffmpeg.org/ffmpeg-codecs.html#Codec-Options > > Search for threads. > > Gyan > ___ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".