[FFmpeg-user] Specifying input and output formats with pipes

belcampo belcampo at zonnet.nl
Tue Jul 19 17:42:44 CEST 2011

On 07/19/11 17:00, Rhodri James wrote:
> Hi folks,
> I have a mildly convoluted transcoding requirement that I'm having
> difficulty translating into command-line parameters to ffmpeg.
> I'm using ffmpeg as part of a Unix pipe chain, so the input is coming on
> stdin and the output must go via stdout. My input stream is MPEG-4/2
> wrapped in an H.222 transport stream. For a first step I wanted
> MPEG-4/10 output, so I hauled out libx264:
>> ffmpeg -i pipe: -f mpegts -vcodec libx264 pipe: 2>ffmpeg.log
> That appeared to work, as far as I can tell, though ffmpeg was very
> sniffy about the headers. My test clip is too short to show anything
> much (thanks everso, dear customer), but something is getting through
> the experience. So far, so tentatively good.
> Now, for obscure and hopefully temporary reasons, I need to wrap that
> H.264 output in MP4. How on earth do I do that? All I can glean from the
> docs is that I should give my output file a ".mp4" suffix and all will
> be well, but of course my "output file" is a pipe. There doesn't seem to
> be any option to tell ffmpeg I want both H.264 transcode and MP4 wrapping.
The docs should also have told that -f mp4 makes this work, the 
extension-thing is 'guessing'. With mp4 it's not that difficult but a 
.mpg extension could mean ps or ts, for program or transport-stream.
> Help?

More information about the ffmpeg-user mailing list