0

Hoping someone can guide me to the right place. I have a application is being the "middle man" receiving a video stream from a source via UDP and passing this video stream to a ffmpeg instance on a server and record a certain period of the video (without audio), on a certain occasion it will need to play the video from recorded video instead of passing the live video stream to the ffmepg instance on the server.

/ffmpeg -an -f mpegts -i udp://@:7100/?fifo_size=2000&overrun_nonfatal=1 -analyzeduration 150 -f rawvideo -map 0:0 -vcodec rawvideo -pix_fmt bgra - -af volumedetect -vn -sn -dn -map 0:1 -f mpegts -y -flush_packets 0 udp://127.0.0.1:7208?pkt_size=1316

I managed to record the video without audio frm Extracting the h264 part of a video file (demuxing)

The difference is i save the recorded file as "mpegts"

avformat_alloc_output_context2(&ofmt_ctx_a, NULL,  "mpegts", out_filename_a);

As soon i need to play from this recorded file, i read every 1316 packets from this file and pass it to the ffmpeg via the localhost port.

The problem is the ffmpeg seems doesn't like my recorded file and i noticed it has error msg "DTS 18635855 < 24133055 out of order"

How do i resolve this issue?

Thanks.

jen1982
  • 67
  • 2
  • 11
  • It's not quite clear what you're asking. Are you opening the UDP stream or a recorded ts file? Recording the UDP ts stream to a file without modification plays just fine in VLC and ffmpeg can read from that using the API just fine. – WLGfx Dec 15 '17 at 14:11
  • sorry, for not explaining properly. it doesn't open the proper UDP stream but it does open an UDP socket and send the video stream (live stream or local file) every 1316 bytes to the ffmpeg instance, so the client can stream the video from this link udp://127.0.0.1:7208?pkt_size=1316. (i know this sound crazy+weird, but it's designed by the predecessor). This mean the application and ffmpeg instance are running on the same machine. I'm bit confused, does the ffmpeg happily accept the any format of input source (no matter it's TS or mp4) without specified type of input when i run the ffmpeg? – jen1982 Dec 15 '17 at 15:32
  • Yes, ffmpeg will take for example, a udp address `udp://@239.168.0.1:5000` as an input source. – WLGfx Dec 15 '17 at 15:34

0 Answers0