Mit älteren ffmpeg Versionen hat man des öfteren das Problem das aktuelle Videos nicht konvertiert werden können, da das Format erst in der aktuellen SVN Version unterstütz wird.
Häufig bei Formaten die von neueren Videokameras erstellt werden.
Das sieht dann z.B. so aus:
$ ./ffmpeg -i ./testvideo-aus-einzelbildern-erstellt.avi -vpre libx264-main -b 1200k -ab 128k ./testvideo-aus-einzelbildern-erstellt.mp4 FFmpeg version SVN-r17619, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: --enable-gpl --enable-postproc --enable-swscale --enable-libx264 --enable-libxvid --enable-pthreads --enable-avfilter --enable-libfaac --enable-libvorbis --enable-libfaad --enable-libfaac libavutil 49.15. 0 / 49.15. 0 libavcodec 52.19. 0 / 52.19. 0 libavformat 52.30. 0 / 52.30. 0 libavdevice 52. 1. 0 / 52. 1. 0 libavfilter 0. 4. 0 / 0. 4. 0 libswscale 0. 7. 1 / 0. 7. 1 libpostproc 51. 2. 0 / 51. 2. 0 built on Feb 26 2009 21:42:03, gcc: 4.2.1 (Apple Inc. build 5566) Seems stream 0 codec frame rate differs from container frame rate: 3000.00 (3000/1) -> 29.67 (89/3) Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './testvideo-aus-einzelbildern-erstellt.avi': Duration: 00:00:30.00, start: 0.000000, bitrate: 114185 kb/s Stream #0.0(eng): Video: Y'CbCr 4:2:2 - yuyv, 640x480, PAR 1:1 DAR 4:3, 29.67 tbr, 3k tbn, 3k tbc Stream #0.1(eng): Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s swScaler: Unknown format is not supported as input pixel format. Cannot get resampling context.
Abhilfe schafft hier ein frisches ffmpeg aus dem SVN.
Um die Erstellung der Binärdatei zu automatisieren bietet sich hier ein Script an.
Um ffmpeg mit dem Script compilieren zu können, müssen die als Kommentar am Scriptanfang genannten Tools installiert sein.
Da ich macports installiert habe, kann es sein das weitere Tools/Librarys benötigt werden. Sollte dies der Fall sein bitte ein Komentar hinterlassen und ich passe das Script dahingehend an.
install-ffmpeg-from-svn.sh
#!/bin/bash # ffmpeg installer, snow leopard, install xcode first ! # # # 2do first: # # install xcode from developer.apple.com # # install yasm from source (needed for compiling x264) # # wget http://www.tortall.net/projects/yasm/releases/yasm-0.8.0.tar.gz # - unzip and change to dir # - ./configure # - make # - sudo make install # # install git - if not exist: http://code.google.com/p/git-osx-installer/ (not the GUI version!) svn_rev_ffmpeg=$(svn info svn://svn.ffmpeg.org/ffmpeg/trunk | grep "Revision: [0-0]*" | sed "s/Revision: \([0-9]*\)/\1/") myDir=$(date +src_%Y%m%d-%H%M-ffmpeg_rev$svn_rev_ffmpeg) echo echo " - using x264 lib from git"; echo " - using lame lib from cvs"; echo " - using faac lib from tar (v1.28)"; echo " - using faad2 lib from tar (v2.7)"; echo " - using ffmpeg bin from svn (rev$svn_rev_ffmpeg)"; echo echo "[press enter for start]" echo read echo "using /$myDir for sources" mkdir $myDir cd $myDir pwd echo echo echo "download+compile+install x264 codec lib" echo echo git clone git://git.videolan.org/x264.git cd x264/ echo "------------------------------------------" echo "start configure:" echo ./configure echo "------------------------------------------" echo "start make:" echo make echo echo "------------------------------------------" echo "enter password for installing 'x264' if needed" echo "$USER@../x264> sudo make install" sudo make install echo echo echo "------------------------------------------" cd .. echo echo "download+compile+install lame codec lib" echo echo mkdir lame cvs -z3 -d:pserver:anonymous@lame.cvs.sourceforge.net:/cvsroot/lame co -P lame cd lame/ echo "------------------------------------------" echo "start configure:" echo ./configure echo "------------------------------------------" echo "start make:" echo make echo echo "------------------------------------------" echo "enter password for installing 'lame' if needed" echo "$USER@../lame> sudo make install" sudo make install echo echo echo "------------------------------------------" cd .. echo echo "download+compile+install faac codec lib" echo echo wget http://downloads.sourceforge.net/faac/faac-1.28.tar.gz \ || ( echo "=====) manual download http://downloads.sourceforge.net/faac/faac-1.28.tar.gz" echo "=====) save in: $(pwd)" echo "=====) return for extracting..." ls -la ./faac-1.28.tar.gz read ) ls -la ./faac-1.28.tar.gz tar xpzf ./faac-1.28.tar.gz cd faac-1.28 echo "------------------------------------------" echo "start configure:" echo ./configure echo "------------------------------------------" echo "start make:" echo make echo echo "------------------------------------------" echo "enter password for installing 'faac'" echo "$USER@../faac> sudo make install" sudo make install echo echo echo "------------------------------------------" cd .. echo echo "download+compile+install faad codec lib" echo echo wget http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz \ || ( echo "=====) manual download http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz" echo "=====) save in: $(pwd)" echo "=====) press return if ready for extracting..." ls -la ./faad2-2.7.tar.gz read ) ls -la ./faad2-2.7.tar.gz tar xpzf ./faad2-2.7.tar.gz cd faad2-2.7 echo "------------------------------------------" echo "start configure:" echo ./configure echo "------------------------------------------" echo "start make:" echo make echo echo "------------------------------------------" echo "enter password for installing 'faad'" echo "$USER@../faad> sudo make install" sudo make install echo echo echo "------------------------------------------" cd .. echo echo "download+compile+install ffmpeg" echo echo svn -r $svn_rev_ffmpeg checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg cd ffmpeg echo "------------------------------------------" echo "start configure:" echo ./configure \ --enable-libmp3lame --enable-gpl \ --enable-libx264 \ --enable-libfaac --enable-nonfree \ --enable-libfaad \ --disable-debug \ --disable-amd3dnow \ --disable-amd3dnowext \ --enable-shared \ --enable-pthreads \ --arch=x86_64 echo "------------------------------------------" echo "start make:" echo make echo echo "------------------------------------------" echo "enter password for installing 'ffmpeg'" echo "$USER@../ffmpeg> sudo make install" sudo make install echo echo echo "------------------------------------------" cd .. # leave $myDate cd .. echo echo echo "run installed ffmpeg - is it $svn_rev ???" echo echo /usr/local/bin/ffmpeg echo echo echo echo "------------------------------------------" echo "all done." echo
neuste Version:
$ ffmpeg FFmpeg version SVN-r21485, Copyright (c) 2000-2010 Fabrice Bellard, et al. built on Jan 27 2010 21:04:23 with gcc 4.2.1 (Apple Inc. build 5646) (dot 1) configuration: --enable-libmp3lame --enable-gpl --enable-libx264 --enable-libfaac --enable-nonfree --enable-libfaad --disable-debug --disable-amd3dnow --disable-amd3dnowext --enable-shared --enable-pthreads --arch=x86_64 libavutil 50. 7. 0 / 50. 7. 0 libavcodec 52.48. 0 / 52.48. 0 libavformat 52.47. 0 / 52.47. 0 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0. 9. 0 / 0. 9. 0 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... Use -h to get full help or, even better, run 'man ffmpeg'
Wenn jemand Verbesserungen am Script vornimmt, würde ich mich über eine Nachricht freuen und das Script ggf. anpassen.