2

I'm trying to add SRT subs to an flv video with following code but says unrecognized option 'vf'. Am I missing something or is there a workaround? I read somewhere you need at least ffmpeg version 7 for vf to work(?)

$ ffmpeg -i takeout.flv -vf subtitles=takeout.srt test.flv

FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 17:53:48 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6)
configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --   mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-  O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads   --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-  x11grab
 libavutil     50.15. 1 / 50.15. 1
 libavcodec    52.72. 2 / 52.72. 2
 libavformat   52.64. 2 / 52.64. 2
 libavdevice   52. 2. 0 / 52. 2. 0
 libavfilter    1.19. 0 /  1.19. 0
 libswscale     0.11. 0 /  0.11. 0
 libpostproc   51. 2. 0 / 51. 2. 0
 [flv @ 0x90ce880]Estimating duration from bitrate, this may be inaccurate

 Seems stream 0 codec frame rate differs from container frame rate: 1000.00     (1000/1) -> 30.00 (30/1)
Input #0, flv, from 'takeout.flv':
Metadata:
duration        : 5295
width           : 640
height          : 480
videodatarate   : 973
framerate       : 30
videocodecid    : 2
audiosamplerate : 44100
audiosamplesize : 16
stereo          : true
audiocodecid    : 2
filesize        : 661073262
Duration: 01:28:14.89, start: 0.000000, bitrate: 1092 kb/s
Stream #0.0: Video: flv, yuv420p, 640x480, 996 kb/s, 30 tbr, 1k tbn, 1k tbc
    Stream #0.1: Audio: mp3, 44100 Hz, 2 channels, s16, 96 kb/s
Unrecognized option 'vf'

I tried converting the SRT to ASS because I have latest version of libass installed with:

$ ffmpeg -i takeout.srt takeout.ass

but am getting:

Invalid data found when processing input

Then I tried downloading mencoder as another workaround but it ran out of mirror options for download.

  • You read "somewhere" that you need version 7. And you're using version 0.6.5? Where did you read that? Did you try a newer version? What does the documentation for your installed version say? – Mikel Mar 1 '14 at 4:27
  • The way I read the docs, -vf is an alias for -filter:video. Did you try that? It also says that input options need to go before -, so maybe try in the other order? – Mikel Mar 1 '14 at 4:28
  • I read it here stackoverflow.com/questions/13271099/… – cea Mar 1 '14 at 7:50
  • @Mikel If anything this has to do with frame rates. Please don't hazard any guesses unless you are familiar with the software which it is obvious you are not. – cea Mar 1 '14 at 10:01
  • ffmpeg.org/ffmpeg.html#Video-Options scroll down a bit "This is an alias for -filter:v, see the -filter option." – Mikel Mar 1 '14 at 14:51
1

I have the static build of ffmpeg and it does include a -vf switch:

$ ./ffmpeg --help | grep vf
ffmpeg version N-56896-ga927276 Copyright (c) 2000-2013 the FFmpeg developers
  built on Oct  5 2013 05:42:36 with gcc 4.6 (Debian 4.6.3-1)
  configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx
  libavutil      52. 46.100 / 52. 46.100
  libavcodec     55. 34.100 / 55. 34.100
  libavformat    55. 19.100 / 55. 19.100
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 88.101 /  3. 88.101
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
-vframes number     set the number of video frames to record
-vf filter_graph    set video filters

I also checked in an older install I had, 0.4.9 on CentOS 5.9 which does not have this switch, but in Ubuntu 12.10, which has 0.8.6, it does include this switch.

$ ffmpeg --help|grep -- '-vf'
ffmpeg version 0.8.6-6:0.8.6-0ubuntu0.12.10.1, Copyright (c) 2000-2013 the Libav developers
  built on Apr  2 2013 17:02:16 with gcc 4.7.2
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
-vf filter list     video filters
-vframes number     set the number of video frames to record

So if you're particular distro does not provide a current version of ffmpeg I'd suggest just getting the static build of it instead. They're available from the FFmpeg website:

  • I had the static build and yes the vf switch was included but it made no difference to my ability to hard code subtitles. Also it would convert srt to ass but still the hardcoding did not work and why I tried compiling instead. – cea Mar 2 '14 at 5:06
  • @cea - you might want to update your Q, it's confusing that you're saying you have 0.6.5, and also what you've tried thus far. BTW, your msgs about "nvalid data found when processing input" seems like the format of your .srt file isn't quite right. Perhaps you can use the srttool to fix it? unix.stackexchange.com/questions/2283/… – slm Mar 2 '14 at 5:15
  • why is it confusing? that is the version I have...agreed the format/font or timing with that file must be wrong in which case things can start getting even more confusing. I'm thinking there must be an easier way of doing this by using vlc player or even just editing the subs in with adobe premiere. – cea Mar 2 '14 at 5:21
  • btw i've tested those subs in vlc player and they work fine so it is very frustrating not to be able to use ffmpeg to do it quickly or even just js player. – cea Mar 2 '14 at 5:23
  • @cea - I'm confused by the 0.6.5, did you compile that version? Why not go w/ the newer version? Something else must be up, the FFmpeg tutorial shows the commands, I can' imagine this not working. Can you share the .srt file? Seems like something is up with either it or the video. – slm Mar 2 '14 at 5:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.