[FFmpeg-user] ffmpeg cuvid not transcoding properly

Ted Park kumowoon1025 at gmail.com
Thu Nov 21 11:17:07 EET 2019

> Error while opening decoder for input stream #0:0 : Operation not permitted

Is is the actual value you used the command? The operation not permitted error could be referring to the tcp socket you’re opening… Though trying to connect to leads to inconsistent behavior on different platforms, so I’m not sure. If that’s the actual address you used, I would change that first.

> ffmpeg -threads 1 -vsync 1 -hwaccel cuvid -c:v mpeg2_cuvid -deint 1
> -drop_second_field 1 -i '’……

Also, you’re still getting the input via http so I would have thought you’d have to specify just about all of the codec parameters, but I guess on your first one, ffmpeg was able to figure it out through some kind of heuristic methods? Or from the http header indicating mpeg ts stream made it easier? What is the server, can you post the reply headers you get?

> [AVHWFramesContext @ 0x3a36600] [IMGUTILS @ 0x7ffc3bcc6230] Picture
> size 0x0 is invalid
> [mpeg2_cuvid @ 0x3098a40] Error initializing a CUDA frame pool
> cuvid hwaccel requested for input stream #0:0, but cannot be initialized.
> [mpeg2_cuvid @ 0x3098a40] ff_get_format failed: -1

It seems you have to specify frame size at the very least.

Also, Dennis mentioned threading issues, which reminded me that I needed to mess with the number of cuda surfaces based filters I was using, if you’re deinterlacing and encoding using nvenc I would try 8 as a starting point.

I don’t think you should have to specify -threads 1, since the decoder doesn’t support any threading, it’s not going to make any, but the cuda api might be crippled with that option so I would just leave it out and keep it at auto.

Basically you need to know beforehand what the codec parameters are before, or accept there is going to be latency even if you are able to get it to detect the format. One last thing, keeping vsync 0 and setting output frame rate is a better idea imho.

More information about the ffmpeg-user mailing list