


Predetermination
hostname: davidsrv (digital signage video server)
ip: 192.168.150.1
username: root
password: XXXXX
Installation vom Debian System
#Debian Installation for Digital Signage
boot #expert # nongui ?
select keyboard: German
detect network, start PC dev
load installer network-console, openssh-client-udev/b?,ufs
hostname: davidsrv
autopart
Password: XXXXX
Packetmanager install
linux-image-2-6.686,
networkmirror
ip-address: 192.168.150.1/24
eth0
DNS ds.projects.
domain hdm-stuttgart.de
Clock set-up, utc yes
software select: non-free yes
grub install mbr ja, nopass
software > standard system
paket (Packetverfassungsverwendung ja)
#after the installation
apt-get update
apt-get update system-update?
apt-get install sudo
apt-get install vim
#for compiling source packages (e.x. ffmpeg)
apt-get install g++
apt-get install make
#for getting the newest (sub)version of the packages)
apt-get install subversion
addgroup --system admins
adduser mw088 -g admins
#creating root rights for admins
visudo
add %admins ALL=NOASS:/bin/su ?
#disable ssh-root login
vi /etc/ssh/sshd_config
PermitRootLogin no
#set acutal date
date 311213452008.52 #(dd:mm:HH:MM:yyyy:SS)
/sbin/hwclock --systohc
addgroup admins
adduser -r ai005 -g admins
chown -R www-data:www-data /var/www/
Installation notwendiger Pakete
Einstellen des VIM-Editors auf die Deutsche Tastatur
Nach Quelle http://mrfoo.de/archiv/188-Deutsche-Tastatur-in-Debian-einstellen.html:
apt-get install console-data console-tools debconf
dpkg-reconfigure console-data
Der erste Befehl ist eigentlich nur um sicherzustellen, dass die nötige Software installiert ist, um das deutsche Tastatur zu aktivieren. Der zweite Befehl rekonfiguriert das Tastaturlayout unter Debian. Dort einfach "Select keymap from arch list", dann als Typ "qwerz" auswählen, dann "German" und als letztes "latin1". Das war es dann auch. Schon habt ihr die deutsche Tastatur unter Debian aktiviert.
Nach Quelle http://www.macuser.de/forum/showthread.php?t=243646:
#vi /usr/share/vim/vimrc
" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime
" you can find below. If you wish to change any of those settings, you should
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten
" everytime an upgrade of the vim packages is performed. It is recommended to
" make changes after sourcing debian.vim since it alters the value of the
" 'compatible' option.
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim
" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
set nocompatible
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax on
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark
" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal g'\"" | endif
endif
" Uncomment the following to have Vim load indentation rules according to the
" detected filetype. Per default Debian Vim only load filetype specific
" plugins.
if has("autocmd")
filetype indent on
endif
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
"set ignorecase " Do case insensitive matching
"set smartcase " Do smart case matching
"set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make
"set hidden " Hide buffers when they are abandoned
set mouse=a " Enable mouse usage (all modes) in terminals
" Source a global configuration file if available
" XXX Deprecated, please move your changes here in /etc/vim/vimrc
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
See Also: Documentation about operation system install settings

