Function av_ts2str

Source
pub fn av_ts2str(ts: i64) -> String
Examples found in repository?
examples/remuxing.rs (line 47)
36unsafe extern "C" fn log_packet(fmt_ctx: *const AVFormatContext, pkt: *const AVPacket, tag: &str) {
37    let pkt = &*pkt;
38    let fmt_ctx = &*fmt_ctx;
39    let streams: &[*mut AVStream] =
40        std::slice::from_raw_parts(fmt_ctx.streams, fmt_ctx.nb_streams as usize);
41    let stream = &*streams[pkt.stream_index as usize];
42    let time_base = &stream.time_base;
43
44    println!(
45        "{}: pts:{} pts_time:{} dts:{} dts_time:{} duration:{} duration_time:{} stream_index:{}",
46        tag,
47        av_ts2str(pkt.pts),
48        av_ts2timestr(pkt.pts, time_base),
49        av_ts2str(pkt.dts),
50        av_ts2timestr(pkt.dts, time_base),
51        av_ts2str(pkt.duration),
52        av_ts2timestr(pkt.duration, time_base),
53        pkt.stream_index,
54    );
55}