Changes between Initial Version and Version 1 of Errors


Ignore:
Timestamp:
Feb 4, 2016, 1:18:20 AM (19 months ago)
Author:
llogan
Comment:

add initial page

Legend:

Unmodified
Added
Removed
Modified
  • Errors

    v1 v1  
     1= Solutions to some `ffmpeg` errors and messages = 
     2 
     3---- 
     4 
     5{{{ 
     6Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument 
     7}}} 
     8 
     9When encountered this message is usually the last line in the console output. By itself is not very informative, but it is always accompanied by a more specific message that explains the actual issue, so scroll up for the actual error. 
     10 
     11---- 
     12 
     13{{{ 
     14Invalid input file index: 2 
     15}}} 
     16 
     17The `-map` option is used to choose what inputs you want when default stream selection behavior does not fit your needs. This message can occur when the `-map` option is used to reference an input that does not exist. For example, if you have two inputs, but you're tyring to map a non-existing third input with `-map 2` (note that `ffmpeg` starts counting from `0`) then this error will appear. 
     18 
     19Properly define your `-map` file index values. See the [https://ffmpeg.org/ffmpeg.html#Advanced-options -map option documentation] and [[Map|FFmpeg Wiki: Map]] for more examples. 
     20 
     21---- 
     22 
     23{{{ 
     24Stream map '0:a:0' matches no streams 
     25}}} 
     26 
     27Similar to the above error, but instead of an incorrect file index there is an incorrect stream index. For example, if the first input contains four video streams, but you use `-map 0:v:4`, then you are referencing a non-existing video stream (note that `ffmpeg` starts counting from `0`). 
     28 
     29Properly define your `-map` stream index values. See the [https://ffmpeg.org/ffmpeg.html#Advanced-options -map option documentation] and [[Map|FFmpeg Wiki: Map]] for more examples. Alternatively, add a trailing `?` to your map option, such as `-map 0:v:4?`, to make the map optional. 
     30 
     31---- 
     32 
     33{{{ 
     34Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used) 
     35}}} 
     36 
     37The `-ss` option allows you to skip to a certain point. This message is often seen when the `-ss` option value is greater than the duration of the input. For example, if `-ss 30` is used for a 15 second input you may see this message. 
     38 
     39Make sure your `-ss`, `-t`, `-to`, and/or `-frames` value does not exceed the input duration. 
     40 
     41---- 
     42 
     43{{{ 
     44Unknown encoder 'foo' 
     45}}} 
     46 
     47Your `ffmpeg` build does not support the encoder you are trying to use. 
     48 
     49* If it is an external encoder, usually named with the "lib-" prefix, then the build must be compiled to support it. See `ffmpeg -encoders` for a list of encoders supported by your particular build. 
     50* You may be using an old, unsupoprted build. Development is very active, so it is recommended to use builds from the current git master branch. See the [https://ffmpeg.org/download.html FFmpeg Download] page for options. 
     51* The issue could be a simple typo so check the spelling of the encoder name. 
     52 
     53Use a current `ffmpeg` build. You may need to [[CompilationGuide|compile]] it to support your desired encoder. Alternatively, you may simply [https://ffmpeg.org/download.html download] a static build of `ffmpeg`–these builds usually support the most common encoders. 
     54 
     55---- 
     56 
     57{{{ 
     58Trailing options were found on the commandline 
     59}}} 
     60 
     61This message is often overlooked by users and is caused by improper option placement. Placement of options matters, and trailing options are often ignored. Placement is as follows: 
     62 
     63{{{ 
     64ffmpeg [global options] [input options] -i input [output options] output 
     65}}} 
     66 
     67The [https://ffmpeg.org/documentation.html documentation] will often specify if an option is global, input, and/or output. 
     68 
     69Place your options in the correct location. Options before `-i` will be applied to the input, and options before the output name will be applied to the output. Options after the last output may be ignored. 
     70 
     71---- 
     72 
     73{{{ 
     74No pixel format specified, yuv444p for H.264 encoding chosen. 
     75Use -pix_fmt yuv420p for compatibility with outdated media players. 
     76}}} 
     77 
     78Your input and output may vary in supported pixel formats. `ffmpeg` will attempt to choose the "best" supported pixel format for your encoder. For libx264 it may use a pixel format that is not decodable by many non-FFmpeg based media players. 
     79 
     80Adding `-pix_fmt yuv420p` or `-vf format=yuv420p` will ensure compatibility with dumb players. 
     81 
     82---- 
     83 
     84{{{ 
     85[image2 @ 0x2e43320] Could not open file : images/output.png.tmp 
     86av_interleaved_write_frame(): Input/output error 
     87}}} 
     88 
     89In this example the output was `images/output.png`, but the `images` directory did not exist. 
     90 
     91Check that your directory exists and/or that the permissions are correct. 
     92 
     93---- 
     94 
     95{{{ 
     96[image2 @ 0x3841320] Could not get frame filename number 2 from pattern 'output.png' (either set updatefirst or use a pattern like %03d within the filename pattern) 
     97av_interleaved_write_frame(): Invalid argument 
     98}}} 
     99 
     100This usually occurs because the output name is incorrect or some option was omitted. 
     101 
     102* If outputting a single image you need to include `-frames:v 1`. 
     103* If outputting a series of images you need to use the proper naming pattern as described in the image muxer documentation. For example, `output_%03d.png` will make a series named `output_001.png`, `output_002.png`, `output_003.png`, etc. 
     104* If outputting a single image that is continuously overwritten with new images, add `-update 1`. 
     105 
     106---- 
     107 
     108{{{ 
     109[mp4 @ 0x563cd3fa4700] Could not find tag for codec foo in stream #0, codec not currently supported in container 
     110}}} 
     111 
     112As the message says, the particular codec is not supported in your output container format. 
     113 
     114Change the codec and/or output container format. 
     115 
     116---- 
     117 
     118{{{ 
     119Streamcopy requested for output stream 0:0, which is fed from a complex filtergraph. Filtering and streamcopy cannot be used together 
     120}}} 
     121 
     122You can't [https://ffmpeg.org/ffmpeg.html#Stream-copy stream copy] (`-c copy`, `-codec copy`, etc) an output from a filter. 
     123 
     124Remove this option or change `copy` to your desired encoder.