[FFmpeg-user] time padding when muxing
Robin Gareus
robin at gareus.org
Wed Aug 22 05:46:59 CEST 2012
Hi all,
Suppose I have a 1 minute video and a 2 minute audio track.
I want a muxed version:
20 sec black, the 1 min video, 40 sec black
along with the 2min audio-track.
Is this possible using a single command?
-=-
Using '-t' and -itsoffset synchronizes A/V correctly. But the first 20
seconds is audio-only and video-window (mplayer or VLC) only opens after
20sec. Also the last video-frame remains frozen for the final 40sec.
-=-
A rawvideo pipeline can do the trick, IFF I query and parse the geometry
and fps of the video first. I'm also uncertain if that'd work x-platform
(windows pipes, anyone?), and besides that it is not very elegant:
( \
ffmpeg -s $SIZ -f rawvideo -pix_fmt rgb24 -r $FPS \
-i /dev/zero -f rawvideo -t 20 -; \
ffmpeg -i $INPUTVIDEO -f rawvideo -pix_fmt rgb24 -; \
ffmpeg -s $SIZ -f rawvideo -pix_fmt rgb24 -r $FPS \
-i /dev/zero -f rawvideo -t 40 - \
) \
| ffmpeg -s $SIZ -pix_fmt rgb24 -r $FPS -f rawvideo -i - \
-i $INPUTAUDIO \
..ENCODER..PARAMS..
Is there a better solution?
TIA,
robin
More information about the ffmpeg-user
mailing list