title: add subtitle to video created from mp3 file and an image using ffmpeg
body: <p>I have a simple image and an mp3 file all I want to do is to add a lyrics to this mp3 file in a video as an output with fade out style.<br>
  so i used this command to do so from this <a href="https://www.svnlabs.com/blogs/ffmpeg-make-video-lyrics-using-jpg-mp3-srt-file/" rel="nofollow noreferrer">this blog</a><br></p>
  
  <pre><code>ffmpeg -loop 1 -y -i test.jpg -i test.mp3 -vf subtitles=”f=test.srt:force_style=’FontName=Arial,FontSize=14″ -shortest test1.mp4
  </code></pre>
  
  <p>when i used this command i got this eror </p>
  
  <pre><code>    ffmpeg -loop 1 -y -i test.jpg -i test.mp3 -vf subtitles="f=test.srt:force_style=’FontName=Arial,FontSize=14″ -shortest test1.mp4
  ffmpeg version N-89940-gb1af0e23a3 Copyright (c) 2000-2018 the FFmpeg developers
    built with gcc 7.2.0 (GCC)
    configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libmfx --enable-amf --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth
    libavutil      56.  7.100 / 56.  7.100
    libavcodec     58.  9.100 / 58.  9.100
    libavformat    58.  7.100 / 58.  7.100
    libavdevice    58.  0.101 / 58.  0.101
    libavfilter     7. 11.101 /  7. 11.101
    libswscale      5.  0.101 /  5.  0.101
    libswresample   3.  0.101 /  3.  0.101
    libpostproc    55.  0.100 / 55.  0.100
  Trailing options were found on the commandline.
  Input #0, image2, from 'test.jpg':
    Duration: 00:00:00.04, start: 0.000000, bitrate: 17290 kb/s
      Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 960x959 [SAR 1:1 DAR 960:959], 25 fps, 25 tbr, 25 tbn, 25 tbc
  Input #1, mp3, from 'test.mp3':
    Metadata:
      comment         : converted by convert2mp3.net
      title           : Celestial Empire [ Worlds 2017 ] [ Pick and b
      artist          : Raffael Gruber Matthias Ullrich
    Duration: 00:02:33.13, start: 0.025057, bitrate: 193 kb/s
      Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 192 kb/s
      Metadata:
        encoder         : Lavc57.28
  At least one output file must be specified
  </code></pre>
  
  <p>iam using windows 10, last version of ffmpeg, so what makes this problem. also how to make the style of the lyrics to be something like fade in/out and so on. if it's possible <br>
  Thanks in advance. <br>
  <strong>update</strong><br>
  when i use this command </p>
  
  <pre><code>ffmpeg -loop 1 -y -i test.jpg -i test.mp3 -vf "subtitles=test.srt:force_style='FontName=Arial,FontSize=14'" -shortest test1.mp4
  </code></pre>
  
  <p>it give me this error </p>
  
  <pre><code>Press [q] to stop, [?] for help
  [Parsed_subtitles_0 @ 049af980] Shaper: FriBidi 0.19.7 (SIMPLE)
  [Parsed_subtitles_0 @ 049af980] Using font provider directwrite
  [libx264 @ 049d2440] height not divisible by 2 (960x959)
  Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
  Conversion failed!
  </code></pre>
  
  <p>i searched this error and i found a solution by add this part before output file so the final command is</p>
  
  <pre><code>ffmpeg -loop 1 -y -i test.jpg -i test.mp3 -vf "subtitles=test.srt:force_style='FontName=Arial,FontSize=14'" -shortest -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" test1.mp4
  </code></pre>
  
  <p>i got no error and it worked but the output video not contains any lyrics which i added</p>
  
  <p><br></p>
  
  <blockquote>
    <p><strong>Update</strong>
    <br>
    last thing i tried and it works first i use this command to convert the image and mp3 file to a mp4 video </p>
  </blockquote>
  
  <pre><code>ffmpeg -loop 1 -i test.jpg -i test.mp3 -shortest -acodec copy -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4
  </code></pre>
  
  <p>but this command take a long time to process to convert mp3 of 2:55 minute it with image.<br>
  then i start to add lyrics or subtitle using this command</p>
  
  <pre><code>ffmpeg -i video.mp4 -vf "subtitles=test.srt:force_style='FontName=Arial,FontSize=14,PrimaryColour=&amp;H0000ff&amp;'" -c:a copy output.mp4
  </code></pre>
  
  <p>this worked perfect and give the output but it take a long time to process i don't know if this normal.<br>
  now last thing how can i set the style of the subtitle so it be fade out or something </p>