Pipe for ffmpeg: Settings

From AVObjects Knowledge Base
(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
 
where:<br>
 
where:<br>
  
** '''<Path to ffmpeg.exe>''' : The full name of the ffmpeg.exe module. Specified by the user. If IAVOPipeFFmpeg::PutExe(bsExe) is called with bsExe == NULL or *bsExe = 0, ffmpeg.exe will be searched in the .exe (application) or .dll (filter) folders.<br>
+
- '''<Path to ffmpeg.exe>''' : The full name of the ffmpeg.exe module. Specified by the user. If IAVOPipeFFmpeg::PutExe(bsExe) is called with bsExe == NULL or *bsExe = 0, ffmpeg.exe will be searched in the .exe (application) or .dll (filter) folders.<br>
  
** '''<INPUT>''' : Input stream and pipe parameters. These are set by the filter based on the connection media types and predefined parameters.<br>
+
- '''<INPUT>''' : Input stream and pipe parameters. These are set by the filter based on the connection media types and predefined parameters.<br>
  
* '''<Common options>''': the following options can be specified in this section<br>
+
- '''<Common options>''': the following options can be specified in this section<br>
- Input stream modifications (resize, aspect ratio, frame rate, sample rate, etc.);<br>
+
* Input stream modifications (resize, aspect ratio, frame rate, sample rate, etc.);<br>
- Trimming (start, end, duration, etc.);<br>
+
* Trimming (start, end, duration, etc.);<br>
- Encoding options (encoders, bitrate, profile, etc.);<br>
+
* Encoding options (encoders, bitrate, profile, etc.);<br>
- Additional parameters ("-y" for overwriting, "-loglevel", "-report", etc.);<br>
+
* Additional parameters ("-y" for overwriting, "-loglevel", "-report", etc.);<br>
 
NOTE: ":stream_specifier" must be set according to ffmpeg docs (-c:v, -b:a:1, etc.).<br>
 
NOTE: ":stream_specifier" must be set according to ffmpeg docs (-c:v, -b:a:1, etc.).<br>
 
<Common options> section is optional, some parameters can be specified in the <Coding> sections.<br>
 
<Common options> section is optional, some parameters can be specified in the <Coding> sections.<br>
  
* '''<Coding[n]>''': encoding parameters for stream n (for the stream number, only connected pins are taken into account). Stream parameters can be retrieved using IAVOPipeFFmpeg::GetPinParams(nPin, ...). Features of this section:<br>
+
- '''<Coding[n]>''': encoding parameters for stream n (for the stream number, only connected pins are taken into account). Stream parameters can be retrieved using IAVOPipeFFmpeg::GetPinParams(nPin, ...). Features of this section:<br>
- the codec used can be specified in the first word of this part, the codec name starts with a letter, for example: mpeg2video, mpeg4, libx264, aac, ac3, ... The codec option and stream_specifier will be automatically added before the codec name, for example for video stream 0: "-c:v:0", for audio stream 5: "-c:a:5", etc.<br>
+
* The codec used can be specified in the first word of this part, the codec name starts with a letter, for example: mpeg2video, mpeg4, libx264, aac, ac3, ... The codec option and stream_specifier will be automatically added before the codec name, for example for video stream 0: "-c:v:0", for audio stream 5: "-c:a:5", etc.<br>
- partial options are allowed: ":stream_specifier" can be omitted after the option name, it will be automatically added for known options (see [:stream_specifier] in ffmpeg docs). If ":stream_specifier" is found after the option name, it will be changed to the actual "stream_type:additional_stream_specifier" by filter.<br>
+
* Partial options are allowed: ":stream_specifier" can be omitted after the option name, it will be automatically added for known options (see [:stream_specifier] in ffmpeg docs). If ":stream_specifier" is found after the option name, it will be changed to the actual "stream_type:additional_stream_specifier" by filter.<br>
 
Examples of <Coding>:
 
Examples of <Coding>:
 
  Video stream 1: "mpeg4 -b 1150k -maxrate:v 1150k" converted to "-c:v:1 mpeg4 -b:v:1 1150k -maxrate:v:1 1150k"
 
  Video stream 1: "mpeg4 -b 1150k -maxrate:v 1150k" converted to "-c:v:1 mpeg4 -b:v:1 1150k -maxrate:v:1 1150k"
Line 30: Line 30:
 
<Coding[n]> sections are optional, parameters can be specified in <Common options>.<br>
 
<Coding[n]> sections are optional, parameters can be specified in <Common options>.<br>
  
* '''<Output file>''' : the full name of the output file. The file type is determined by the extension, unless changed in the <Common options> section with the "-f" option. This part is mandatory.
+
- '''<Output file>''' : the full name of the output file. The file type is determined by the extension, unless changed in the <Common options> section with the "-f" option. This part is mandatory.

Revision as of 19:47, 23 October 2025

Filter interface and command line preparation for Pipe for ffmpeg DirectShow filter.
Interface IAVOPipeFFmpeg can be found in file <filter installation directory>\Idl\PipeFF.idl

Command line

The command line includes the following sections:
<Path to ffmpeg.exe> <INPUT> [<Common options>] [<Coding[0]> ... <Coding[N]>] <Output file>

where:

- <Path to ffmpeg.exe> : The full name of the ffmpeg.exe module. Specified by the user. If IAVOPipeFFmpeg::PutExe(bsExe) is called with bsExe == NULL or *bsExe = 0, ffmpeg.exe will be searched in the .exe (application) or .dll (filter) folders.

- <INPUT> : Input stream and pipe parameters. These are set by the filter based on the connection media types and predefined parameters.

- <Common options>: the following options can be specified in this section

  • Input stream modifications (resize, aspect ratio, frame rate, sample rate, etc.);
  • Trimming (start, end, duration, etc.);
  • Encoding options (encoders, bitrate, profile, etc.);
  • Additional parameters ("-y" for overwriting, "-loglevel", "-report", etc.);

NOTE: ":stream_specifier" must be set according to ffmpeg docs (-c:v, -b:a:1, etc.).
<Common options> section is optional, some parameters can be specified in the <Coding> sections.

- <Coding[n]>: encoding parameters for stream n (for the stream number, only connected pins are taken into account). Stream parameters can be retrieved using IAVOPipeFFmpeg::GetPinParams(nPin, ...). Features of this section:

  • The codec used can be specified in the first word of this part, the codec name starts with a letter, for example: mpeg2video, mpeg4, libx264, aac, ac3, ... The codec option and stream_specifier will be automatically added before the codec name, for example for video stream 0: "-c:v:0", for audio stream 5: "-c:a:5", etc.
  • Partial options are allowed: ":stream_specifier" can be omitted after the option name, it will be automatically added for known options (see [:stream_specifier] in ffmpeg docs). If ":stream_specifier" is found after the option name, it will be changed to the actual "stream_type:additional_stream_specifier" by filter.

Examples of <Coding>:

Video stream 1: "mpeg4 -b 1150k -maxrate:v 1150k" converted to "-c:v:1 mpeg4 -b:v:1 1150k -maxrate:v:1 1150k"
Audio stream 2: "mp2 -b:a 224k" converted to "-c:a:2 mp2 -b:a:2 224k"
Audio stream 0: "-codec aac -b 128K" converted to "-c:a:0 aac -b:a:0 128K"

<Coding[n]> sections are optional, parameters can be specified in <Common options>.

- <Output file> : the full name of the output file. The file type is determined by the extension, unless changed in the <Common options> section with the "-f" option. This part is mandatory.

Personal tools