Fri Sep 08, 2017 12:19 pm
i looked around for samples, read the Dokumentation from ffmpeg, tryed weeks.....
we need a youtubelike mp4 to record , playback and upload.
the record ist from the ATEM Switch
the PC is a slow i5 win7, the capture Card is decklink sdi 4k.
the video is 1920x1080i
the ffmpeg is a build from june 2016
this works:
ffmpeg -f decklink -i "DeckLink SDI 4K@8" -acodec copy -vcodec libx264 -deinterlace -pix_fmt yuv420p -r 25 -threads 2 -crf 23 -preset ultrafast test.avi
which means (for all People who search for this):
-f decklink -i "DeckLink SDI 4K@8 ....is the capture Card @8= 1080i50
-acodec copy ...lets the Audio uncompressed
-vcodec libx264... the the right codec for a slow machine
-deinterlace... because the h264 is p (costs 10% cpuload)
-pix_fmt yuv420p... the right pix Format for this reason - can be 422 too
-r25... to determine the right framerate
-threads 2... better load balancing for cpu
-crf 23... gives a Bitrate from 6-12 Mbit/s (higher is lower Bitrate; 0 is uncompressed)
-preset ultrafast... no idea, what this controls, but without this you get instantly buffer underruns)
notice: "DeckLink SDI 4K@8" is case sensitive!
this has a cpu load around 50% an 3 mins have 210 MB
i think this is not the smartest code, but this works!
If anyone has a better idea - let me know:-)
(i know, interlace is not the right choice, but the camera on the Atem only supports this)
( know too, the avi is not the right choice, better is mp4, but there is a mistake in the Options...)
playout in a window on dektop:
ffplay test.avi -x 960 -y 520
this Plays quarterframe, no x and y Plays fullframe
playout on decklink:
ian morrishs code adapted:
ffmpeg -i v:/blackmagic/atem/in/test.avi -f decklink -pix_fmt uyvy422 "DeckLink SDI 4K"