[FFmpeg-user] Lipsync of a UDP stream

Amar Mash amar.mashruwala at gmail.com
Thu Mar 2 00:24:32 EET 2023


Hello

What do you do when audio is in sync (lip sync) at times and off at other
times ?

Thanks



On Thu, 2 Mar 2023 at 3:35 am, Jan Ceuleers <jan.ceuleers at gmail.com> wrote:

> On 28/02/2023 22:27, German Geraskin wrote:
> > You can offset an audio track relative to a video track by adding or
> > subtracting a fixed value to the timestamps of one of the tracks.
> > http://ffmpeg.org/ffmpeg-all.html#setpts_002c-asetpts
>
> Brilliant, thank you.
>
> For the benefit of search engines: my incantation has become:
>
> /usr/bin/ffmpeg -hide_banner -nostats -loglevel panic \
> -i udp://192.168.1.60:17001 \
> -filter_complex "asetpts=PTS-0.3/TB" \
> -vcodec copy -codec:a aac -b:a 256k -f mpegts pipe:1
>
> This brings audio forward by 300ms relative to video.
>
> It is audio that needed to be shifted, because one cannot combine a
> filter and the copy codec.
>
> Thanks again, Jan
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-user mailing list