Like, using ffmpeg? Maybe?
You can just the common -t parameter I guess
https://man.archlinux.org/man/ffmpeg.1