Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg: which file formats support stdin usage?

Tags:

I know ffmpeg is able to read data from stdin rather than reading from disk using ffmpeg -i -. Is this supported for all file formats? If it is not, is there a list which file formats are supported?

like image 959
The Wavelength Avatar asked Oct 21 '12 16:10

The Wavelength


People also ask

What type of file is stdin?

Short for standard input, stdin is an input stream where data is sent to and read by a program. It is a file descriptor in Unix-like operating systems, and programming languages, such as C, Perl, and Java.

What is Flag FFmpeg?

-t specifies the duration of the clip (same format). Recent ffmpeg also has a flag to supply the end time with -to . -c copy copies the first video, audio, and subtitle bitstream from the input to the output file without re-encoding them. This won't harm the quality and make the command run within seconds.

What is Ffprobe?

ffprobe gathers information from multimedia streams and prints it in human- and machine-readable fashion. For example it can be used to check the format of the container used by a multimedia stream and the format and type of each media stream contained in it.


1 Answers

You need to run ffmpeg -protocols to determine if the pipe protocol (the read and write from stdin and stdout) supported in your version of ffmpeg and then ffmpeg -formats to see the list of supported formats. In the excerpt below you will see the note on output pipe that it must be seekable for some protocols. For input protocols it has no such restriction.

From man ffmpeg-protocols:

PROTOCOLS

Protocols are configured elements in FFmpeg which allow to access resources which require the use of a particular protocol.

When you configure your FFmpeg build, all the supported protocols are enabled by default. You can list all available ones using the configure option --list-protocols.

You can disable all the protocols using the configure option --disable-protocols, and selectively enable a protocol using the option --enable-protocol=PROTOCOL, or you can disable a particular protocol using the option --disable-protocol=PROTOCOL.

The option -protocols of the ff* tools will display the list of supported protocols.

A description of the currently available protocols follows. ... pipe
UNIX pipe access protocol.

Allow to read and write from UNIX pipes.

The accepted syntax is:

       pipe:[<number>]

number is the number corresponding to the file descriptor of the pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If number is not specified, by default the stdout file descriptor will be used for writing, stdin for reading.

Note that some formats (typically MOV), require the output protocol to be seekable, so they will fail with the pipe output protocol.

like image 84
Serge Avatar answered Sep 23 '22 05:09

Serge