[Libav-user] strange H264 audio sync behavior

Marco Sieber l-spy at web.de
Mon Jun 23 11:26:10 CEST 2014


Hello,

thank you for answer :)
I switched now to 2.2 or the trunk Version, i have to test it with that.


>If you really need "-r 25" this indicates a problem
>and it would explain why your application (if it
>does sane things with timestamps) cannot work.

If im right -r indicates a constant framerate? Why should it not work, it works with ffmpeg tool and 1.2.4? What i do:

AVStream inStream
AVStream outStream

outStream->r_frame_rate= inStream->r_frame_rate
outStream->avg_frame_rate = inStream->avg_frame_rate

codecContextOut->timebase.num = video_st->r_frame_rate.den
codecContextOut->timebase.den = video_st->r_frame_rate.num

Of course i have some "if querys" that the num/den relation is correct.
My Values for video stream are 25fps for example. Stream time_base will be handled from codec/decoder/encoder, it is first on 1/90000 then it becomes 1/12800.
AAC Audio Stream is on 1/48000Hz. (stream time_base and codec time_base).

I can't let the timebases unhandled or the video is too long or too short. For this clip i need some adjustment.

And like i wrote earlier, the Clip gets out of sync after 4min and scrubbing with the player or play/pause brings the clip back to sync. So basically its kinda sync ... thats so strange.
If we are scrubbing or play/pause, it should search/jump to the next keyframe right? Or how does it work, why does it resync my clip... 4-5min later im out of sync again.



>Please do not top-post here, it is considered rude.

Okay, i didn't know about that, sorry. Im not from the old days i had to search about that :D





More information about the Libav-user mailing list