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?
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.
-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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With