I am trying to create a video from single image and add a text on top. Command on Ubuntu:
ffmpeg -loop 1 -r 1 -i image.jpg -b:v 1M -vf scale=320:240 "drawtext=fontfile=/usr/share/fonts/truetype/DejaVuSans.ttf: text='Test Text'" -t 20 output.mp4
and I am getting this error:
Unable to find a suitable output format for 'drawtext=fontfile=/usr/share/fonts/truetype/DejaVuSans.ttf: text='Test Text''
drawtext=fontfile=/usr/share/fonts/truetype/DejaVuSans.ttf: text='Test Text': Invalid argument
I need to keep the scale to 320:240
Not sure why this is happening.
Another issue is that when I add -loop 1
the command freezes for 5-7 seconds before proceeding to encode. This problem does not exist when there is no -loop 1
After this output -loop 1
freezes:
ffmpeg version 2.3.git Copyright (c) 2000-2014 the FFmpeg developers
built on Aug 14 2014 01:22:13 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --prefix=/home/user/ffmpeg_build --extra-cflags=-I/home/user/ffmpeg_build/include --extra-ldflags=-L/home/user/ffmpeg_build/lib --bindir=/home/user/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libfreetype --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-libfribidi --enable-libfontconfig
libavutil 54. 1.100 / 54. 1.100
libavcodec 56. 0.100 / 56. 0.100
libavformat 56. 0.100 / 56. 0.100
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 0.100 / 5. 0.100
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 0.100 / 1. 0.100
libpostproc 53. 0.100 / 53. 0.100
And then it proceeds to encode as usual. Weird.