Closed Niek-Okido closed 4 years ago
i hope you will open it if you want to help , thanks in advance
Hey @Niek-Okido
Greeping the FFmpeg source code (git grep shortest
) I noticed that shortest is "translated" by this function and there seem to exist a filter for shortest as well:
static void close_output_stream(OutputStream *ost)
{
OutputFile *of = output_files[ost->file_index];
ost->finished |= ENCODER_FINISHED;
if (of->shortest) {
int64_t end = av_rescale_q(ost->sync_opts - ost->first_pts, ost->enc_ctx->time_base, AV_TIME_BASE_Q);
of->recording_time = FFMIN(of->recording_time, end);
}
}
but in reality you could check the duration of the shortest stream and stop to process packets/frames there.
thank you very much, really needed this help :) thank you very much get it working now β€οΈ
dear,
i am currently stuck now for almost 1 month and still not get the solution , in the commandline tool the following command is what i want
ffmpeg -i "video.mp4" -i "audio.mp4" -codec copy -shortest output.mp4
i want to add a new generated video with no sound in it (greated with opencv). to the original video what i need to do in c++ i really stuck now on this for 4 weeks (learn a lot of new things).
i hope you can help me with this , it seems to be very easy but my headache is on the
-codec copy -shortest
how i can get this succeeded in ffmpeg?thank in advance if you want to help me with this,
Kind regards Niek Tuytel,