Help with FFMPEG in CasparCG

Hello friends of the community, I want to ask a question that may be a little silly, but I have searched everywhere in this forum and in all the pages I have found about ffmpeg commands and there are many parameters that I cannot make work.

I am using casparcg for a video server that is automated 24 hours a day, but all the output is in IP, I do not have any SDI or HDMI in the process because that represents complications for me, even to make live broadcasts I use OBS, streaming by IP to ingest that video in Casparcg and broadcast it on the air, everything working very well. (If this type of workflow would be useful to someone, I will make a forum entry with it)

I am using this command with casarcg (It is worth mentioning that this command already works very well in itself, but it can always be improved.)

<ffmpeg>
    <path>udp://192.168.10.250:2037?pkt_size=1316</path>
    <args>-codec:v h264_nvenc -preset:v slow -b:v 2000k -maxrate:v 3500k -minrate:v 1000k -bufsize:v 5000K format=pix_fmts=yuv420p,interlace=1,tinterlace=mode=interleave_top -format mpegts</args>
</ffmpeg>

I am using this only with ffmpeg in windows 10 and it works excellent.

ffmpeg -y -i xxx.mp4 -c:v h264_nvenc -preset slow -profile:v high -rc vbr -cq 23 -b:v 4M -maxrate 4M -bufsize 8M -rc-lookahead 32 -spatial-aq 1 -temporal-aq 1 -b_ref_mode middle -coder cabac -pix_fmt yuv420p -af "loudnorm=I=-10:LRA=11:TP=-0.5,afade=t=out:st=fade_start_ffmpeg:d=2"  -c:a aac -b:a 256k -ar 48000 "output_path"

I have looked for documentation in several places but apparently Casparcg changes the syntax of the nvenc codec options or does not include them, but if the options could be used somehow, my solution will be almost at the broadcast level.

Can anyone help me with some information.

Thanks

Well, I’m going to answer myself; I’ve found a way to make the command work with NVENC, and I’m sharing it below. I’m using this command to feed a television setup, running an automated channel that operates 24 hours a day without issues. I no longer have delays in the audio. I hope this can be useful to others.

    <channels>
        <channel>
          <video-mode>720p2997</video-mode>
            <consumers>
               <ffmpeg>
                    <path>udp://192.168.10.250:2037?pkt_size=1316</path>
                    <args>-codec:v h264_nvenc -preset:v slow -tune:v hq -profile:v high -level:v 41 -cbr:v 1 -b:v 2500k -maxrate:v 3000k -minrate:v 2500k -bufsize:v 1000K -rtbufsize 2000M -coder:v cabac -colorspace:v bt709 -color_primaries:v bt709 -color_trc:v bt709 -color_range:v tv -format mpegts</args>
               </ffmpeg>
            </consumers>
        </channel>
    </channels>
2 Likes