Step 2 create your own youtube (on Debian)
Step 2.1 Setting up ffmpeg
Step 2.1.1 Installing ffmpeg and (following) codec dependencies.
#!/bin/sh
#you can copy and paste this script into your sh/bash console.
#Voraussetzungen:
#bzip2 - high-quality block-sorting file compressor - utilities
apt-get install bzip2 #to decompress bz2- files
#subversion-tools - Assorted tools related to Subversion
apt-get install subversion-tools
#gcc - The GNU C compiler
apt-get install gcc
#re2c - Tool for generating fast C-based recognizers
apt-get install re2c
#gawk - GNU awk, a pattern scanning and processing language
apt-get install gawk
#mpg123 mpeg player (audio testing)
apt-get install mpg123
#mpg321 mpeg player (audio testing)
apt-get install mpg321
#mplayer for video testing
apt-get install mplayer
#install depency packages
apt-get install nasm #is needed for compiling the x264 codec
apt-get install automake #is needed for compiling the x264 codec or yasm
apt-get install git #is needed for compiling the x264 codec
apt-get install unzip #is needed for avisynth
#install yasm - dependency for x264 codec
wget http://www.tortall.net/projects/yasm/releases/yasm-0.7.2.tar.gz
tar -xzvf yasm-0.7.2.tar.gz
?cd yasm-0.7.2
?./configure
?make
?make install
...
Step 2.1.2 HOWTO include codecs libaries in ffmpeg
#http://www.digitalpreservation.gov/formats/fdd/browse_list.shtml
http://www.debian-unofficial.org/packages.html
#create directory for codecs
mkdir /usr/local/lib/codecs/
#install a52dec (needed for some vob-files)
wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz
tar -zxvf a52dec-0.7.4.tar.gz
cd a52dec-0.7.4/
./bootstrap
./configure --help
./configure --enable-shared
make
make install
cd ..
#install avisynth - AviSynth is a powerful tool for video post-production. (http://avisynth.org/mediawiki/Main_Page) [We'll skip that]
#cvs -z3 -d:pserver:anonymous@avisynth2.cvs.sourceforge.net:/cvsroot/avisynth2 co -r avisynth_3_0 avisynth
#cd /avisynth/build/
#bzip2 -d circular_buffer_v3.7.tar.bz2
#tar -xf circular_buffer_v3.7.tar
#cd linux
#chmod +x bootstrap.sh
#./bootstrap.sh
#./configure
#--> Freetype is needed
#http://www.digitalpreservation.gov/formats/fdd/browse_list.shtml
wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2
tar -jxvf amrnb-7.0.0.2.tar.bz2
cd amrnb-7.0.0.2/
./configure
make
make install
cd ..
#libamr AMR-WB+ Extended Adaptive Multi-Rate Wideband Codec (HE-AAC+ Codec as Shared Library) # hint: internect connection required
#http://www.digitalpreservation.gov/formats/fdd/fdd000253.shtml
wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.3.tar.bz2
tar -jxvf amrnb-7.0.0.3.tar.bz2
./configure
make
make install
cd ..
#install faac codec (http://www.audiocoding.com/faac.html)
wget http://downloads.sourceforge.net/faac/faac-1.26.tar.gz
tar -xzvf faac-1.26.tar.gz
cd faac
./bootstrap
./configure --with-mp4v2
make
make install
cd ..
#install faad codec - FAAC is an open source MPEG-4 and MPEG-2 AAC encoder, it is licensed under the LGPL license. (http://www.audiocoding.com/faad2.html)
wget http://ovh.dl.sourceforge.net/sourceforge/faac/faad2-2.6.1.tar.gz
tar -xzvf faad2-2.6.1.tar.gz
cd faad2
./bootstrap
./configure
make
make install
cd ..
#install libogg
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
tar -xzvf libogg-1.1.3.tar.gz
cd libogg-1.1.3/
./configure
make
make install
cd ..
#install libvorbis
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz
tar -xzvf libvorbis-1.2.0.tar.gz
cd libvorbis-1.2.0/
./autogen.sh #new since 20081208
./configure
make
make install
cd ..
#install lame
wget http://kent.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
tar -xzvf lame-3.97.tar.gz
cd lame-3.97/
./configure
make
make install
cd ..
#install theora
svn co http://svn.xiph.org/trunk/theora
cd theora
./autogen.sh
cd ..
#install xvid codec
http://downloads.xvid.org/downloads/xvidcore-1.2.1.tar.gz
tar -xzvf xvidcore-1.2.1.tar.gz
cd xvidcore/build/generic
make
make install
cd ../../../
#install x264 codec (h264)
ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20081207-2245.tar.bz2
bzip -d x264-snapshot-20050824-2219.tar.bz2
tar -xvf x264-snapshot-20050824-2219.tar
cd x264-snapshot-20050824-2219
./configure --enable-pic --enable-shared
cd ..
#install zlib (compression) (http://www.zlib.net/)
wget http://www.zlib.net/zlib-1.2.3.tar.gz
tar -xzvf zlib-1.2.3.tar.gz
cd zlib-1.2.3/
./configure --shared
make
make install
cd ..
#install essential codecs
wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
tar -xjvf essential-20071007.tar.bz2
mv essential-20071007/* /usr/local/lib/codecs/
#Link libraries
ln -s /usr/local/lib/libamrnb.so /usr/lib/libamrnb.so
ln -s /usr/local/lib/libamrnb.so.3 /usr/lib/libamrnb.so.3
ln -s /usr/local/lib/libamrnb.so.3.0.0 /usr/lib/libamrnb.so.3.0.0
ln -s /usr/local/lib/libamrwb.so /usr/lib/libamrwb.so
ln -s /usr/local/lib/libamrwb.so.3 /usr/lib/libamrwb.so.3
ln -s /usr/local/lib/libamrwb.so.3.0.0 /usr/lib/libamrwb.so.3.0.0
ln -s /usr/local/lib/libavcodec.so /usr/lib/libavcodec.so
ln -s /usr/local/lib/libavcodec.so.52 /usr/lib/libavcodec.so.52
ln -s /usr/local/lib/libavcodec.so.52.6.0 /usr/lib/libavcodec.so.52.6.0
ln -s /usr/local/lib/libfaac.so /usr/lib/libfaad.so
ln -s /usr/local/lib/libfaad.so.0.0.0 /usr/lib/libfaad.so.0.0.0
ln -s /usr/local/lib/libfaac.so /usr/lib/libfaac.so
ln -s /usr/local/lib/libfaac.so.0 /usr/lib/libfaac.so.0
ln -s /usr/local/lib/libfaac.so.0.0.0 /usr/lib/libfaac.so.0.0.0
ln -s /usr/local/lib/libfaad.so /usr/lib/libfaad.so
ln -s /usr/local/lib/libfaad.so.0 /usr/lib/libfaad.so.0
ln -s /usr/local/lib/libfaad.so.0.0.0/usr/lib/libfaad.so.0.0.0
ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/ibmp3lame.so.0
ln -s /usr/local/lib/libtheora.so.0 libtheora.so.0
ln -s /usr/local/lib/libx264.so.65 libx264.so.65
#ln -s /usr/local/lib/libz.so /usr/lib/libz.so
#ln -s /usr/local/lib/libz.so.1 /usr/lib/libz.so.1
#ln -s /usr/local/lib/libz.so.1.2.3 /usr/lib/libz.so.1.2.3
Step 2.1.3 HOWTO install ffmpeg (with codecs)
#svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg -r15261
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
#Additional step
#rename the actual downloaded version and add a symbolic link
#like mv ffmpeg ffmpeg_r16035
#than set a link to the newest version of ffmpeg
#ln -s ffmpeg_r16035 ffmpeg
cd ffmpeg
#standard version would be
#./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared
# now here we go with our codec inclusions
# dump from ./configure --help
Standard options:
--help print this message
--logfile=FILE log tests and output to FILE [config.err]
--disable-logging do not log configure debug information
--prefix=PREFIX install in PREFIX []
--bindir=DIR install binaries in DIR [PREFIX/bin]
--libdir=DIR install libs in DIR [PREFIX/lib]
--shlibdir=DIR install shared libs in DIR [PREFIX/lib]
--incdir=DIR install includes in DIR [PREFIX/include]
--mandir=DIR install man page in DIR [PREFIX/share/man]
--enable-static build static libraries [yes]
--disable-static do not build static libraries [no]
--enable-shared build shared libraries [no]
--disable-shared do not build shared libraries [yes]
--enable-gpl allow use of GPL code, the resulting libs
and binaries will be under GPL [no]
--enable-nonfree allow use of nonfree code, the resulting libs
and binaries will be unredistributable [no]
--enable-postproc enable GPLed postprocessing support [no]
--enable-swscale enable GPLed software scaler support [no]
--enable-avfilter video filter support (replaces vhook) [no]
--enable-avfilter-lavf video filters dependent on avformat [no]
--disable-vhook disable video hooking support
--enable-beosthreads use BeOS threads [no]
--enable-os2threads use OS/2 threads [no]
--enable-pthreads use pthreads [no]
--enable-w32threads use Win32 threads [no]
--enable-x11grab enable X11 grabbing [no]
#setting compiling settings for ffmpeg and with codecs are beeing supported.
#(without --enable-avisynth)
#gpl version
./configure --enable-shared --mandir=/usr/share/man --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-zlib --disable-mmx > ffmpeg_config_enabled
#non-free version
./configure --enable-shared --enable-gpl --enable-nonfree --mandir=/usr/share/man --enable-pthreads --enable-libamr-nb --enable-libamr-wb --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-zlib --disable-mmx > ffmpeg_config_enabled
make
make install
make install-man #install Manual pages for ffmpeg and ffserver
cd ..
echo /usr/local/lib >> /etc/ld.so.conf.d/ffmpeg.conf
ldconfig -v
chmod -R 755 /usr/local/lib/codecs/
updatedb &
#check if it's working:
ffmpeg
#the anwser should be the like that:
#FFmpeg version SVN-r16035, Copyright (c) 2000-2008 Fabrice Bellard, et al.
# configuration: --enable-shared --enable-gpl --mandir=/usr/share --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --#enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-zlib --disable-mmx
# libavutil 49.12. 0 / 49.12. 0
# libavcodec 52. 6. 0 / 52. 6. 0
# libavformat 52.23. 1 / 52.23. 1
# libavdevice 52. 1. 0 / 52. 1. 0
# built on Dec 10 2008 22:15:07, gcc: 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
#At least one output file must be specified
Step 2.2 Installing VLC
#install vlc
apt-get install vlc
#The following NEW packages will be installed:
# libaa1 libavahi-client3 libavahi-common-data libavahi-common3 libavc1394-0 libcdio6 libdbus-1-3 libdbus-glib-1-2 libdvbpsi4 libdvdnav4 libflac7
# libfribidi0 libglu1-mesa libhal1 libiso9660-4 libmodplug0c2 libmpcdec3 libmpeg2-4 libnotify1 libpostproc0d libsdl-image1.2 libsmbclient libtar
# libtwolame0 libvcdinfo0 libvlc0 libwxbase2.6-0 libwxgtk2.6-0 libxosd2 vlc vlc-nox
Step 2.3 Installing webserver / webservices in relation to ffmpeg
#Software for Thumbnails of Video:
#ffmpeg-php.sourgeforge.net
#Video playback
#flowplayer.org
#Vorschlag für einen Webserver:
#lighttpd, da kleiner und auf performance angepasst + extra FLV streaming module (selbe Funktionalität wie beim Flash Media Server, nur kostenlos) nicht
#php5-dev - Files for PHP5 module development
apt-get install php5-dev









See Also: Install Linux System



Step 3 - using ffmpeg to encode video/audio files
Proposal for encoding formats with ffmpeg
http://www.video-flash.de/index/h264-quicktime-als-encoder-fur-flashvideos/
Ausgangsdatei:
VTS_01_1.VOB 156 MB
iPhone, iPhone (Mobiltelefone), iPod und Apple TV
Bei diesen drei Presets kann man keine eigenen Einstellungen treffen. Da alle auf H.264 basieren, funktionieren die Videos auch in Flash. Unterschiedlich sind die Dateigrößen (bzw. Auflösungen, Datenrate, etc.): Am kleinsten ist iPhone (Mobiltelefone), das in die Kategorie
3GP ist ein Containerformat, das vor allem auf mobilen Endgeräten verwendet wird (z.B. auch in der MMS). Folgende Codecs sind generell in 3GP möglich:
3GP fällt (176×117, 15fps, ca. 80 KBit/s) (http://www.3gpp.org/)
▪ Video: MPEG4-part 2 oder H.263 oder H.264, wobei H.264 bisher nur auf sehr aktuellen Handys einiger Hersteller funktioniert (http://de.wikipedia.org/wiki/3gp)
▪ Audio: AMR oder AAC - LC
▪ Als Bildgrößen werden hauptsächlich die Auflösungen 128×96, 176×144, 220×176, 320×240 Pixel und noch einige undokumentierte weitere Größen verwendet.
▪ Der MIME-Typ (content-type) dieses Dateityps lautet „video/3gpp“ (Audio- und/oder Videodaten) oder „audio/3gpp“ (nur Audiodaten). Man beachte, dass eine von einem Web-Server gesendete „video/3gpp“-Datei sowohl ausschließlich Audiodaten als auch Audio- und Videodaten enthalten darf.
iPhone (480×320, 30fps, ca. 990 KBit/s)
ffmpeg_duration_iPhone.log
Process duration:
Command exited with non-zero status 127
0.00
iPod (640×426, 30 fps, ca. 1600 Kbit/s)
ffmpeg_duration_iPod
Process duration:
892.65 = 14.88 Min - 38 MB
#für die Gerätedisplays.
#Apple TV (720×480, ca. 2700 Kbit/s) ist am hochwertigsten und für die volle Fernsehauflösung oder
#gar höher (HD) ausgelegt.
#ffmpeg_duration_AppleTV
#Process duration:
#1001.05 = 16,7 Min
#PAL 720×576
Hinweis: Die genauen Zielauflösungen hängen natürlich vom Ausgangsmaterial ab, das in diesem Fall DV NTSC (720×480 mit 29,97 fps) war.
ffmpeg_duration_FLV
Process duration:
388.64 = 6.47 Min
ffmpeg_duration_QVGA
Process duration:
Command exited with non-zero status 1
0.11
Flash
Mpeg4 -> FLV (http://www.vimeo.com/help/compression)
Bitrate: 1,8 mbit/s
audio 48 khz, 192 kbit/s
bildformat von youtube/vimeo
640x480
MPEG-4 (Video); nicht kompatibel mit Flash
H.263 (Video); nicht kompatibel mit Flash
H.264 (Video); kompatibel
AMR (Audio); nicht kompatibel mit Flash
AAC-LC; kompatibel
___________________________________________________________________________________________________
FORMAT TRYS
SHOULD BE:
vob -> m2t (MPEG-2 transport stream format) vcodec: mpegts; $file.m2t
vob -> m2p (MPEG-2 Program Stream format) vcodec svcd,vob,dvd; $file.ps
http://www.slashcam.de/multi/Glossar/MPEG2.html
M2P: http://en.wikipedia.org/wiki/Program_stream
MPEG-2 Program Stream Format File
MPEG:
MPEG-1 System Stream (.mpg, .mpeg) ist der offizielle Container für das MPEG-1-Videoformat. Ältere VCD-Formate benutzten ihn hauptsächlich. Er verliert zunehmend an Bedeutung.
MPEG-2 Program Stream (.mpg, .mpeg, .ps) ist fast identisch zum MPEG-1 System Stream, verfügt aber über eine wesentlich bessere Auflösung und einen schnelleren Transport.
MPEG-2 Transport Stream (.ts, .tsp) ist ein für fehleranfällige Übertragungswege wie DVB optimiertes Containerformat.
MPEG-4 File Format (.mp4) ist das Standard-Containerformat für MPEG-4 ASP/AVC-Videostreams und basiert auf dem Quicktime-Containerformat.
Video Object (.vob) ist das Containerformat für DVD-Video und meist MPEG-1 oder MPEG-2-komprimiert.
Enhanced-VOB (.evo) ist das Containerformat für HD-DVD- und Blu-Ray Disc-Video.
__________________________________________________
NOTE: To see the supported input formats, use ffmpeg -formats.

ffmpeg supported files (bzw.) the (Ansprechname) program calls
SUPPORTED FILES:
Decoding, Video:
DE mpegts MPEG-2 transport stream format
D mpegtsraw MPEG-2 raw transport stream format
D mpegvideo MPEG video
Decoding, Audio:
E adts ADTS AAC
__________________________________________________
Encoding, Video:
DE mpegts MPEG-2 transport stream format
E mpeg2video MPEG-2 video
E svcd MPEG-2 PS format (VOB)
E vob MPEG-2 PS format (VOB)
E dvd MPEG-2 PS format (DVD VOB)
Encoding, Audio:
_______________________________________________
#Usage: ffmpeg -formats
SUPPORTED CODECS:
__________________________________________________
Decoding, Video:
D V D h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
D V D mdec Sony PlayStation MDEC (Motion DECoder)
D A mp3 MP3 (MPEG audio layer 3)
DE flv FLV format
Decoding, Audio:
D A aac Advanced Audio Coding
Encoding, Video:
DEVSDT mpeg1video MPEG-1 video
DEVSDT mpeg2video MPEG-2 video
DE flv FLV format
Encoding, Audio:
DEA mp2 MP2 (MPEG audio layer 2)
EA libmp3lame libmp3lame MP3 (MPEG audio layer 3)
EA libvorbis libvorbis Vorbis
__________________________________________________
#Usage: ffmpeg -vcodec/ -acodec
konstante bitrate?
variable bitrate?
constant quality
vob -> m2t
vob -> m2p
Sascha Müller Philipsson
vob/ts-Files to etc.
Howto Map Audio (AAC) Streams (ts files directly recorded from the sat receiver to the hard disk)
http://www.videohelp.com/forum/archive/mencoder-ts-to-avi-x264-with-multiple-audio-stream-t351357.html
Example:
For the source:
Stream #0.1[0xc0](deu): Audio: mp2, 48000 Hz, stereo, 160 kb/s
Stream #0.2[0xc1](eng): Audio: mp2, 48000 Hz, stereo, 160 kb/s
Stream #0.3[0x80](deu): Audio: ac3, 48000 Hz, stereo, 448 kb/s
ffmpeg -i in.ts out.avi -vcodec h264 -acodec copy is equal to
ffmpeg -i in.ts out.avi -vcodec h264 -acodec copy -map 0:0 -map 0:1
both lead to
Output #0, avi, to 'out.avi':
Stream #0.0: Video: mpeg4, yuv420p, 720x576, q=2-31, 200 kb/s, 25.00 fps(c)
Stream #0.1: Audio: mp2, 48000 Hz, stereo, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
If you want to add a second audio stream, you have to provide the full mapping info
-map 0:0 -map 0:1 -map 0:2".
But this alone leads to the error
Number of stream maps must match number of output streams.
For each audio stream beyond the first, you have to add -newaudio (1 video + 1 audio stream is default).
So, the correct mapping for two audio streams is
-map 0:0 -map 0:2 -map 0:3 -newaudio (stripping stream 0:1),
for all three
-map 0:0 -map 0:3 -map 0:2 -newaudio -map 0:1 -newaudio (inverted audio stream order).

Testet encodings with ffmpeg
____________________________________________________________________________________________________
#worked
/usr/local/bin/ffmpeg -i PIXAR___FOR_THE_BIRDS.MPG -f flv -b 1800k -s 640x480 -acodec libmp3lame -ac 2 -ab 192k PIXAR___FOR_THE_BIRDS.flv
Bitrate: 1,8 mbit/s
audio 48 khz, 192 kbit/s
#!/bin/sh
/usr/local/bin/ffmpeg -i $1 -ar 22050 -ab 56 -aspect 4:3 -b 200 -r 12 -f flv -s 320x240 -acodec mp3 -ac 1 $1.flv
/usr/local/bin/ffmpeg -i PIXAR___FOR_THE_BIRDS.MPG -ar 22050 -ab 56 -aspect 4:3 -b 200 -r 12 -f flv -s 320x240 -ac 1 PIXAR___FOR_THE_BIRDS.flv
/usr/local/bin/ffmpeg -i VTS_01_1.VOB -ar 22050 -ab 56 -aspect 4:3 -b 200 -r 12 -f flv -s 320x240 -ac 1 VTS_01_1.VOB.flv
____________________________________________________________________________________________________
#tested (2008-12-04_18:09)
ffmpeg -i VTS_01_1.VOB -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k VTS_01_1.VOB.avi
This is a typical DVD ripping example; the input is a VOB file, the output an AVI file with MPEG-4 video and MP3 audio.
Note that in this command we use B-frames so the MPEG-4 stream is DivX5 compatible, and GOP size is 300 which means one intra frame every 10 seconds for 29.97fps input video. Furthermore, the audio stream is MP3-encoded so you need to enable LAME support by passing --enable-libmp3lame to configure. The mapping is particularly useful for DVD transcoding to get the desired audio language.
#tested (2008-12-04_18:28)
ffmpeg -i VTS_01_1.VOB -deinterlace -vcodec mpeg4 -b 5000 -acodec libmp3lame -ab 128 -f mpegts VTS_01_1.VOB.m2t
#tested (2008-12-04_19:45)
ffmpeg -i VTS_01_1.VOB -deinterlace -vcodec mpeg2video -acodec libmp3lame -f mpegts VTS_01_1.VOB.m2t
Duration: 00:03:51.51, start: 0.360000, bitrate: 5687 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576 [PAR 16:15 DAR 4:3], 5000 kb/s, 25.00 tb(r)
Stream #0.1[0xa0]: Audio: pcm_s16be, 48000 Hz, stereo, s16, 1536 kb/s
Output #0, mpegts, to 'VTS_01_1.VOB.ps':
Stream #0.0: Video: mpeg2video, yuv420p, 720x576 [PAR 16:15 DAR 4:3], q=2-31, 200 kb/s, 25.00 tb(c)
Stream #0.1: Audio: libmp3lame, 48000 Hz, stereo, s16, 64 kb/s
#tested (2008-12-08_18:30) - with new ffmpeg_r16035 version
ffmpeg -threads 4 -i editingwithplone.mov -r 29.97 -vcodec libx264 -s 480x272 -flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -crf 24 -bt 256k -refs 1 -coder 0 -subq 5 -partitions +parti4x4+parti8x8+partp8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -trellis 2 -sc_threshold 40 -i_qfactor 0.71 -acodec libvorbis -ab 128k -ar 48000 -ac 2 editingwithplone.mov.mp4
untestet
ffmpeg -i VTS_01_1.VOB -deinterlace -vcodec mpeg2video -acodec libmp3lame -f mpegts VTS_01_1.VOB.m2t
#tested (2008-12-17_01:35) mp4 -> flv (Flash)
ffmpeg -i ../input/tests/MP4/Magic_Hour_20081128.mp4 -pass 1 -b 1800k -acodec libmp3lame -ac 2 -ar 44100 -ab 192k -y -f flv Magic_Hour_20081128.mp4.flv
ffmpeg -i ../input/tests/WMV/BourneSupremacyT3_720p_8mbit_SRD_NR_bt-1.wmv -pass 1 -b 1800k -acodec libmp3lame -ac 2 -ar 44100 -ab 192k -y -f flv -y ../output/BourneSupremacyT3_720p_8mbit_SRD_NR_bt-1-vc_copy-res_640×480-b_1800k-ab_192k-pass_1_2008-12-17_01-49.flv
#tested (2008-12-14_20:29) - 5 fps
ffmpeg -i transporter_2_h1080p.mov -f mpeg2video -vcodec mpeg2video -acodec copy transporter_2_h1080p.f_mpeg2video.mpeg2
#example for outputfile 1080p
#transporter_2_h1080p_original.mov
#H.264 Decoder, 1920 x 816, 16,7 Mill.
#AAC, 5.1 (C L R Ls Rs LFE), 48,000 kHz
#Datarate: 8.99 MBit/s
#Size: 1920 x 816 Pixel
#FPS: 23,98
#MOV->Mpeg2
#tested (2008-12-14_20:53) - 7 fps
ffmpeg -y -i transporter_2_h1080p_original.mov \
-f mpeg2video \
-vcodec mpeg2video -slice_flags 8 -qmin 1 -qmax 4 -qscale 1 -vtag mx5p -vbsf imxdump \
-acodec copy \
-minrate 50000k -maxrate 50000k -b 50000k -bufsize 20000k \
-intra -flags +ildct+low_delay -dc 10 -flags2 +ivlc+non_linear_q -rc_init_occupancy 2000000 \
transporter_2_h1080p.mpeg2
#TS->MPEG
#tested (2008-12-14_2
ffmpeg -i ProSieben_Die_Herrschaft_des_Feuers-01.ts -target dvd -tvstd pal -aspect 4:3 -maxrate 60000 Die_Herrschaft_des_Feuers-01.m2v
#I think -target dvd is the option for:
#Stream #0.0: Video: mpeg2video, yuv420p, 720x576, q=2-31, 6000 kb/s, 25.00 fps ©
#Stream #0.1: Audio: ac3, 48000 Hz, stereo, 448 kb/s
____________________________________________________________________________________________________
#untestet
____________________________________________________________________________________________________
I created a mpeg 2 transport stream usinng the following command.
ffmpeg -i VTS_01_1.VOB -vcodec mpeg2video -b 1000k -acodec libmp3lame -ab 128k VTS_01_1.VOB.ts
ffmpeg -threads 4 -i editingwithplone.mov -r 29.97 -vcodec libx264 -s 480x272 -flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -crf 24 -bt 256k -refs 1 -coder 0 -subq 5 -partitions +parti4x4+parti8x8+partp8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -trellis 2 -sc_threshold 40 -i_qfactor 0.71 -acodec libmp3lame -ab 128k -ar 48000 -ac 2 editingwithplone.mov.mp4
ffmpeg -y -i VTS_01_1.VOB -vcodec h264 -pass 2 -refs 3 -subq 5 -b 700 -s 320x240 -r 23.976023976 -ac 1 -acodec aac -ar 48000 -ab 160 -ac 2 VTS_01_1.VOB.mp4
ffmpeg -i VTS_01_1.VOB -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k VTS_01_1.VOB.avi
/usr/local/bin/ffmpeg -i PIXAR___FOR_THE_BIRDS.MPG -ar 44100 -ab 56 -aspect 16:9 -b 200 -r 12 -f flv -s 320x240 -acodec mp3 -ac 1 PIXAR___FOR_THE_BIRDS.flv
#Skript to convert different video formats (without -threads 4)
#Skript to convert different video formats (without -threads 4)
#!/bin/bash
# @author: Martin Andreas Wörz
# @version: 2008.12.12
# @project: Digital Signage - Workflows in Digital TV
# @institute: Media University of Applied Science Stuttgart
#
# @description: this script is to convert one input video files to several video files
# @variables
BIN=/usr/local/bin/
PWD=$(pwd)
STD_PATH='/home/media/input/tests/VOB'
PWD=${STD_PATH}
# ffmpeg
FFMPEG='${$BIN}/ffmpeg'
# input variables
# test if there is any arguments given for the input file - otherwise use the first standard DVD-VOB
if [ -z ${1} ]; then
INPUT_FILE='VTS_01_1.VOB'
else
INPUT_FILE=$1
fi
# output variables
INPUT_FILE_MAIN=$(basename ${INPUT_FILE} | cut -d'.' -f1)
OUTPUT_FOLDER='../output'
# @progam
#---------- functions ----------#
get_timestamp () {
#echo -n $(date +%Y-%m-%d_%H-%m_%S)
echo -n $(date +%Y-%m-%d_%H-%m)
}
write_logfile () {
echo -n "" > $LOGFILE
get_timestamp >> $LOGFILE
}
#---------- functions ----------#
TIMESTAMP=$(get_timestamp)
LOGFILE=../logs/ffmpeg_$TIMESTAMP.log
LOGFILE_URI=${PWD}/${LOGFILE}
write_logfile
#---------- 3GP -----------#
#settings variables for the 3GP file
#---------- 3GP -----------#
#
PASSES='1 2 3'
FORMAT='3GP'
FFORMAT=$FORMAT
#video settings
VBITRATES='80k'
VCODEC='h263'
V01=''
VOPTIONS='$V01 $VO2'
#VSIZE='176x144'
ASPECT='4:3'
VSIZES='176x144' # 352x288'
FPS='29.97'
#audio settings
ACODEC='libamr_nb' # should be AAC or AMR
#ABITRATE='12.2k' #12.8 kHz to 38.4 kHz
ABITRATE='12.2k'
AFREQ='8000'
ACHANNELS='1'
#output container format
FFORMAT='3gp'
#additional options
O1='-deinterlace'
O2='-flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -crf 24 -bt 990k -refs 1'
O3=''
OPTIONS=${O1}' '${O2}' '${O3}
for PASS in ${PASSES}; do
for VBITRATE in ${VBITRATES}; do
for VSIZE in ${VSIZES}; do
echo now executing ${VBITRATE} ${VSIZE}:
#echo "Process duration:" > $LOGFILE && \
echo -n ";" >> ${LOGFILE}
EXEC=$(echo \
/usr/bin/time -f "%e" --output=${LOGFILE} --append \
ffmpeg -i ${INPUT_FILE} -pass ${PASS} -r ${FPS} \
-vcodec ${VCODEC} -b ${VBITRATE} \
-acodec ${ACODEC} -ac ${ACHANNELS} -ar ${AFREQ} -ab ${ABITRATE} -y \
-f ${FFORMAT} -aspect ${ASPECT} -s ${VSIZE} \
${OPTIONS} \
${OUTPUT_FOLDER}'/'${INPUT_FILE_MAIN}'-pass_'${PASS}'-vc_'${VCODEC}'-b_'${VBITRATE}'-ab_'${ABITRATE}'_'${TIMESTAMP}'.'${FORMAT} )
\
echo $EXEC
$(echo $EXEC) #> ${LOGFILE}'_full' 2>&1
done
done
done
#---------- iPhone -----------#
#settings variables for the iPhone file
#Low-Complexity-Version
#(http://www.apple.com/de/iphone/specs.html)
#---------- iPhone -----------#
#
PASSES='1 2 3'
FORMAT='MP4'
FFORMAT=$FORMAT
#video settings
VBITRATES='1500k' #2000k 2500k'
VCODEC='libx264'
V01=''
VOPTIONS='$V01 $VO2'
ASPECT='4:3'
VSIZES='320x240' #480x320 640×480'
#audio settings
ACODEC='libfaac'
ABITRATE='160k' # iPhone doesn't support more than 160k
AFREQ='48000'
ACHANNELS='2'
#output container format
FFORMAT='m4v'
#additional options
O1='-deinterlace'
O2='-flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -crf 24 -bt 990k -refs 1'
O3=''
OPTIONS=${O1}' '${O2}' '${O3}
for PASS in ${PASSES}; do
for VBITRATE in ${VBITRATES}; do
for VSIZE in ${VSIZES}; do
echo now executing PASS_${PASSES} VBITRATE_${VBITRATE} VSIZE_${VSIZE}:
#echo "Process duration:" > $LOGFILE && \
echo -n ";" >> ${LOGFILE}
EXEC=$(echo \
/usr/bin/time -f "%e" --output=${LOGFILE} --append \
ffmpeg -i ${INPUT_FILE} -pass ${PASS} -r ${FPS} \
-vcodec ${VCODEC} -b ${VBITRATE} \
-acodec ${ACODEC} -ac ${ACHANNELS} -ar ${AFREQ} -ab ${ABITRATE} -y \
-f ${FFORMAT} -aspect ${ASPECT} -s ${VSIZE} \
${OPTIONS} \
${OUTPUT_FOLDER}'/'${INPUT_FILE_MAIN}'-pass_'${PASS}'-vc_'${VCODEC}'-b_'${VBITRATE}'-ab_'${ABITRATE}'_'${TIMESTAMP}'.'${FORMAT} )
# ${OPTIONS} \
#> ${LOGFILE}'_full' 2>&1
# -s ${VSIZE}
echo $EXEC
$(echo $EXEC) > ${LOGFILE}'_full' 2>&1
done
done
done
#LATER ON
ffmpeg -i VTS_01_1.VOB -s qcif \
-vcodec h263 -r 25 \
-acodec libmp3lame -ac 1 -ar 8000 -ab 12.2k -y \
output/VTS_01_1.3GP #> logs/ffmpeg_3GP.log 2>&1
#rm -f output/VTS_01_1_iPhone.MP4
#iPhone (480×320, 30fps, ca. 990 KBit/s) (works 20081210-0058)
FORMAT=iPhone
echo "Process duration:" > logs/ffmpeg_duration_$FORMAT.log && \
/usr/bin/time -f "%e" --output=logs/ffmpeg_duration_$FORMAT.log --append \
ffmpeg -i VTS_01_1.VOB \
-r 29.97 \
-vcodec libx264 -s 480x272 -flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -crf 24 -bt 990k -refs 1 -coder 0 -me_range 16 -subq 5 -partitions +parti4x4+parti8x8+partp8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -trellis 2 -sc_threshold 40 -i_qfactor 0.71 \
-acodec libmp3lame -ab 192k -ar 48000 -ac 2 output/VTS_01_1_iPhone.MP4 \
> logs/ffmpeg_$FORMAT.log 2>&1
#rm -f output/VTS_01_1_iPod.MP4
#iPod (640×426, 30 fps, ca. 1600 Kbit/s) (works 20081210-0058)
echo "Process duration:" > logs/ffmpeg_duration_iPod && \
/usr/bin/time -f "%e" --output=logs/ffmpeg_duration_iPod --append \
ffmpeg -i VTS_01_1.VOB \
-vcodec libx264 -s 640x426 -flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -crf 24 -bt 1600k -refs 1 -coder 0 -me_range 16 -subq 5 -partitions +parti4x4+parti8x8+partp8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -trellis 2 -sc_threshold 40 -i_qfactor 0.71 \
-r 29.97 \
-acodec libmp3lame -ab 192k -ar 48000 -ac 2 \
output/VTS_01_1_iPod.MP4 > logs/ffmpeg_iPod.log 2>&1
#rm -f output/VTS_01_1_AppleTV.MP4
#für die Gerätedisplays.
#Apple TV (720×480, ca. 2700 Kbit/s) ist am hochwertigsten und für die volle Fernsehauflösung oder gar höher (HD) ausgelegt. (works 20081210-0058)
#Hinweis: Die genauen Zielauflösungen hängen natürlich vom Ausgangsmaterial ab, das in diesem Fall DV NTSC (720×480 mit 29,97 fps) war.
#echo "Process duration:" > logs/ffmpeg_duration_AppleTV && \
#/usr/bin/time -f "%e" --output=logs/ffmpeg_duration_AppleTV --append \
#ffmpeg -i VTS_01_1.VOB -r 29.97 \
#-vcodec libx264 -s 720x480 -flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -crf 24 -bt 2700k -refs 1 -coder 0 -#me_range 16 -subq 5 -partitions +parti4x4+parti8x8+partp8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -trellis 2 -#sc_threshold 40 -i_qfactor 0.71 \
#-acodec libmp3lame -ab 192k -ar 48000 -ac 2 \
#output/VTS_01_1_AppleTV.MP4 > logs/ffmpeg_AppleTV.log 2>&1
#rm -f output/VTS_01_1.FLV
#Flash (640×426, 30 fps, ca. 1600 Kbit/s)
#ffmpeg -i VTS_01_1.VOB -b 400 -aspect 4:3 -r 12 -f flv -s 640x480 \
-acodec libmp3lame -ab 128k -ar 48000 -ac 2 VTS_01_1.FLV
echo "Process duration:" > logs/ffmpeg_duration_FLV && \
/usr/bin/time -f "%e" --output=logs/ffmpeg_duration_FLV --append \
ffmpeg -i VTS_01_1.VOB -b 400 -aspect 4:3 -s 640x480 \
-acodec libmp3lame -ab 192k -ar 44100 -ac 2 \
-f flv \
output/VTS_01_1.FLV > logs/ffmpeg_FLV.log 2>&1
#M2T Stream
#rm -f output/VTS_01_1_QVGA.MP4
#FFmpeg command line: (works 20081210-0057)
#echo "Process duration:" > logs/ffmpeg_duration_QVGA && \
#/usr/bin/time -f "%e" --output=logs/ffmpeg_duration_QVGA --append \
#ffmpeg -deinterlace -y -i VTS_01_1.VOB 2 -f mp4 -title "h.264 QVGA test" \
#-vcodec libx264 -level 41 -refs 2 -loop 1 -deblockalpha 0 -deblockbeta 0 -parti4x4 1 -partp8x8 1 -partb8x8 1 -coder ac -subq 6 -#me_range 21 -s 320x180 -r 30000/1001 -b 320k -maxrate 450k -bufsize 5000k -g 300 \
#-acodec libmp3lame -ac 2 -ab 192k output/VTS_01_1_QVGA.MP4 > logs/ffmpeg_QVGA.log 2>&1
#---------- M2T -----------#
#settings variables for m2t file
#---------- M2T -----------#
#video settings
VBITRATE='6000k'
VCODEC='mpeg2video'
#audio settings
ACODEC='libmp3lame'
ABITRATE='192k'
#output container format
FFORMAT='mpegts'
#additional options
O1='-deinterlace'
O2=''
O3=''
OPTIONS='$O1 $O2'
rm output/VTS_01_1.VOB.m2t
#M2P (works 20081210-0101)
echo "Process duration:" > logs/ffmpeg_duration_m2t && \
/usr/bin/time -f "%e" --output=logs/ffmpeg_duration_m2t --append \
ffmpeg -i VTS_01_1.VOB $OPTIONS -vcodec $VCODEC -b $BITRATE -acodec $ACODEC -ab $ABITRATE \
-f $FFORMAT \
output/VTS_01_1.VOB.m2t > logs/ffmpeg_m2t.log 2>&1
#TODO
#windows media / quicktime (1000kb/s)
#flash (1000kb/s)
#AUDIO 192 k/bits
#ALLES im 4:3 format
#konstante bitrate?
#variable bitrate?
#constant quality
#vob -> m2t
#vob -> m2p
#Sascha Müller Philipsson (?)

HOWTO install ffmpeg-php # for thumbnails of the videos
ffmpeg-php
#install ffmpeg-php
wget http://kent.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.3.1.tbz2
tar -xjvf ffmpeg-php-0.5.3.1.tbz2
cd ffmpeg-php-0.5.3.1
phpize
./configure
make
echo extensions=$(echo $(make install | tail -1 | cut -d":" -f 2))ffmpeg.so > ffmpeg_php.ini
Installing shared extensions: /usr/lib/php5/20060613+lfs/
echo # configuration for ffmpeg-php module > /etc/php5/apache2/conf.d/ffmpeg.ini
echo extension=ffmpeg.so >> /etc/php5/apache2/conf.d/ffmpeg.ini
/etc/init.d/httpd restart
php5 -r "phpinfo();" | grep ffm
Die Ausgabe müsste sein:
>#additional .ini files parsed => /etc/php5/cli/conf.d/ffmpeg.ini,
>#ffmpeg
>#ffmpeg support (ffmpeg-php) => enabled
>#ffmpeg-php version => 0.5.3.1
>#ffmpeg-php gd support => enabled
>#ffmpeg.allow_persistent => 0 => 0
>#ffmpeg.show_warnings => 0 => 0
Da /home das größte Laufwerk ist sollen die Daten hier verarbeitet werden.
mkdir /home/media/
mkdir /home/media/input
mkdir /home/media/output
mkdir /home/media/scripts/ffmpeg
Bash Loops for, while and until:
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-7.html
Video_create_your_own
_
____________________________________________________________________________________________________
#player zur wiedergabe Quelle: http://granades.com/2006/09/14/how-to-put-flash-videos-on-your-blog-in-many-easy-steps/
wget http://granades.com/flv/flvplayer.swf
#Set Up Cronjob
Ordner erstellen
mkdir /etc/cron.minutely/
mkdir /etc/cron.minutely/every-minute/*
ln -s /home/media/scripts/ffmpeg/encode_to_files.sh encode_to_files.sh
crontab -e
#run cronjob every minutes
*/1 * * * * root /etc/cron.minutely/every-five-minutes/*
:wq
#Creating XHTML file for Flashplayout
index.html
<html>
<head>
<title>Flash FLV Player</title>
</head>
<body>
<h3>My First FLV video</h3>
<object type="application/x-shockwave-flash" width="320" height="260" wmode="transparent" data="flvplayer.swf?file=output.flv&autoStart=false">
<param name="movie" value="flvplayer.swf?file=output.flv&autoStart=false" />
<param name="wmode" value="transparent" />
</object>
</body>
</html>
CREATE TABLE ´video_uploader´.´categories´(
´id´SMALLINT NOT NULL AUTO_INCREMENT ,
´name´ VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
PRIMARY KEY (´id´)
) ENGINE = MYISAM
INSERT INTO ´categories´ (´name´)
VALUES (´Comedy´),(´Education´),(´Films´),(´How To´),(´Music´),(´People´),(´Sport´),(´Technology´)
2008.11.20
Smart Phones
Amnia Diamond
HTC Touch HD
