LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   ffmpeg -vf in slackware (http://www.linuxquestions.org/questions/slackware-14/ffmpeg-vf-in-slackware-897228/)

sylye 08-14-2011 08:34 AM

ffmpeg -vf in slackware
 
hi all my slackware friends,

I want to change my video resolution so that I could play it at my DVD player that only support smaller vid, so I tried with 'ffmpeg -vf' in slackware but apparently I got Unrecognized option '-vf'
Code:

ffmpeg -i ToriAmos-SilentAllTheseYear.mp4 -vf scale 640:480 test.mp4
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
  built on Apr  7 2011 00:02:26 with gcc 4.4.4
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/man --enable-libmp3lame --enable-libfaac --enable-nonfree --enable-libvorbis --enable-libxvid --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-libdc1394 --enable-libfaad --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvpx --enable-libx264 --enable-runtime-cpudetect --enable-vaapi --disable-vdpau --enable-memalign-hack --enable-pthreads --enable-x11grab --enable-bzlib --enable-zlib --enable-shared --enable-static --disable-debug --extra-cflags='-I/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/include -DRUNTIME_CPUDETECT' --extra-ldflags='-L/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/lib -lssl -lcrypto -lz -lusb'
  libavutil    50.15. 1 / 50.15. 1
  libavcodec    52.73. 2 / 52.73. 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

Seems stream 1 codec frame rate differs from container frame rate: 60000.00 (60000/1) -> 29.97 (30000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'ToriAmos-SilentAllTheseYear.mp4':
  Metadata:
    major_brand    : mp42
    minor_version  : 0
    compatible_brands: isomavc1mp42
  Duration: 00:04:11.17, start: 0.000000, bitrate: 323 kb/s
    Stream #0.0(und): Audio: aac, 44100 Hz, stereo, s16, 125 kb/s
    Stream #0.1(und): Video: h264, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 196 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 60k tbc
Unrecognized option '-vf'

I noticed I did have --enable-avfilter there. So anything else I'm missing ?

Do I need to recompile ? or is there other way I could rescale with ffmpeg using other option ?

P.S: I know Mencoder could do this easily, but I tend to focus and concentrate on using ffmpeg to do the job. Thanks :)

H_TeXMeX_H 08-14-2011 09:08 AM

Use:

Code:

ffmpeg -i ToriAmos-SilentAllTheseYear.mp4 -vf scale=640:480 test.mp4
I would also specify a vcodec and acodec, because it may default to something else.

If you want try avidemux, it is a GUI frontend.

GazL 08-14-2011 09:20 AM

Spooky... was only listening to that yesterday (Little Earthquakes CD)


You could also try the '-target dvd' option if that is what you're sizing it for.

sylye 08-14-2011 10:48 AM

hi H_TexMex_H,

I tried, still can not, it gives the same error :

Code:

ffmpeg -i ToriAmos-SilentAllTheseYear.mp4 -acodec copy -vcodec copy -vf scale=640:480 test.mp4
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
  built on Apr  7 2011 00:02:26 with gcc 4.4.4
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/man --enable-libmp3lame --enable-libfaac --enable-nonfree --enable-libvorbis --enable-libxvid --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-libdc1394 --enable-libfaad --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvpx --enable-libx264 --enable-runtime-cpudetect --enable-vaapi --disable-vdpau --enable-memalign-hack --enable-pthreads --enable-x11grab --enable-bzlib --enable-zlib --enable-shared --enable-static --disable-debug --extra-cflags='-I/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/include -DRUNTIME_CPUDETECT' --extra-ldflags='-L/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/lib -lssl -lcrypto -lz -lusb'
  libavutil    50.15. 1 / 50.15. 1
  libavcodec    52.73. 2 / 52.73. 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

Seems stream 1 codec frame rate differs from container frame rate: 60000.00 (60000/1) -> 29.97 (30000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'ToriAmos-SilentAllTheseYear.mp4':
  Metadata:
    major_brand    : mp42
    minor_version  : 0
    compatible_brands: isomavc1mp42
  Duration: 00:04:11.17, start: 0.000000, bitrate: 323 kb/s
    Stream #0.0(und): Audio: aac, 44100 Hz, stereo, s16, 125 kb/s
    Stream #0.1(und): Video: h264, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 196 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 60k tbc
Unrecognized option 'vf'

I suspect the avfilter issue is the culprit but I think slackware ffmpeg should have that already, is it ? I did recompile this ffmpeg before to get the --enable-nonfree in.

@Gazl:This song is so nice, glad that we have the same taste, ha.

Any input is most welcome :)

ponce 08-14-2011 11:21 AM

I would try what GazL suggested: the "-target dvd" option saves you a lot of hassle
Code:

ffmpeg -i ToriAmos-SilentAllTheseYear.mp4 -target dvd test.mpg
to scale and to convert to mpeg2 (to use for authoring a dvd) you definitely cannot use the copy option for the audio and video streams.

Alien Bob 08-14-2011 11:22 AM

You are using a too old version of ffmpeg I think.
Try the latest release for which I have a SlackBuild script (I see your version of ffmpeg was compiled with my SlackBuild too):

http://taper.alienbase.nl/mirrors/pe...builds/ffmpeg/

It supports a whole bunch of filters now (run "ffmpeg -filters" to get a list). I could successfully scale a video using ffmpeg 0.8.2:
Code:

ffmpeg -i originalmovie.avi -vf 'scale=320:-1' outputfile.mp4
Eric

sylye 08-15-2011 12:39 PM

Hi Bob,

Thanks for pointing that out, it works ! I didn't realize there is a new version from you, so I in fact was compiling from the older version from 13.1. Yeah, the latest version of ffmpeg is superb, I will be exciting trying a lot of nice features from them then.

One thing I would like to know that, I did put in
Code:

--enable-libvorbis \
--enable-libxvid \

in your ffmpeg.SlackBuild this time before compile, since I recall the compiled version will not support xvid and vorbis conversion if I don't do that last time. So is that two needed this time in order to convert source into xvid and vorbis output ?

And just curious that, for all the codec needed in this while compiling, can they being stored in some place in the disk so that it could be shared with xine, vlc, or mplayer as well ? As I found out we need to have collecting them separately for different player while compiling, so is there already some way to store them centralize at some library folder and shared together among all the players ? As it's really redundant needing to find the codec differently for different players and sometime one can play certain file format while the other can't play another. I just scared I'm using some outdated way to build my mplayer, xine..etc. So if anybody already have some way to download once all the codec and shared with other players on the fly, I will be grateful to know that, thanks. (Please forgive me if this question sound silly as I basically don't know much about how all the player works with the codec thingy)

