user12008: I need to put an image before a video with FFMPEG. The image should not be instead of the video but before. The best is if I can choose a number of frames to show the image, instead of seconds. I'm going to run the command via PHP exec.
I tried some commands but could not get them to properly work via exec or directly via CMD.
So tips on how this could be achieved is appreciated.
How can I make the output an .mxf file? When I only change the extension of output file I get:
    Could not write header for output file #0 <incorrect code parameters ?>: Error number -1 occurred

Command used:
    ffmpeg -r 30 -loop 1 -t 3 -i image.jpg -i video.mxf -f lavfi -t 3 -i aevalsrc=0 -filter_complex "[0:v] [2:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -c:v libx264 -c:a aac -strict -2 -map "[v]" -map "[a]" out.mxf

FFprobe output:
    ffprobe version N-74751-gb54e03c Copyright (c) 2007-2015 the FFmpeg developers
  built with gcc 4.9.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 59.100 / 56. 59.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.100 /  5. 40.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[mxf @ 000000000310b8a0] broken or empty index
Input #0, mxf, from 'C:/video.mxf':
  Metadata:
    uid             : 8206ba85-3954-2f4a-9d3c-c4e8d5ba793a
    generation_uid  : de90d87a-f4a7-944c-b6c1-368903cb7a3f
    company_name    : Rhozet
    product_name    : Carbon
    product_version : 1.00
    product_uid     : 060e2b34-0401-0101-0e00-000000000000
    modification_date: 2015-10-30 15:45:05
    material_package_umid: 0x060A2B340101010501010D33130000009BC9C7D36B3F43438EAECC12C87EB630
    timecode        : 00:00:00:00
  Duration: 00:00:42.04, start: 0.000000, bitrate: 36660 kb/s
    Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 50000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:2: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:3: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:4: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:5: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:6: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:7: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:8: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:9: Data: none
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
      data_type       : vbi_vanc_smpte_436M
Unsupported codec with id 0 for input stream 9


user1871: Use this:
ffmpeg -r 25 -loop 1 -t 3 -i "image" -i "video" -f lavfi -t 3 -i aevalsrc=0 -filter_complex "[0:v] [2:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -encoding_parameters -map "[v]" -map "[a]" output.mp4

Ideally set 'r' of image to frame rate of video. The 'r' will be the framerate of the output as well.
The 't' before the image input and the dummy audio input should be the same and represents the image hold in seconds.
The image should be the same resolution as the video. Else, scale (and pad) one or the other in the filter chain before the concat operation.
Edit: Here's a commandline with some common encoding parameters set
ffmpeg -r 25 -loop 1 -t 3 -i "image" -i "video" -f lavfi -t 3 -i aevalsrc=0 -filter_complex "[0:v] [2:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -c:v libx264 -c:a aac -strict -2 -map "[v]" -map "[a]" output.mp4 


12008: <p>I need to put an image before a video with FFMPEG. The image should not be instead of the video but before. The best is if I can choose a number of frames to show the image, instead of seconds. I'm going to run the command via PHP exec.</p>

<p>I tried some commands but could not get them to properly work via exec or directly via CMD.</p>

<p>So tips on how this could be achieved is appreciated.</p>

<p><strong>How can I make the output an .mxf file? When I only change the extension of output file I get:</strong></p>

<pre><code>    Could not write header for output file #0 &lt;incorrect code parameters ?&gt;: Error number -1 occurred
</code></pre>

<p>Command used:</p>

<pre><code>    ffmpeg -r 30 -loop 1 -t 3 -i image.jpg -i video.mxf -f lavfi -t 3 -i aevalsrc=0 -filter_complex "[0:v] [2:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -c:v libx264 -c:a aac -strict -2 -map "[v]" -map "[a]" out.mxf
</code></pre>

<p>FFprobe output:</p>

<pre><code>    ffprobe version N-74751-gb54e03c Copyright (c) 2007-2015 the FFmpeg developers
  built with gcc 4.9.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 59.100 / 56. 59.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.100 /  5. 40.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[mxf @ 000000000310b8a0] broken or empty index
Input #0, mxf, from 'C:/video.mxf':
  Metadata:
    uid             : 8206ba85-3954-2f4a-9d3c-c4e8d5ba793a
    generation_uid  : de90d87a-f4a7-944c-b6c1-368903cb7a3f
    company_name    : Rhozet
    product_name    : Carbon
    product_version : 1.00
    product_uid     : 060e2b34-0401-0101-0e00-000000000000
    modification_date: 2015-10-30 15:45:05
    material_package_umid: 0x060A2B340101010501010D33130000009BC9C7D36B3F43438EAECC12C87EB630
    timecode        : 00:00:00:00
  Duration: 00:00:42.04, start: 0.000000, bitrate: 36660 kb/s
    Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 50000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:2: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:3: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:4: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:5: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:6: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:7: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:8: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
    Stream #0:9: Data: none
    Metadata:
      file_package_umid: 0x060A2B340101010501010D3313000000B70F9172F67EE340AE91E11FC1BA4B0B
      data_type       : vbi_vanc_smpte_436M
Unsupported codec with id 0 for input stream 9
</code></pre>
 1871: <p>Use this:</p>

<pre><code>ffmpeg -r 25 -loop 1 -t 3 -i "image" -i "video" -f lavfi -t 3 -i aevalsrc=0 -filter_complex "[0:v] [2:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -encoding_parameters -map "[v]" -map "[a]" output.mp4
</code></pre>

<p>Ideally set 'r' of image to frame rate of video. The 'r' will be the framerate of the output as well.</p>

<p>The 't' before the image input and the dummy audio input should be the same and represents the image hold in seconds.</p>

<p>The image should be the same resolution as the video. Else, scale (and pad) one or the other in the filter chain before the concat operation.</p>

<p><strong>Edit</strong>: Here's a commandline with some common encoding parameters set</p>

<pre><code>ffmpeg -r 25 -loop 1 -t 3 -i "image" -i "video" -f lavfi -t 3 -i aevalsrc=0 -filter_complex "[0:v] [2:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -c:v libx264 -c:a aac -strict -2 -map "[v]" -map "[a]" output.mp4 
</code></pre>
