On Sat, 9 Jul 2022 at 12:45, DEF <shaker....@gmail.com> wrote: > On Sat, 9 Jul 2022 at 08:25, Ben Parham <behfart...@gmail.com> wrote: > > > > Hello, > > > > I try to use Nvidia codecs in live transcoding. The input stream is from > an > > IP camera (Hikvision) and its color format is "*yuvj420p*". My command > is: > > > > ffmpeg.exe -y -hwaccel cuda -hwaccel_output_format cuda -rtsp_transport > tcp > > -i "rtsp://admin:Pass1@192.168.1.1" -flags +low_delay -vcodec hevc_nvenc > > -s 1920x1080 -preset p2 -pix_fmt yuv420p -tune hq -rc vbr -vb 700k > -maxrate > > 800k -minrate 200k -bufsize 800k -g 25 -acodec copy -strict -2 -flags > > +global_header -f rtsp "rtsp://localhost:8000/stream" > > Check out documenation at > > https://docs.nvidia.com/video-technologies/video-codec-sdk/ffmpeg-with-nvidia-gpu/ > > Use -vsync 0 option with decode to prevent FFmpeg from creating output > YUV with duplicate and extra frames. > This seems to be the commonest runtime issue. > > Try > ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda > rtsp_transport tcp -i "rtsp://admin:Pass1@192.168.1.1" -flags > +low_delay -vcodec hevc_nvenc -vf scale_cuda=1920:1080 -preset p2 > -pix_fmt yuv420p -tune hq -rc vbr -vb 700k -maxrate 800k -minrate > 200k -bufsize 800k -g 25 -acodec copy -strict -2 -flags +global_header > -f rtsp "rtsp://localhost:8000/stream" > > > Def >
The error may have to do with the specified pixel format filter in the command line, specifically " -pix_fmt yuv420p". Remove that and retest with a command such as this one: ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda rtsp_transport tcp -i "rtsp://admin:Pass1@192.168.1.1" -flags +low_delay -vcodec hevc_nvenc -vf scale_cuda=1920:1080 -preset p2 -tune hq -rc vbr -vb 700k -maxrate 800k -minrate 200k -bufsize 800k -g 25 -acodec copy -strict -2 -flags +global_header -f rtsp "rtsp://localhost:8000/stream" With CUDA/NVDEC hwaccel, the default pixel format will be CUDA. Inserting a request for another format via "-pix_fmt yuv420p" as is would fail, as it introduces the need for hwdownload and format conversion which isn't automatic. Please retest and report back. _______________________________________________ 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".