[Libav-user] Start time and duration questions

william keeling williamkeeling at hotmail.com
Thu May 13 04:56:00 EEST 2021

A few more data points:
The issue is in the AAC stream. On the first file create by my program the PTS in the packets written with av_write_frame() are the same as what is in the container file (as per ffprobe) but in subsequent files a seeming random value (same value for the whole file) is add to each PTS that is passed to av_write_frame() for that file.
I hope this will make it clear to someone what I am doing wrong.

From: william keeling
Sent: Saturday, May 8, 2021 1:32 PM
To: libav-user at ffmpeg.org <libav-user at ffmpeg.org>
Subject: Start time and duration questions

I have a program that iterative creates Flash container files with 2 streams (video h264 and audio AAC).  The format and codec contexts are allocated before and freed after each file.  Calls are made to avformat_write_header() after contexts are allocated and to av_write_trailer() before contexts are freed.

I am using 1 for AVFormatContext.start_time_realtime (since 0 will get current system time).  How do you start from 0 when muxing?

The other issue is first file shows the correct start time and duration when played thru VLC media player.  All subsequent files show a 0 start time, large duration and a black screen for a while; then the start time changes to a large start time that is correct run time below the duration and the video plays.  Any ideas what I have done wrong that is causing the wrong start and duration time and the delay in video playing but only on subsequent files?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20210513/532a21ab/attachment.htm>

More information about the Libav-user mailing list