command: add track-list/N/demux-duration property

This commit is contained in:
nanahi
2026-02-19 23:00:36 -05:00
committed by Kacper Michajłow
parent ccdb098fb4
commit 4e2f3ce4b9
5 changed files with 9 additions and 0 deletions
+1
View File
@@ -1 +1,2 @@
add `track_info_selected_only` script option for stats
add `track-list/N/demux-duration` property
+3
View File
@@ -3516,6 +3516,9 @@ Property list
``track-list/N/demux-par``
Pixel aspect ratio.
``track-list/N/demux-duration``
Track duration as indicated by the container.
``track-list/N/format-name``
Short name for format from ffmpeg. If the track is audio, this will be
the name of the sample format. If the track is video, this will be the
+1
View File
@@ -827,6 +827,7 @@ static void handle_new_stream(demuxer_t *demuxer, int i)
avcodec_parameters_copy(sh->codec->lav_codecpar, codec);
sh->codec->native_tb_num = st->time_base.num;
sh->codec->native_tb_den = st->time_base.den;
sh->codec->duration = st->duration * av_q2d(st->time_base);
if (st->disposition & AV_DISPOSITION_DEFAULT)
sh->default_track = true;
+3
View File
@@ -137,6 +137,9 @@ struct mp_codec_params {
// STREAM_SUB
double frame_based; // timestamps are frame-based (and this is the
// fallback framerate used for timestamps)
// STREAM_VIDEO + STREAM_AUDIO + STREAM_SUB
double duration;
};
#endif /* MPLAYER_STHEADER_H */
+1
View File
@@ -2092,6 +2092,7 @@ static int get_track_entry(int item, int action, void *arg, void *ctx)
{"demux-bitrate", SUB_PROP_INT(p.bitrate), .unavailable = p.bitrate <= 0},
{"demux-rotation", SUB_PROP_INT(p.rotate), .unavailable = p.rotate <= 0},
{"demux-par", SUB_PROP_DOUBLE(par), .unavailable = par <= 0},
{"demux-duration", SUB_PROP_PTS(p.duration), .unavailable = p.duration <= 0},
{"format-name", SUB_PROP_STR(p.format_name), .unavailable = !p.format_name},
{"replaygain-track-peak", SUB_PROP_FLOAT(rg.track_peak),
.unavailable = !has_rg},