Displaying a fragmented MP4 stream (with only the mdat boxes)

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
roacs
New Cone
New Cone
Posts: 1
Joined: 08 Jul 2024 16:34

Displaying a fragmented MP4 stream (with only the mdat boxes)

Postby roacs » 08 Jul 2024 17:02

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: Select all

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?

Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: Bing [Bot] and 29 guests