Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
315 views
in Technique[技术] by (71.8m points)

How to effectly record and encode from udp stream(4K HECV) in real time with ffmpeg?

I have a serious problem about ffmpeg to solve. My task is to record from udp stream(4K HECV) and encode it to a mxf file. My CPU is Intel(R) Xeon(R) Gold 5122 [email protected] The situation of CPU when it is recording from udp stream

The situation of the udp stream

The ffmpeg I used from https://github.com/BtbN/FFmpeg-Builds/commit/86af523883173be93c69d1170d1f78f79dc5e9f8 . The command I used is: ffmpeg -y -threads 6 -i "udp://@225.1.2.150:6150?overrun_nonfatal=1&fifo_size=50000000" -threads 32 -qscale:v 2 -alternate_scan 1 -f mxf "G:4k.xmf"

Now the speed is lower than 1.0x after running for a while(about 10minutes). Maybe this is due to the temperature of the cpu gradually increasing. The picture above displays the performance of CPU when we specify threads=6 for decoding and threads=32 for encoding. I found that the speed would be 1.0x if I just recorded it to a .hecv file. But now I want to encode the stream to a .mxf file in real time. But as you can see, if I tried to encode it in real time, the speed of decoding and encoding would always be lower than 1.0x (around 0.98x). After running this command for about 3 hours, the recording and encoding process will be stopped.

How to solve it? I expect that the speed is 1.0x by speeding up encoding or other ways. Or anyone knows that how to record the udp stream without re-encoding to a .hecv file and meanwhile encode the .hecv file to a .mxf file?

question from:https://stackoverflow.com/questions/65877938/how-to-effectly-record-and-encode-from-udp-stream4k-hecv-in-real-time-with-ffm

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...