[Libav-user] Audio syncing issue? (based on transcoding.c)

Valeriy Shtoma shtomavaleriy at gmail.com
Sun Feb 25 23:48:39 EET 2018


Hi to all,

I’m using example(transcoding.c) for the capture avfoundation devices
and transcoding it to mp4. If I capture only audio device - all is fine, but
if I capture video and audio devices than I have a spoiled audio, some-
times audio and picture not syncing.
Video example: https://www.youtube.com/watch?v=4oe4Ub2fBp4
Code: https://pastebin.com/XM6ZXJJP

Audio and picture might be not syncing because I add a
av_buffersink_set_frame_size(buffersink_ctx, enc_ctx->frame_size);

Can you help me, please? What am I doing wrong? Why sound can 
be unsyncing or jerking audio(seems as like pice of silence after each
frame). Thanks!

Kind Regards,
Valeriy V Shtoma


More information about the Libav-user mailing list