How to write UDP stream with FFMPEG in chunks?

I am looking for a way to record a UDP stream video using ffmpeg, but in 10 million pieces. I am currently using the following to get 10 million videos (with h264 transcoding).

"ffmpeg -i udp: //239.0.77.15: 5000-map 0: 0 -map 0: 1 -s 640x360 -vcodec libx264 -g 100 -vb 500000 -r 25-line experimental -vf yadif -acodec aac -ab 96000 -ac 2 -t 600 -y / media / test.m4 "

My problem is that using the ffmpeg command line takes time to re-sync with the udp stream, losing 2 seconds of video each time. This is normal?

Any idea if there is a way to do this on the command line or should I use the ffmpeg API?

Thanks in advance

+3
source share
2

, .

ffmpeg , :

-f segment: ffmpeg

-segment_time:

- % 03d (000,001,002,003...).

UDP MPEGTS H264 + AAC - (60 ):

ffmpeg -i udp://239.0.77.15: 5000-map 0: 0 -map 0: 1 -s 640x360 -vcodec libx264 -g 60 -vb 500000 - -vf yadif -acodec aac -ab 96000 - ac 2 -y -f segment -segment_time 60 "xxx-% 03d.ts"

+5

:

ffmpeg -re -i udp://10.1.1.238: 1234? fifo_size = 1000000 -vcodec libx264 -vb 500000 -g 60 -vprofile main -acodec aac -ab 128000 -ar 48000 -ac 2 -vbsf h264_mp4toannexb -b 1000k -minrate 1000k -maxrate 1000k - -f stream_segment -segment_format mpegts -segment_time 5 -segment_atclocktime 1 -reset_timestamps 1 -strftime 1 d:/% H% M% S.mp4

ffmpeg .

+1

All Articles