3 ms·
Might be a bit offtopic, but you can easily output audio and video at once and then mux them later on: ./yourprogram -a >(ffmpeg -f rawaudio ..other audio
by Asooka 9y ago
Might be a bit offtopic, but you can easily output audio and video at once and then mux them later on:
./yourprogram -a >(ffmpeg -f rawaudio ..other audio opts.. -i - ..encoding options.. audio.m4a) -v >(ffmpeg -f rawvideo ..video opts.. -i - ..encoding options.. video.m4v)
ffmpeg -i audio.m4a -i video.m4v -c:a copy -c:v copy out.mp4
The >() syntax is a bash extension, supported also by zsh, and replaces the argument with a file path to a pipe that's connected to the process within the ()'s stdin. Similarly you can use <() to replace the arg with a pipe connected to the process's stdout. One thing I use it for sometimes is to compare directory contents:
vimdiff <(ls -1 dir1 | cut -d/ -f2-)<(ls -1 dir2 | cut -d/ -f2-)
There are better tools for this specific task, but for a quick and dirty compare on a machine where you only have vim and bash, it's hard to beat.