Error decoding RTSP stream using h264_cuvid vcodec

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Error decoding RTSP stream using h264_cuvid vcodec

FFmpeg-users mailing list
Hello,

I am trying to decode a RTSP video stream using ffmpeg while using
h264_cuvid vcodec to take advantage of hardware acceleration on a machine
with NVIDIA GPU. I am seeing an error with the message Unknown encoder
'h264_cuvid'. I've made sure that I compiled ffmpeg with cuvid enabled.
Here is the output of "ffmpeg -version" command:
$ ffmpeg -version
ffmpeg version n4.1.6-5-g7f0db52c53 Copyright (c) 2000-2020 the FFmpeg
developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --enable-cuda-sdk --enable-cuvid --enable-nvenc
--enable-nonfree --enable-libnpp --enable-protocol=file
--enable-protocol=rtsp --enable-protocol=hls --enable-openssl
--extra-cflags=-I/usr/local/cuda/include
--extra-ldflags=-L/usr/local/cuda/lib64
libavutil      56. 22.100 / 56. 22.100
libavcodec     58. 35.100 / 58. 35.100
libavformat    58. 20.100 / 58. 20.100
libavdevice    58.  5.100 / 58.  5.100
libavfilter     7. 40.101 /  7. 40.101
libswscale      5.  3.100 /  5.  3.100
libswresample   3.  3.100 /  3.  3.100

To rule out problems with the stream, I checked it using ffplay and I'm
able to visualize it. But when I run the following command
ffmpeg -rtsp_transport tcp -hide_banner -loglevel debug -stimeout 1000000
-rtsp_flags prefer_tcp -allowed_media_types video -i
rtsp://<url>/onvif/profile1/media.smp -vsync 0 -err_detect explode
-surfaces 8 -vcodec h264_cuvid output.avi
I consistently get the encoder error. Removing the vcodec argument works
but I lose out on hardware acceleration. I'm attaching the full debug
output of the ffmpeg command herewith.

I dug around for possible resolutions but didn't find anything meaningful.
Appreciate any help on this.

Thanks,
- Nishant.

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

out.txt (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Error decoding RTSP stream using h264_cuvid vcodec

Moritz Barsnick
On Tue, Mar 09, 2021 at 16:46:41 -0500, Nishant Trivedi via ffmpeg-user wrote:
> I am trying to decode a RTSP video stream using ffmpeg while using
> h264_cuvid vcodec to take advantage of hardware acceleration on a machine
> with NVIDIA GPU. I am seeing an error with the message Unknown encoder
> 'h264_cuvid'.

That's because no such encoder exists.

Have you tried "h264_nvenc"?

> ffmpeg version n4.1.6-5-g7f0db52c53 Copyright (c) 2000-2020 the FFmpeg developers

On this list, it's also always a good idea to use a recent version of
ffmpeg - preferred from latest git. That way, you can rule reporting
bugs or missing features which are no longer valid.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Error decoding RTSP stream using h264_cuvid vcodec

FFmpeg-users mailing list
Oh duh! Thanks @Moritz!

As a side note, I just wanted to mention that we mostly deal with RTMP
streams and we have been starting the ffmpeg process the way I described
for over a year and half now and it never complained. It's just now that we
started looking into supporting RTSP, ffmpeg complained about the option.
Obviously it's a bug on our end and we will fix the arg but I thought it
would be interesting to note the behaviour here. Thanks again!

Best,
- Nishant.


On Wed, Mar 10, 2021 at 4:34 AM Moritz Barsnick <[hidden email]> wrote:

> On Tue, Mar 09, 2021 at 16:46:41 -0500, Nishant Trivedi via ffmpeg-user
> wrote:
> > I am trying to decode a RTSP video stream using ffmpeg while using
> > h264_cuvid vcodec to take advantage of hardware acceleration on a machine
> > with NVIDIA GPU. I am seeing an error with the message Unknown encoder
> > 'h264_cuvid'.
>
> That's because no such encoder exists.
>
> Have you tried "h264_nvenc"?
>
> > ffmpeg version n4.1.6-5-g7f0db52c53 Copyright (c) 2000-2020 the FFmpeg
> developers
>
> On this list, it's also always a good idea to use a recent version of
> ffmpeg - preferred from latest git. That way, you can rule reporting
> bugs or missing features which are no longer valid.
>
> Cheers,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Error decoding RTSP stream using h264_cuvid vcodec

Moritz Barsnick
On Wed, Mar 10, 2021 at 15:54:28 -0500, FFmpeg user discussions wrote:
> Oh duh! Thanks @Moritz!

You're welcome.

> As a side note, I just wanted to mention that we mostly deal with RTMP
> streams and we have been starting the ffmpeg process the way I described
> for over a year and half now and it never complained.

Hmm, I don't think an "h264_cuvid" encoder has ever existed - only a
decoder. (There was some cleanup recently in those aliases, but I
cannot identify such an encoder having being removed.) Perhaps you are
confusing the two?

> would be interesting to note the behaviour here. Thanks again!

No problem, as long as your encoding works again now.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Error decoding RTSP stream using h264_cuvid vcodec

FFmpeg-users mailing list
Apologies, I didn't mean to say that the encoder existed. I was just
pointing out that ffmpeg didn't complain about the wrong argument. And when
I say ffmpeg, I actually mean ffmpeg-python which is what we use to
interact with ffmpeg. I also realize that ffmpeg-python may not fall in
your purview at all. Just making an observation.

Best,
- Nishant.


On Wed, Mar 10, 2021 at 4:34 PM Moritz Barsnick <[hidden email]> wrote:

> On Wed, Mar 10, 2021 at 15:54:28 -0500, FFmpeg user discussions wrote:
> > Oh duh! Thanks @Moritz!
>
> You're welcome.
>
> > As a side note, I just wanted to mention that we mostly deal with RTMP
> > streams and we have been starting the ffmpeg process the way I described
> > for over a year and half now and it never complained.
>
> Hmm, I don't think an "h264_cuvid" encoder has ever existed - only a
> decoder. (There was some cleanup recently in those aliases, but I
> cannot identify such an encoder having being removed.) Perhaps you are
> confusing the two?
>
> > would be interesting to note the behaviour here. Thanks again!
>
> No problem, as long as your encoding works again now.
>
> Cheers,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".