wiki:FFmpeg

Warning: Work in progress, this page is for from completed/correct. When trying to compile FFmpeg under FreeBSD 8.1-RELEASE I got an error:

Error: `ff_h264_cabac_tables+1024+128(%esi)' is not a valid 64 bit base/index expression

apparently the linker is broken, but as seen at Solaris here there is a workaround, also seen to work at FreeBSD here. After the ./configure phase apply:

 echo '#define BROKEN_RELOCATIONS 1' >> config.h

Trying this fix did still NOT solve my issue, next is trying a later/better compiler and linker, I will get the job done by clang/llvm for this matter:

  make -C /usr/ports/lang/clang install
  make -C /usr/ports/multimedia/x264
  env CFLAGS="-I/usr/local/include -l/usr/local/lib" ./configure --cc=clang \
    --cxx=clang --ld=clang --enable-libx264 --enable-gpl --prefix=$HOME/ff/
  env CFLAGS="-I/usr/local/include -l/usr/local/lib" gmake install

Issues with moov atom:

http://stackoverflow.com/questions/8061798/post-processing-in-ffmpeg-to-move-moov-atom-in-mp4-files-qt-faststart

Proper m3u8 multiplexer https://github.com/johnf/m3u8-segmenter

Very good moov how-to: http://stackoverflow.com/questions/13010530/live-streaming-through-mp4

Error: /usr/bin/ld: /home/rvdzwet/ff/lib/libavformat.a(allformats.o): relocation R_X86_64_32 against `ff_a64_muxer' can not be used when making a shared object; recompile with -fPIC

Make sure to set --enable-pic at your ./configure phase.

Encoding for Android 2.3: https://help.ubuntu.com/community/AndroidVideoEncoding: ffmpeg -i source-video.avi -s 480x320 -vcodec mpeg4 -acodec aac -ac 1 -ar 16000 -r 13 -ab 32000 -aspect 3:2 output-video.mp4

Or heavy lifting: ffmpeg -i source-video.avi -s 432x320 -b 384k -vcodec h264 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -subq 7 -trellis 1 -refs 5 -bf 0 -flags2 +mixed_refs -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -acodec aac output-video.mp4

Encoding for iPhone and iPad: http://stackoverflow.com/questions/12281774/generate-m3u8-file-with-extended-m3u-directives-by-ffmpeg: ffmpeg -i sourcefile.mp4 -vcodec libx264 -acodec libvo_aacenc -b:v 128k -flags -global_header -map 0:0 -map 0:1 -f segment -segment_time 4 -segment_list_size 0 -segment_list testlist.m3u8 -segment_format mpegts stream%05d.ts

Add text: http://einar.slaskete.net/2011/09/05/adding-time-stamp-overlay-to-video-stream-using-ffmpeg/

Using RTMP for Flash: http://wiki.rtmpd.com/tutorial_live_stream_file

1018 sudo yum install openssl-devel lua-devel tinyxml-devel libstdc++-devel 1047 sudo ln -s /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so 1048 env CXX=clang++ CC='clang' cmake .

ay.sh 
#./bin/ffmpeg -y -r 15 -i rtsp://172.17.20.5/live/ch01_0 http://localhost:8090/ijsclub.ffm -movflags frag_keyframe+empty_moov -g 10 output.mp4 -codec png -updatefirst 1 foo.png

#Android or iPad fixed:
#./bin/ffmpeg -y -r 15 -i rtsp://172.17.20.5/live/ch01_0 -movflags faststart+frag_keyframe -g 15 -pix_fmt yuv420p html/test.m4v

URL=rtsp://riff.vanderzwet.net:20554/live/ch01_0
#URL=rtsp://172.17.20.5/live/ch01_0
#./bin/ffmpeg  -y -r 15 -i $URL -vf 'drawtext=fontfile=/usr/share/fonts/ubuntu-font-family-0.80/Ubuntu-M.ttf:fontcolor=black:textfile=title1.txt:box=1:boxcolor=white, drawtext=fontfile=/usr/share/fonts/ubuntu-font-family-0.80/Ubuntu-M.ttf:fontcolor=black:textfile=title1.txt:box=1:boxcolor=white:x=(w-text_w)/2:y=(h-text_h-line_h)/2' http://localhost:8090/ijsclub.ffm #-vcodec libx264  -hls_wrap 10 html/foo.m3u8 -codec png -updatefirst 1 html/poster.png http://localhost:8090/ijsclub.ffm

FILTER='drawtext=fontfile=/usr/share/fonts/ubuntu-font-family-0.80/Ubuntu-M.ttf:fontcolor=black:textfile=title1.txt:box=1:boxcolor=white, drawtext=fontfile=/usr/share/fonts/ubuntu-font-family-0.80/Ubuntu-M.ttf:fontcolor=black:textfile=title1.txt:box=1:boxcolor=white:x=(w-text_w)/2:y=(h-text_h-line_h)/2'

./bin/ffmpeg -y  -i rtsp://riff.vanderzwet.net:20554/live/ch01_0 -vf "$FILTER" -f mpegts - | ./bin/ffmpeg -f mpegts -i - http://localhost:8090/ijsclub.ffm -vcodec libx264  -hls_wrap 10 html/foo.m3u8 -codec png -updatefirst 1 html/ijsclub.png

paid solutions

Open Source

Last modified 12 years ago Last modified on Feb 7, 2013, 9:47:33 PM
Note: See TracWiki for help on using the wiki.