Alien Bob 08-15-2011 01:08 PM

I never had issues with encoding to vorbis and xvid so I have no idea if that would require "--enable-libvorbis --enable-libxvid". Basically ffmpeg has its own internal vorbis and xvid implementation so it does not have to rely on these external libraries. But you may prove me wrong if you can give me an URL which shows that these additional options are needed (in which case I would add them to my script of course).

In the meantime, ffmpeg does show encoding support for vorbis as well as xvid (xvid is a variant of mpeg4):
Code:

$ ffmpeg -codecs 2>/dev/null | egrep -i "(vorbis|mpeg4)"
 DEVSDT mpeg4          MPEG-4 part 2
 DEVSD  msmpeg4        MPEG-4 part 2 Microsoft variant version 3
 D VSD  msmpeg4v1      MPEG-4 part 2 Microsoft variant version 1
 DEVSD  msmpeg4v2      MPEG-4 part 2 Microsoft variant version 2
 DEA    vorbis          Vorbis

Encoding xvid video uses these parameters if you use the mpeg4 codec instead of libxvid:
Code:

ffmpeg -vcodec mpeg4 -vtag xvid
. There are some discussions on the internet about quality differences, I"d like to hear everyone's opinions on this!

The ffmpeg package installs shared libraries into your computer which can be used by other programs. However, programs like xine, mplayer and others each have their own copy of an ffmpeg version that the developers thought was most compatible to their own code, so it will not always be easy to compile these media players against a system-ffmpeg (but it is possible!).

Eric


All times are GMT -5. The time now is 10:17 PM.