FFmpeg

libmp3lame:
	"lynx lame.sourceforge.net/download.php"
	"tar -xzf lame-3.99.5.tar.gz"
	"cd  lame-3.99.5/"
	"./configure --bindir=/usr/bin --sbindir=/usr/sbin --libdir=/usr/lib64 --includedir=/usr/include"
	"make"
	"make install"

libshine:
	"wget https://github.com/toots/shine/archive/master.zip" oder "git clone https://github.com/toots/shine.git"
	"unzip shine-master.zip"
	"cd shine-master"
	"./bootstrap"
	"./configure --bindir=/usr/bin --sbindir=/usr/sbin --libdir=/usr/lib64 --includedir=/usr/include"
	"make"
	"make install"

x264:
	"wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2"
	"tar -xf last_x264.tar.bz2"
	"cd x264-snapshot-20160419-2245"
	"./configure --exec-prefix=/usr --bindir=/usr/bin --libdir=/usr/lib64 --includedir=/usr/include --disable-asm --enable-shared"
	"make"
	"make install"

	
"wget http://ffmpeg.org/releases/ffmpeg-0.5.tar.bz2"
"tar -xf ffmpeg-0.5.tar.bz2"
"cd ffmpeg-0.5"
	"./configure" oder bei SUSE "./configure --bindir=/usr/bin --libdir=/usr/lib --shlibdir=/usr/lib --incdir=/usr/include --enable-swscale --enable-gpl --enable-postproc --enable-avfilter --enable-avfilter-lavf --enable-pthreads --enable-vdpau --enable-gray --enable-fastdiv --enable-small"
Ab Version 3.0.1:
	"./configure --prefix=/usr/ --libdir=/usr/lib64/ --incdir=/usr/include/ --disable-yasm --enable-shared --enable-libmp3lame --enable-libshine --enable-libx264 --enable-gpl"
"make"
"make install"

####################################################
#ffmpeg Commands
#Info "lynx http://www.labnol.org/internet/useful-ffmpeg-commands/28490/"

#Umwandlung
	"ffmpeg -i test.mp3 /root/temp/test.wav"
	"ffmpeg -i test.wav -b:a 192K out.mp3"
	"ffmpeg -i lied.wma -acodec libmp3lame -ab 320k lied.mp3"
		"ffmpeg -i lied.flac -acodec libmp3lame -ab 320k lied.mp3"

#Extract the audio from video
	"ffmpeg -i video.mp4 -vn -ab 256 audio.mp3"

#Convert a video into animated GIF
	"ffmpeg -i video.mp4 -vf scale=500:-1 -t 10 -r 10 image.gif"

#Extract image frames from a video
	"ffmpeg -ss 00:00:15 -i video.mp4 -vf scale=800:-1 -vframes 1 image.jpg"

#Convert Video into Images
	"ffmpeg -i movie.mp4 -r 0.25 frames_%04d.png"
	
##################################
#Zusätzliches

#Umwandlung
"lame test.wav test.mp3"
"shineenc test.wav test.mp3"

##############################################################################
#ffserver
Vorgehnsweise.
1. ffserver starten
2. ffserver via ffmpeg mit einem Video/MP3 füttern bzw. hochladen
3. Abruf des Stream via Browser/ffmpeg

"cat /etc/ffserver.conf" -> Minimal Konfig
	<Stream status.html>
	Format status
	</Stream>
	Port 8090
	MaxHTTPConnections 2000
	MaxClients 1000
	MaxBandwidth 4096
	CustomLog -
	NoDaemon
	#Video############################
	<Feed feed1.ffm>
	File /tmp/feed1.ffm
	FileMaxSize 1G
	</Feed>
	<Stream live.flv>
	Format flv
	Feed feed1.ffm
	</Stream>
	#MP3##########################
	<Feed feed1mp3.ffm>
	File /tmp/feed1mp3.ffm
	FileMaxSize 1G
	</Feed>
	<Stream livemp3.mp3>
	Format mp2
	Feed feed1mp3.ffm
	##########
	AudioCodec libmp3lame
	AudioBitRate 128
	AudioChannels 1
	AudioSampleRate 44100
	NoVideo
	</Stream>
	#####################

"ffserver -f /etc/ffserver.conf"								#Server starten
	"ffserver -loglevel debug"
"ffmpeg -i video.mpeg  http://127.0.0.1:8090/feed1.ffm"			#Video hochladen
"ffmpeg -i mukke.mp3 http://127.0.0.1:8090/feed1mp3.ffm"		#MP3 hochladen
"lynx http://172.17.190.46:8090/status.html"					#Status Seite
"lynx http://172.17.190.46:8090/live.flv"						#Video ansehen
Bei VLC einfach als Netzwerkstream angeben.

######################################################################################################################
#Webcam Stream lokal abspeichern
"ffmpeg -i 'http://10.0.66.120/videostream.cgi?rate=0&=USER&pwd=PASS'  -acodec copy -vcodec copy  /tmp/test.mkv"									High Res
	"ffmpeg -i 'http://10.0.66.120/videostream.cgi?rate=0&=USER&pwd=PASS' -c:v libx264 -preset slow -crf 22 -c:a copy output.mkv" 				Low Res
	"ffmpeg -i 'http://10.0.66.120/videostream.cgi?rate=0&user=USER&pwd=PASS' -c:v mpeg4 -vtag xvid /root/temp/test/output.avi"					AVI low Res
	
#Webcam direkt über den ffserver weiter streamen
Problem 1:
		"At least one output file must be specified"
		Das rührt daher das von der Cam kein Audio Stream kommt. Einfach ihrgen einen Dummy Audio File dazu "mixen".
Lösung: 
		"ffmpeg -i 'http://10.0.66.120/videostream.cgi?rate=0&user=USER&pwd=PASS' -i file.mp3 http://127.0.0.1:8090/feed2.ffm"

Post Revisions:

Tags:  , , ,