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
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to