File recording with Caspar 2.3 (Broadcast) Examples

Here you can find examples how to create broadcast MXF or mp4 files with Caspar 2.3.
Because there is a newer version of FFmpeg in this build, the recording commands are different then
with earlier versions.
Also if no extented options are used you get 8 channels audio, with yuv 444 coding…
The recorded files need to be compatible with Adobe Premiere
NOTE, CasparCG 2.3 always writes one multichannel audio stream, in vlc player you can’t select a single channel.
Premiere handles this without any problem.

settings in CasparCG config in the part…

1080i5000
matrix or
stereo

Examples… tested 13-8-2020

Broadcast XDcam EX 35 PAL 50i (1080i50) YUV420 HD stereo recording

ADD 1 FILE “Test stereo feed.mxf” -b:v 35000000 -codec:a pcm_s24le -codec:v mpeg2video -filter:v interlace,zscale=rangein=full:range=limited:primaries=709:transfer=709:matrix=709,format=yuv420p -alternate_scan:v 1 -g:v 12 -bf:v 2 -minrate:v 35000k -maxrate:v 35000k -color_primaries:v bt709 -color_trc:v 1 -colorspace:v 1 -filter:a pan=stereo|c0=c0|c1=c1

Broadcast XDcam EX 35 PAL 50i (1080i50) YUV420 HD multichannel recording
with 4 audio channels

ADD 1 FILE “Test2 4ch audio.mxf” -b:v 35000000 -codec:a pcm_s24le -codec:v mpeg2video -filter:v interlace,zscale=rangein=full:range=limited:primaries=709:transfer=709:matrix=709,format=yuv420p -alternate_scan:v 1 -g:v 12 -bf:v 2 -minrate:v 35000k -maxrate:v 35000k -color_primaries:v bt709 -color_trc:v 1 -colorspace:v 1 -filter:a pan=4c|c0=c0|c1=c1|c2=c3|c3=c3

here in de last part mapping of the audio channels
pan=4c|c0=c0|c1=c1|c2=c3|c3=c3
for 8 channels use
pan=8c|c0=c0|c1=c1|c2=c3|c3=c3|c4=c4|c5=c5|c6=c6|c7=c7

Broadcast XDcam HD50 PAL 50i (1080i50) YUV422 HD stereo (from multichannel input)

ADD 1 FILE “Test 422.mxf” -b:v 50000000 -codec:a pcm_s24le -codec:v mpeg2video -filter:v interlace,zscale=rangein=full:range=limited:primaries=709:transfer=709:matrix=709,format=yuv422p -alternate_scan:v 1 -g:v 12 -bf:v 2 -minrate:v 50000k -maxrate:v 50000k -color_primaries:v bt709 -color_trc:v 1 -colorspace:v 1 -filter:a pan=stereo|c0=c0|c1=c1

Broadcast XDcam HD50 PAL 50i (1080i50) YUV422 HD 4 channel audio (from multichannel input)

ADD 1 FILE “Test 422.mxf” -b:v 50000000 -codec:a pcm_s24le -codec:v mpeg2video -filter:v interlace,zscale=rangein=full:range=limited:primaries=709:transfer=709:matrix=709,format=yuv422p -alternate_scan:v 1 -g:v 12 -bf:v 2 -minrate:v 50000k -maxrate:v 50000k -color_primaries:v bt709 -color_trc:v 1 -colorspace:v 1 -filter:a pan=4c|c0=c0|c1=c1|c2=c3|c3=c3

MP4 recording examples follow soon, right now mp4 files from CasparCG 2.3 can’t be opened by Premiere…

7 Likes

Thanks. Looking forward for H264 examples. I have tested on 2.3 LTS 1080i5000 stereo configuration and after few seconds recoring is broken (speed is doubled). HW is fine. CPU 30% GPU 10%. Have you experienced that issue? I have not found any format working on 1080i5000. Works well only on 1080p2500.

This is a long pending issue. It needs to be solved.

Is this still broken?

Have you posted a bug report at GitHub?

sure, long time ago…

1 Like

UPDATE recording problem with mp4 files with CasparCG 2.3

When we try to record a mp4 file with CasparCG 2.3 latest build, the resulting clip can’t be imported in Adobe Premiere.
When we use FFMPEG.exe within the Caspar directory with a cmd command to record from a Decklinkcard, we get a good mp4 file.
So there’s something wrong in the CasparCG build regarding FFmpeg control.

so this CasperCG command results in mp4 file with can’t be opened with Premiere Pro

ADD 1 FILE “myfile 1.mp4” -codec:v libx264 -crf:v 23 -preset:v veryfast -filter:v format=pix_fmts=yuv420p,tinterlace=4 -flags:v +ildct+ilme -codec:a aac -b:a 128k -ar:a 48k -filter:a pan=stereo|c0=c0|c1=c2

running this via cmd prompt give a good mp4 for import with Premiere Pro

ffmpeg -f dshow -video_size 1920x1080 -pixel_format uyvy422 -rtbufsize 200k -framerate 25.00 -i video=“Decklink Video Capture” -f dshow -i audio=“Decklink Audio Capture” -map 0:v -map 1:a -filter:v format=pix_fmts=yuv420p -flags:v +ildct+ilme -codec:v libx264 -crf:v 23 -preset:v veryfast -r 25 -codec:a aac -b:a 128k -ar:a 48k testclip.mp4

It sounds like problems I see with stream consumers where CasparCG doesn’t send frame size and frame rate (https://casparcgforum.org/t/streaming-to-twitter-periscope/3245)

Yes, this could be that problem too, I mentioned this a while ago on github, but no one seems to take care to fix this problem.
It’s there with every build higher then 2.1.
You have to note however that setup of the ffmpeg parameters is much more complex then with earlier builds.

Brilliant. Perhaps you could make an article in the wiki on this? https://github.com/CasparCG/help/wiki

Privacy Policy   Terms of Service