General VLC media player Troubleshooting • Displaying a fragmented MP4 stream (with only the mdat boxes)



I have an input stream that consists of just the mdat and moof boxes of a fragmented MP4 file that is being recorded at the source. The initialization information (ftyp/moov) is not and will never be available in this stream. However, I do have a previously completed file and have extracted the initialization information from that file to help with displaying the stream of mdat/moof in VLC.

I am currently trying the following naive approach:

  • Extracting the contents of the mdat box from the input stream (usually around 9000 bytes per mdat)
  • Splitting the mdat content into as many 188 byte MPEG-TS packets as needed and multicasting
  • Periodically adding a MPEG-TS packet containing both the SPS and PPS NALUs extracted from the completed file and multicasting

It does not work. VLC picks up the packets but does not play anything.

Out of curiosity I tried VLC’s streaming option to see what it outputs:

Code:

vlc input.mp4 --sout="#std{access=udp, mux=ts, dst=233.1.2.3:12345}"

It produces an MPEG-TS stream with one entry in the PAT and a PMT defining that entry as VIDEO_ISO14496_10_H264. I’m not sure how it produces the content that goes into that stream.

I can’t use VLC’s streaming option for my purposes because I will not have a completed file. How can I get this to display in VLC?

Statistics: Posted by roacs — 08 Jul 2024 17:02