On Thu, Dec 16, 2010 at 2:44 PM, Eli Konky <[email protected]> wrote:
> Thanks. > > I know the delay because the module that produced the video can report the > delay. > In some cases I'll use a human (maybe with vlc player that has a > compensation feature) > > Can I please ask you for a direction on how to rewrite pts? can I use > ffmpeg > to do that? > > Thanks > Eli > > On Fri, Dec 17, 2010 at 12:38 AM, Pushkar Pradhan < > [email protected] > > wrote: > > > On Thu, Dec 16, 2010 at 9:44 AM, Eli Konky <[email protected]> wrote: > > > > > Hi, > > > > > > I have an mp4 (h.264, aac) file where the audio is lagging behind the > > > video. > > > > > > Is it possible to fix this file by just rewriting pts somehow, without > > > decoding and re-encoding the entire file? > > > Is there any other way to deal with this? > > > > > > Thanks > > > Eli > > > _______________________________________________ > > > libav-user mailing list > > > [email protected] > > > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > > > > > > > You can rewrite the pts without doing any decoding/encoding. But how do > you > > know what is the correct adjustment? You can do trial and error, e.g. add > > +50 msec, 100 msec and check the result visually. But what if the lag is > > varying over time? > > > > -- > > pushkar > > _______________________________________________ > > libav-user mailing list > > [email protected] > > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > > > _______________________________________________ > libav-user mailing list > [email protected] > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > As you read the frames (in AVPacket I believe) you can write it out by modifying the AVPacket.pts value. I don't have much experience coding with libavcodec so please look at the examples. You can probably use ffmpeg too, you will have to scan through the many CLI options it provides. By the way, please do not top post mailing list users do not like it :-) -- pushkar _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
