Is there any approach to tell ffmpeg how to determine dts of fMP4 segment?
Hi, all! Does anyone known that when handling fMP4 segment dts timestampe, is there any approach to tell ffmpeg how to determine dts of fMP4 segment? (otherwise you have to rebuild all stuffs :<) The current choosing preference always make some fMP4 segments (with sidx earliest_presentation_time 0) to have the incorrect dts time stamp (0), although it was caused by an incorrect arliest_presentation_time. TIA -- Sent from: http://www.ffmpeg-archive.org/
2018-02-28 13:39 GMT+01:00 toya3329 <toya3329@protonmail.com>:
The current choosing preference always make some fMP4 segments (with sidx earliest_presentation_time 0) to have the incorrect dts time stamp (0)
Would you like to tell us how we can reproduce? Carl Eugen
Hi, Carl! I have use under development streamlink mpegdash branch (https://github.com/beardypig/streamlink/tree/mpegdash) to watch some Youtube dash live stream[1] (with some custom hardcoded modification for YT livestream). And mpegdash streamlink uses ffmpeg to mux video and audio streams. Uploaded fMP4 sample at https://ufile.io/swsr8. In mov_read_trun(), the following snippet which give the first dts/pts frag_stream_info = get_current_frag_stream_info(&c->frag_index); if (frag_stream_info) { if (frag_stream_info->first_tfra_pts != AV_NOPTS_VALUE && c->use_mfra_for == FF_MOV_FLAG_MFRA_PTS) { pts = frag_stream_info->first_tfra_pts; av_log(c->fc, AV_LOG_DEBUG, "found mfra time %"PRId64 ", using it for pts\n", pts); } else if (frag_stream_info->sidx_pts != AV_NOPTS_VALUE) { // FIXME: sidx earliest_presentation_time is *PTS*, s.b. // pts = frag_stream_info->sidx_pts; dts = frag_stream_info->sidx_pts - sc->time_offset; av_log(c->fc, AV_LOG_DEBUG, "found sidx time %"PRId64 In this failed case, sidx_pts is 0 and it will set the first dts to sidx_pts (0). And then start dts of every fMP4 segment is 0. After ffmpeg muxing, ffmpeg log show "Non-monotonous DTS in output stream". But tfdt time of each segment is good to be used as a ref timestampe. /toya --- [1]Some fMP4 segment file produced by VideoHandler.(handler_name is VideoHandler) always give six earliest presentation 0. (Some file produced by "ISO Media file produced by Google Inc" has the correct earliest_presentation_time). -- Sent from: http://www.ffmpeg-archive.org/
participants (2)
-
Carl Eugen Hoyos -
toya3329