Hi all. I have a nasty bug. I have written a muxer,which is based on
muxing.c sample.
The only different is that in my case audio stream comes from AAC file.And
if the sound track's
time is longer than video total time,then the overall resulting video time
becomes larger than expected. Here is the whole question I asked on
StackOverflow:

https://stackoverflow.com/questions/49342379/ffmpeg-multiplexing-streams-with-different-duration

And I don't understand why the sync based on comparing ts time of audio and
video packets doesn't help here. I had to do something like this for audio
stream:

AVRational r = {  60 ,1 };

     auto cmp= av_compare_ts(mAudioOutStream.next_pts,
mAudioOutStream.enc->time_base, 5, r);
     if (cmp>=0)
     {
         mAudioOutStream.next_pts =
(int64_t)std::numeric_limits<int64_t>::max();
         return true; //don't mux audio anymore
     }

where '5' is five seconds total video length. This is the only what looks
like close.But it doesn't work for all audio files.If I use aac mono with
some non standard sample rate,I still get total 6 seconds video size
instead of 5 seconds. Will appreciate any help. Thanks.
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to