-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DVR: Support DVR as MP4 file. #738
Comments
As mp4 demuxer added to srs-librtmp, we also write a srs_ingest_mp4 to ingest mp4 file to rtmp stream. Because we only support live streaming, so we don't seek the mp4 file here and there, that means the FFMPEG always put
The srs_ingest_mp4 will seek moov when it's not non-seek mp4 file:
We can use the parameter to make sure
FFMPEG support fmp4 by
|
In the
Defined in:
This data is the data in the RTMP Sequence Header, which is the data after removing the RTMP or FLV encapsulation.
The specific data is the same as the one mentioned above for MP4.
Reference:
The detailed definition of SPS/PPS is available at:
|
In the
The esds (0x65736473) data in MP4:
It is located a little further back. Note that ESDS is not defined in
Translates to: extends FullBox('esds', version = 0, 0) { ES_Descriptor ES;
Translates to:
Translates to:
Translates to:
Translates to:
Translates to:
0x00 0x02 # ES_ID 0x04 0x80 0x80 0x80 0x14...... # DecoderConfigDescrTag, Size=20
Translates to:
0x06 # SLConfigDescrTag
Translates to:
Translates to:
|
Three ways to mux MP4, that is, three ways to write MP4:
MP4 demuxer also has the same several ways mentioned above. SRS's srs ingest mp4 supports all three ways. If it is General MP4, it will use SEEK to skip MDAT directly, which is a time-saving process and does not require processing the file again like when generating MP4.
|
Regarding DTS and PTS, you can use
Enable ATC.
DTS is in
CTS/PTS is in
You can see the sequence of DTS and PTS. If the audio is delayed or advanced compared to the video by a certain time, an adjustment needs to be made, for example, 34 milliseconds. You can calculate the maximum positive difference and maximum negative difference between these two streams. Refer to
After adjustment, the DTS will be mixed with a single increment.
|
For sample data in mdat, it's RAW AAC frame, or RAW AVC frame. We can remove the FLV TAG header, and remove the AUDIO TAG HEADER to get the AAC RAW frame, or remove the VIDEO TAG HEADER to get the AVC RAW frame. |
MP4, dvr pulls the live stream, performs recording, and resumes recording after pausing the live stream. However, dvr cannot continue generating files. https://github.com/ossrs/srs/issues/1912
|
MP4 is the foundation of #174 HTTP-MP4 and also the foundation of #299 MPEG-DASH.
TRANS_BY_GPT3
The text was updated successfully, but these errors were encountered: