I am trying to display a real-time video stream in VLC. The snag is that the real-time video that is being received is a stream of just the mdat and moof boxes of a fragmented MP4 file that is being recorded elsewhere. The initialization information (ftyp/moov) is not and will never be available in the real-time stream. There is also no audio.
- …
- mdat
- moof
- mdat
- moof
- …
I have access to initialization information (ftyp/moov) of a previously completed file and can use that to aid in the processing/streaming of the real-time mdat/moof boxes.
How should one go about streaming this video information to VLC as it is received?
Sending the raw input stream to VLC does not work as it is missing the initialization information (and also maybe just streaming raw MP4 boxes is wrong?)
I can use VLC to stream a completed fragmented MP4 file with the command:
vlc input.mp4 --sout="#std{access=udp, mux=ts, dst=233.1.2.3:12345}"
This produces a TS that plays in another VLC, but what is this doing? I assume it is using ffmpeg or something behind the scenes to transcode the fMP4 (ftyp/moov/mdat/moof) into a new format to be streamed over UDP. Is this what needs to happen to make an input of streaming mdat/moof available to VLC? Can I use ffmpeg to perform the transcode in real-time with a stream of mdat/moof and pre-configured or hard-coded initialization information (the ftyp/moov from the completed file)?
Or will I need to implement custom logic to create a TS from a stream of mdat/moof with some assumed static initialization information taken from a previously completed file?
roacs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.