安装swf解码器
sudo apt-get install swfmill
mplayer -dumpfile dump.rm -dumpstream rstp://....
#ipod touch可用 for i in *.rmvb; do mencoder -vf harddup -oac mp3lame -lameopts vbr=3 -ovc xvid -xvidencopts fixed_quant=4 -of avi $i -o `echo $i | sed -e 's/rmvb$/avi/'`; done
for i in *.VOB; do mencoder -oac mp3lame -lameopts aq=7:vbr=2:q=6 -srate 44100 -ovc xvid -xvidencopts fixed_quant=4 -of avi $i -o `echo $i | sed -e 's/VOB$/avi/'`; done
#sudo apt-get install ffmpeg2theora #firefox3.5或chrome直接支持播放,无需安装任何解码器,注意不支持rmvb,rmvb会出现a/v不同步问题 for i in *; do ffmpeg2theora --optimize --deinterlace $i; done
#!/bin/bash for i in *; do mkfifo "/tmp/$i" mencoder -quiet -vf harddup -ovc raw -oac pcm -o "/tmp/$i" "$i" & ffmpeg2theora --optimize --deinterlace "/tmp/$i" -o "`echo $i | sed 's/\(.*\)\..*$/\1/'`.ogv" rm "/tmp/$i" done
#!/bin/bash for i in *; do gst-launch-0.10 filesrc location="$i" ! decodebin name=demux \ { oggmux name=mux ! filesink location="`echo $i | sed 's/\(.*\)\..*$/\1/'`.ogv" } \ { demux. ! queue ! audioconvert ! vorbisenc ! queue ! mux. } \ { demux. ! queue ! ffmpegcolorspace ! videorate ! theoraenc ! mux. } done
#!/bin/bash #ubuntu10.04自带的mencoder由于版权问题,不支持h264编码,需要重新编译;也可以直接参考下面的压缩方法。 #sudo apt-get install mencoder mplayer find . -name '*.avi' -o -name '*.rm' -o -name '*.rmvb' -o -name '*.wmv' -o \ -name '*.vob' -o -name '*.asf' -o -name '*.mpg' -o -name '*.ts' -o \ -name '*.flv' -o -name '*.mpeg' -o -name '*.ogv' -o -name '*.mov' -o \ -name '*.mkv' -o -name '*.dat' | while read i; do basename=`echo $i | sed 's/\(.*\)\..*$/\1/'` font="WenQuanYi Zen Hei" if [ -f "${basename}.srt" ] ; then cp "${basename}.srt" $$.srt m0="-vf scale=480:-10,harddup -sub $$.srt -unicode -subcp GB18030 -subfont-text-scale 3"; else m0="-vf scale=480:-10,harddup"; fi x0="-lavfopts format=mp4 -faacopts mpeg=4:object=2:raw:br=160 -oac faac -ovc x264 -sws 9 -x264encopts nocabac:level_idc=30:bframes=0:global_header:threads=auto:subq=5:frameref=6:partitions=all:trellis=1:chroma_me:me=umh:bitrate=500 -of lavf -ofps 24000/1001"; mencoder $m0 -fontconfig -font "${font}" $x0 -o "$$.mp4" "$i" mv "$$.mp4" "${basename}.mp4" if [ -f "${basename}.mp4" ] ; then rm "$i" fi done
#!/bin/bash #sudo apt-get install faac x264 gpac mplayer mencoder basename=`echo $1 | sed 's/\(.*\)\..*$/\1/'` #获得视频的长宽和帧数 mplayer -vo null -ao null -identify -frames 0 "$1" 2>/dev/null > video.info FPS=`cat video.info | grep ID_VIDEO_FPS | cut -d = -f 2` #FPS=23.976 W=`cat video.info | grep ID_VIDEO_WIDTH | cut -d = -f 2` H=`cat video.info | grep ID_VIDEO_HEIGHT | cut -d = -f 2` WIDTH=480 HEIGHT=`expr $WIDTH \* $H \/ $W` echo $1 FPS=$FPS WIDTH=$WIDTH HEIGHT=$HEIGHT mkfifo audio.wav video.yuv faac -o audio.aac audio.wav & mplayer -ao pcm:file=audio.wav:fast -vc null -vo null "$1" x264 --profile baseline --fps $FPS -o video.264 video.yuv ${WIDTH}x${HEIGHT} & mencoder -vf scale=$WIDTH:$HEIGHT,harddup,pp=fd,format=i420 -nosound -ovc raw -of rawvideo -ofps $FPS -o video.yuv "$1" MP4Box -new -add video.264 -add audio.aac -fps $FPS "$basename.mp4" rm video.info audio.aac video.264 audio.wav video.yuv #使用方法将上面的脚本保存为 x264.sh , x264.sh xxx.avi 来进行转化。
#sudo apt-get install faac x264 gpac mplayer FPS=29.970 mkfifo audio.wav cat VTS_01_1.VOB VTS_02_1.VOB VTS_02_2.VOB VTS_03_1.VOB VTS_04_1.VOB | mplayer -nocorrect-pts -vo null -vc null -ao pcm:file=audio.wav:fast - & faac audio.wav -o audio.aac mkfifo video.y4m cat VTS_01_1.VOB VTS_02_1.VOB VTS_02_2.VOB VTS_03_1.VOB VTS_04_1.VOB | mplayer -vo yuv4mpeg:file=video.y4m -vf scale=480:-3,harddup,pp=fd -nosound - & x264 --profile baseline --muxer mp4 --demuxer y4m video.y4m -o video.mp4 MP4Box -add video.mp4 -add audio.aac -fps $FPS video.mp4
先确保有zenity和memcoder
wget http://linuxfire.com.cn/~lily/toIpod -O ~/.gnome2/nautilus-scripts/toIpod && chmod +x ~/.gnome2/nautilus-scripts/toIpod
在nautilus里对视频文件点右键,选择"脚本"-"toIpod".
详情请查看出处。
#sudo apt-get install ffmpeg ffmpeg -i 矜持.flv -ar 22050 矜持.mp4
-vf lavcdeint
mencoder -ovc lavc 1.rm -oac mp3lame -o 1.avi mencoder -ovc lavc 2.rm -oac mp3lame -o 2.avi mencoder -idx 1.avi -ovc copy -oac copy -o o1.avi mencoder -idx 2.avi -ovc copy -oac copy -o o2.avi cat o1.avi o2.avi | mencoder -noidx -ovc copy -oac copy -o output.avi -
mencoder -ovc copy -oac copy -idx -o 目标文件名 文件名1 文件名2
#sudo apt-get install abcde abcde -o mp3 -b
#sudo apt-get install abcde abcde -o flac -b
#sudo apt-get install flac shntool iconv mac #iconv -f GB2312 -t UTF-8 example.cue -o example_UTF-8.cue #shntool split -t "%n.%p-%t" -f example_UTF-8.cue -o flac example.ape -d flacOutputDir #sudo apt-get install libav-tools ffmpeg -i example.ape example.flac
#sudo apt-get install shntool iconv libav-tools ffmpeg -i CDImage.ape CDImage.flac iconv -f gbk -t utf-8 CDImage.cue | shntool split -t "%n.%p-%t" -o 'cust ext=mp3 lame --quiet - %f' CDImage.flac
for f in *.ape; do gst-launch-0.10 filesrc location="$f" ! decodebin ! audioconvert ! lame vbr=0 bitrate=320 ! id3mux ! filesink location="${f%.ape}.mp3"; done #需要安装 shntool for i in *.ape; do shnconv -i ape -o "cust ext=mp3 lame -b 320 - %f" "$i" -d mp3OutputDir; done
for f in *.ape; do ffmpeg -i "$f" -acodec alac "${f%.ape}.m4a"; done
for f in *.ape; do ffmpeg -i "$f" -acodec aac -strict experimental -ab 256k "${f%.ape}.aac"; done
for i in *.flac; do shnconv -i flac -o "cust ext=mp3 lame -b 320 - %f" "$i" -d mp3OutputDir; done
for i in *.svg; do inkscape $i --export-png=`echo $i | sed -e 's/svg$/png/'`; done
#sudo apt-get install lame mplayer for i in *; do base=${i%.*}; mplayer -quiet -vo null -vc dummy -af volume=0,resample=44100:0:1 -ao pcm:waveheader:file="$i.wav" "$i" ; lame -V0 -h -b 192 -vbr-new "$i.wav" "$base.mp3"; rm -f "$i.wav" ; done
for i in *.jpg; do convert -resize 30%x30% "$i" "sm-$i"; done
for i in *.jpg; do convert $i `echo $i | sed -e 's/jpg$/png/'`; done
convert -size 200x30 xc:transparent -font /usr/share/fonts/truetype/wqy/wqy-microhei.ttc -fill red -pointsize 16 -draw "text 5,15 '测试中文转为图片'" test.png
#sudo apt-get install optipng optipng -o7 old.png new.png #或 sudo apt-get install pngcrush #pngcrush -brute old.png new.png
convert *.jpg out.pdf
sudo apt-get install poppler-utils poppler-data find ./ -name '*.txt' | while read i; do cat $i | awk '{if ($0 ~ "^space:”) {printf “\n”$0} else {printf $0}}’ | sed ‘/^space:*digit:*$/d’ | sed ’s/^space:\+/ /’ | sed ’s/"/”/g’ > “../txt/$i”; done
#sudo apt-get install imagemagick convert -density 196 FILENAME.pdf FILENAME.png
identify -verbose xxx.jpg
mplayer -vo null -ao null -frames 0 -identify "xxx.avi" 2>/dev/null | sed -ne '/^ID_/ { s/[]()|&;<>`'"'"'\\!$" []/\\&/g;p }'
#sudo apt-get install mkvtoolnix mkvinfo -v xxx.mkv