[Libav-user] How to modify the start time of an audio stream?

Strahinja Radman dr.strashni at gmail.com
Sun Apr 24 21:14:06 EEST 2022


On Sun, 24 Apr 2022 at 18:47, Gustav González <xtingray at gmail.com> wrote:

> The best way to modify the start time of any audio stream using the Libav
> API is by implementing a "adelay" filter. Here is a little piece of code
> showing how to use it:
>
> AVFilterContext *adelay_ctx;
> const AVFilter  *adelay;
> char args[512]; // This variable contains the filter parameters
> int error;
>
> adelay = avfilter_get_by_name("adelay");
> if (!adelay) {
>     av_log(NULL, AV_LOG_ERROR, "Could not find the adelay filter.\n");
>     return AVERROR_FILTER_NOT_FOUND;
> }
>
> int delay_time = 8000; // delay in milliseconds
> snprintf(args, sizeof(args), "delays=%d:all=1", delay_time);
> error = avfilter_graph_create_filter(&adelay_ctx, adelay, "adelay", args,
>                                      NULL, filter_graph);
> if (error < 0) {
>     av_log(NULL, AV_LOG_ERROR, "Cannot create audio adelay filter\n");
>     return error;
> }
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/libav-user
>
> To unsubscribe, visit link above, or email
> libav-user-request at ffmpeg.org with subject "unsubscribe".
>

Hmm, interesting. Just out of curiosity, was modifying packet timestamp
working?

-- 

Regards
Strahinja Radman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20220424/677d8a09/attachment.htm>


More information about the Libav-user mailing list