2009年9月19日 星期六
ffmpeg batch converter written in Java!!
import java.io.*;
public class jffmpeg {
public static void main(String args[]) {
System.out.println("原始檔案請放到\"D:\\transcode\"資料夾");
System.out.println("MPEG2將轉檔於\"D:\\transcode\\output\"資料夾");
System.out.println("注意檔案名稱不要留空白!!");
try{
System.out.println("請按Enter繼續;Ctrl-C結束");
System.in.read();
} catch(IOException io)
{
System.out.println("ERROR" + io);
}
File outDir = new File("/work/java/output"); //指定要輸出的目錄
File myDir = new File("/work/java/mpg"); //指定要列出的目錄
if(!outDir.exists()){
System.out.println("\""+outDir+"\"不存在,請建立\""+outDir+"\"資料夾!!");
}else if (!myDir.exists()){
System.out.println("\""+myDir+"\"不存在,請建立\""+myDir+"\"資料夾!!");
}else{
/**
* 刪除目標資料夾下的所有檔案
*/
File[] dellist = outDir.listFiles();
for (int di = 0; di < dellist.length; di++) {
if (dellist[di].isFile()) {
dellist[di].delete();
}
}
try{
String[] list = myDir.list(); //取得目錄中的檔案列表
for(int i=0;i < list.length;i++){
try {
String line;
// String[] cmd = {"mencoder","test.mpg","-ovc","copy","-oac","copy","-o","output.mpg"};
// String[] cmd = {"ffmpeg"};
String[] cmd = {"ffmpeg","-i",myDir+"/"+list[i],"-target","ntsc-dvd",outDir+"/"+list[i]+".mpg"};
System.out.println("開始"+"\""+list[i]+"\""+"的MPEG2編碼...");
Process p = Runtime.getRuntime().exec(cmd);
/* Process p = Runtime.getRuntime().exec
(System.getenv("windir") +"\\system32\\"+"tree.com /A");*/
BufferedReader input =
new BufferedReader
(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
System.out.println(line);
}
input.close();
System.out.println("完成"+"\""+list[i]+"\""+"的MPEG2編碼!!");
}
catch (Exception err) {
err.printStackTrace();
}
}
}catch(Exception e){
System.err.println(e);
}
}
}
}
2009年9月10日 星期四
Compile ffmpeg with x264 manually
DO NOT INSTALL ANY FFMPEG & X264 from REPOS!!
# apt-get install build-essential subversion git-core
(subversion is for fetching ffmpeg source; git is for x264 source)
# 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
(yasm is for building x264)
# git clone git://git.videolan.org/x264.git
# cd x264
# ./configure --enable-shared
# make && make install
(fetch & compile x264 library)
# svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
# cd ffmpeg
# ./configure --enable-gpl --enable-libx264
# make && make install
(fetch & compile ffmpeg with libx264 support)
# mkdir ~/.ffmpeg
# cp ~/ffmpeg/ffpresets/* ~/.ffmpeg
(copy the ffmpeg presets)
# ffmpeg -i infile -vcodec libx264 -vpre hq -b 1M -bt 1M outfile.mp4
(DONE!! You can now encode x264 videos with the presets via -vpre!!)
2009年9月9日 星期三
mplayer、ffmpeg 指令備忘
環境: Fedora 8 with Livna repo
附錄: 解決 Ubuntu 8.04 (Hardy) ffmpeg 無法 AC3 解碼的問題
sudo vi /etc/apt/sources.list
#加入
deb http://packages.medibuntu.org/ hardy free non-freewget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade (更新 ffmpeg 版本)
#擷錄 DVD 音訊內容
mplayer dvd://1 -chapter 1-1 -dumpaudio -dumpfile myfile.ac3#處理 AC3 格式檔案
ffmpeg -f ac3 -i myfile.ac3 -ss 11 -acodec copy cutted_file.ac3
Ref: http://www.hwupgrade.it/forum/showthread.php?t=1106346&page=793
ffmpeg指定in-out點轉檔(-ss,-t)
ffmpeg -i unnamed2-001.vob -ss 00:02:51 -t 00:02:20 -target ntsc-dvd unnamed2-001.mpg
2009年9月8日 星期二
Compile mplayer and x264 for ostube
http://www.chineselinuxuniversity.net/courses/using/introductions/25004.shtml
=========================================================
Basic installation instructions for external Software
=========================================================
-> Create a folder where you store the software archives we want to build and change in there:
mkdir /root/self_build
cd /root/self_build
****************************
-> Now we install at first the jpeg headers and ruby from your repository:
Debian:
apt-get install libjpeg-dev ruby
RedHat/Fedora/CentOS:
Make sure yum is installed. Otherwise you have to use rpm manually.
yum install libjpeg-devel ruby
SuSE:
yast2 -i libjpeg-devel ruby
****************************
-> Get all the software needed using the downloading swissknife 'wget':
1. libmp3lame / libamrwb /libamrnb:
wget http://downloads.sourceforge.net/lame/lame-3.97.tar.gz?modtime=1159107882&big_mirror=0
wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.0.tar.bz2
wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.2.tar.bz2
2. Mplayer:
wget http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc2.tar.bz2
3. Codecs for Mplayer - select the one for your environment (32bit / 64bit)
wget http://www2.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
wget http://www2.mplayerhq.hu/MPlayer/releases/codecs/essential-amd64-20071007.tar.bz2
4. Flvtool2:
wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
****************************
-> Now change directory to /usr/local/lib, decompress the codecs package there and rename the newly created folder to 'codecs':
cd /usr/local/lib
tar xvjf /root/self_build/essential-20071007.tar.bz2
mv essential-20071007 codecs
cd /root/self_build
****************************
-> The first compiling job: we build the lame and amr libraries
tar xzf lame-3.97.tar.gz
tar xvjf amrnb-7.0.0.0.tar.bz2
tar xvjf amrwb-7.0.0.2.tar.bz2
cd lame-3.97
./configure && make && make install
cd ../amrnb-7.0.0.0
./configure && make && make install
cd ../amrwb-7.0.0.2
./configure && make && make install
ldconfig
If there are error messages like 'no suitable compiler found', you have to install some development packages from your repository. You do that just like I described above (jpeg headers and ruby)
- g++ (gcc)
- make
- automake
- autoconf
- patch
- pkgconfig
**************** EDIT ******************
for HD support from version 2.6 on you need x264 libraries as well:
wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20080731-2245.tar.bz2
tar xvjf x264-snapshot-20080731-2245.tar.bz2
cd x264-snapshot-20080731-2245
./configure --enable-shared
make && make install && ldconfig
cd ..
************** END EDIT ***************
* Newer yasm is needed instead of the old one in repo!! DO NOT USE APT!!
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
-> Now Mplayer:
tar xvjf MPlayer-1.0rc2.tar.bz2
cd Mplayer-1.0rc2
./configure
At this point LOOK at the configure output! It will possibly prevent you from later frustrations! Make sure both jpeg output support and libmp3lame (for mencoder) are activated automatically here. If this is not the case, check again if you really installed the jpeg headers and the lame library. Then open the file /etc/ld.so.conf, add the line /usr/local/lib, save the file and execute ldconfig. Now clean up the previously made configuration for Mplayer by executing make distclean and run ./configure again. Now lame and jpeg headers should be found in the system. If so, go ahead with:
make && make install
cd ..
****************************
-> Finally we install Flvtool2:
tar xzf flvtool2-1.0.6.tgz
cd flvtool2-1.0.6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install
cd ..
=========================================================
At this point all software packages urgently needed by osTube is installed
=========================================================
For the paying stuff you really should ask one of our sales manager (markovski@auvica.de or ucke@auvica.de). As far as I know PayPal isn't a problem at all.
But I think base currency for selling osTube is in fact EUR. Meaning you have to calculate the actual exchange rate. But before I tell you stuff that isn't fresh anymore, just ask the sales manager guys. Maybe in the meantime they have a constant price in USD... I don't know.
I hope that was informative.
Regards
-- osTube Entwicklerteam, Karsten
2009年9月6日 星期日
[FFmpeg-user] How to broadcast a video -- in depth ??
> file.
>
> 1) Read over the video file at the very beginning (something like a video
> loading) and obtain two full data streams, namely audio stream and video
> stream. And then simultaneously start broadcasting the audio stream as a
> MIDI and start broadcasting the video stream at a specific frequency (say,
> 30 frames per second). But there seems to be a synchronization problem here.
>
> 2) A video file is normally interleaved by one frame of audio stream and one
> frame of video stream, one after another.... For each frame ( no matter it's
> an audio stream or a video stream), there is a time stamp. It seems no
> matter what types of the video files are, the frames (both audio and video
> together) are interleaved sequentially according to the time stamp sequence.
> So, it might be possible to broadcast according to time sequence. However,
> this will bring me another problem: that is: if this frame is a video frame,
> during this short period of time (if 30 frames per second, 1 frame takes
> 1/30=0.033333 second ), there will be no sound to be broadcasted, which
> makes the audio broadcasting uncontinuous, right????
read both audio and video in a buffer, say 1 sec, then you are able to
process audio and video simultaneously, or that quick after another that
no one will be able to see or hear that there is a gap. If there is a
picture shown to you for 0.033333 second you won't be able to tell what
you've seen.
[FFmpeg-user] DV25 quicktime code
To: FFmpeg user questions and RTFMs
Subject: Re: [FFmpeg-user] DV25 quicktime code
Maksym Veremeyenko wrote:
> Kemal Seref написав(ла):
>> I want to create a quicktime movie, pal DV25, 720x576, 48 khz, 16bit
>> stereo
>> sound.
>>
>> I do not want to use the target pal-dv option to create a dv file. I
>> want a
>> quicktime movie with dv codec.
>>
>> when I use:
>>
>> -i (filename) -acoded pcm_s16le -ar 48000 -s 720x576 -vcodec dvvideo -b
>> 25000 -r 25 -y location & new filename
> I get a movie which doesn't seems to be right. Final Cut gives this message:
> media file is not optimezed for Final Cut Pro.
Ignore this message, FCP complains because audio chunks are not
containing ~= 48000 samples which is completely non efficient.
--
Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer http://www.ffmpeg.org
>
> sometime i had a problem if *vtag* is not defined...
>
> # dvcpro25
> -i (filename) -f mov -vcodec dvvideo -r 25 -acodec pcm_s16be -ac 2
> -pix_fmt yuv411p -vtag dvpp
>
> # dvcpro50
> -i (filename) -f mov -vcodec dvvideo -r 25 -acodec pcm_s16be -ac 2
> -pix_fmt yuv422p -vtag dv5p
>
> # dvcam
> -i (filename) -f mov -vcodec dvvideo -r 25 -acodec pcm_s16be -ac 2
> -pix_fmt yuv420p -vtag dvcp
>
I usually force the audio to avoid issue with odd sample rates, and add
an aspect tag:-
-i infile.fmt -vcodec dvvideo -s 720x576 -aspect 4:3 -pix_fmt yuv420p -r
25 -acodec pcm_s16le -ac 2 -ar 48000 out.mov
I have not had a problem with the 4cc.
--
Tim Nicholson
2009年9月4日 星期五
Understanding the MPEG format
" It was seen in Figure 2.7 that a sinusoidal function is a rotation
resolved in one axis. In order to obtain a purely sinusoidal motion, the
motion on the other axis must be eliminated. Conceptually this may be
achieved by having a contra-rotating system in which there is one
rotation at +w and another at -w. Figure 2.8(a) shows that the sine
components of these two rotations will be in the same phase and will
add, whereas the cosine components will be in anti-phase and will
cancel. Thus all real frequencies actually contain equal amounts of
positive and negative frequencies. These cannot be distinguished unless
a modulation process takes place. Figure 2.8(b) shows that when two
signals of frequency +/-w1 and +/-w2 are multiplied together, the result is
that the rotations of each must be added. The result is four frequencies,
+/-(w1 + w2) and +/-(w1 - w2), one of which is the sum of the input
frequencies and one of which is the difference between them. These
are called sidebands."
The fact is that there is no picture 2.7 in the book, yeeeeheeee !
First of all i don't get this sentence :
"Conceptually this may be
achieved by having a contra-rotating system in which there is one
rotation at +w and another at -w."
Can someone explain me please ?
=>Read up on Fourier analysis...
In yet other words, a real sinusoid has symmetric contributions from
positive and negative freqs:
cos(x) = (exp(ix)+exp(-ix))/2
tovid 的高畫質DVD(8M)轉檔指令
2009年8月30日 星期日
如何播放xvid 檔案~3ivx
http://3ivx.com/download/windows.html
很多影片目前都以xvid格式的檔案在網路上流行,如何播放.xvid檔案?
到這裡http://www.3ivx.com/download/windows.html
下載 3ivx 解碼外掛..
安裝後,Windows Media player 就可以播放xvid檔案了
Convert multiple videos at once with FFMPEG
#!/bin/sh
for file in *.avi
do
ffmpeg -i "$file" converted_"$file"
done
converts video to flv with metadata
From: cherrilyn pala a <angel_page123@yahoo.com>
Subject: Re: [FFmpeg-user] I lose the information of the video after
converted
To: FFmpeg user questions and RTFMs <ffmpeg-user@mplayerhq.hu>
Message-ID: <834420.97556.qm@web76710.mail.sg1.yahoo.com>
Content-Type: text/plain; charset=iso-8859-1
hi Juan,
try installed flvtool2 in your server then use this command:
ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320?240 - | flvtool2 -U stdin video.flv
this converts video to flv with metadata. i have tried this and it works well
Cherrilyn
2009年8月10日 星期一
先教Server學轉片吧
要搞個自家YouTube伺服器,第一個難關就是如何讓Server有能力去轉片。參考Luar的英文Blog,總算找到了安裝各種套件的方法了。
正如前面文章提 到,要讓Linux伺服器會轉FLV影片,要安裝4個套件,它們依次是LAME、ffmpeg、Ruby和FLVTool2。另外,由於用ffmpeg轉 片只會忠實地按照您指定的尺寸來縮放影片,用轉4:3影片的尺寸來轉16:9影片會令完成影片變成,為了日後檔案上傳後可透過PHP自動檢查影片的尺寸來 進行轉換工作,所以還要裝個PHP的擴充ffmpeg-php。而由於我們的特別需求,所以都不能用RPM方式來安裝,全都要耐心地去編譯。
LAME
LAME是用來將聲音壓成MP3格式的,是相當有名的壓MP3套件。先到LAME的官網去下載最新的LAME,依下面的指令來解開安裝它。其中最重要的是--enable-shared一段,因為只有那樣ffmpeg才能用得到它的功能。
tar -zxvf lame-3.97.tar.gz
cd lame-3.97
./configure --enable-shared -prefix=/usr
make
make install
ffmpeg
ffmpeg是著名的轉片套件,所附的libavcodec涵蓋大部分影片格式,轉FLV也可以。不過由於它也有不少FLV轉換軟件也有的共通問題,所以稍後還要安裝FLVTools來修正。
ffmpeg表明它是一個「永遠也是開發中的專案」,總是不停在更新,所以沒有一個官方的Binary檔可以下載來安裝,連源碼也要透過Subversion來取得最新版本。大多數Linux版本相信都已經預設安裝了SVN了吧。
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk /usr/local/src/ffmpeg
cd /usr/local/src/ffmpeg
./configure --enable-gpl --enable-libmp3lame --enable-shared --prefix=/usr
make clean && make
make install
當然,安裝ffmpeg時可以有很多很多很多很多插件和參數供您加上去,以安裝出一個更加萬能的轉片工具,不過因為真的太多太多太多,一版紙也寫不完,所以如何您要裝的話就自己到網上查看好了。
Ruby
花 了好長時間編譯ffmpeg之後,就要著手修正不正確儲存FLV metadata的問題了。FLVTool2可以做到這項工作,不過它是用Ruby來寫的,所以要先安裝Ruby。Ruby是由一位日本人松本行弘開發出 來的,是個徹底至極的OO語言,不過由於太新不夠普及,不是所有Linux分發版本都預設安裝這種程式語言的編譯程式,所以又要去官網下載源碼來安裝。
tar -zxvf ruby-1.8.5-p12.tar.gz
cd ruby-1.8.5-p12
./configure
make
make install
FLVTool2
FLVTool2是一個用來編輯FLV檔的套件,透過它來儲存FLV檔,就可以保證FLV檔裡有正確的metadata了。FLVTool2的最新版本放了在RubyForge網站,下載回來就可以安裝。
gunzip flvtool2-1.0.6.tgz
tar -xvf flvtool2-1.0.6.tar
cd flvtool2-1.0.6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install
到這裡,有關轉片方面的安裝便大功告成。那應該怎麼用ffmpeg來轉換影片至FLV檔呢?在Luar的網站雖然也有一些參考指令,不過不知怎的米奇總是用得不順手,於是就參考一下同是使用ffmpeg來轉片的攜帶動畫轉換君3GP Converter的做法。
將影片轉換為FLV檔
ffmpeg -y -i [來源檔路徑] -f flv -s [目的影片寬度]x[目的影片高度] -r [目的frame rate] -b [目的bitrate] -acodec mp3 -ar 22050 -ab 48 -ac 2 - | flvtool2 -U stdin [目的檔檔名]
目的檔的寬度和高度可以自訂,不過要小心會變形。一般來說320x240是4:3,320x180則是 16:9。目的frame rate一般都離不開8/10/14.985/15/23.976/24/25/29.97/30的,網上播片的話14.985便夠了。至於 bitrate就要看您的伺服器的流量和您自己的要求了,米奇的Demo網站用的是512000(512kbps),雖然幾乎沒起格,但檔案就頗大(186秒12.1MB),用384000(384kbps)已經有不錯的效果。至於聲音參數方面,由於FLV格式有一點要求,所以還是不要動好了。
從影片擷取小圖示
或許您會需要一張小圖示來代表那影片,ffmpeg也可以用來擷取這張圖示。
ffmpeg -y -i [來源路徑] -f image2 -ss [擷取影格的秒數] -vframes 1 -s [圖示寬度]x[圖示高度] -an [圖示檔檔名]
擷取影格的秒數可以是小數後3位的小數,也接受00:00:00.xxx格式。圖檔名方面JPG/GIF/PNG都接受。
ffmpeg-php
為了讓PHP取得影片的資料,要安裝ffmpeg-php擴充插件。先到這裡下載ffmpeg-php回來編譯:
bunzip2 ffmpeg-php-0.5.0.tbz2
tar -xvf ffmpeg-php-0.5.0.tar
cd ffmpeg-php-0.5.0
phpize
./configure && make
make install
編譯完成後就可以製作出一個ffmpeg.so的檔案。然後就要去設定PHP,讓它載入這個擴充插件了。首先用筆記簿開一個新的純文字檔案,輸入以下兩行:
; Enable ffmpeg-php extension module
extension=ffmpeg.so
將檔案命名為ffmpeg.ini儲存起來,然後上傳到/etc/php.d/目錄裡,重新啟動Apache之後,PHP就會自動載入它。您可以透過phpinfo()函式來查看ffmpeg-php有沒有正確載入。
2009年8月9日 星期日
用 ffmpeg 製作 h.264 影片
基本上 ffmpeg 能認得很多影音的 container 及 codec,所以大部份的影片餵給他吃應
該都可以認得。
ffmpeg -i inputfile -vcodec libx264 outputfile.mp4
以上是簡單把影片轉成 h.264 影片的指令,inputfile可是以各種類的影音檔,然後
-vcodec 是選擇想用的 video encoder,這裡是選擇 libx264 來製作 h.264 的壓縮,然
後 outputfile.mp4 就是最後要輸出的檔案,在 ffmpeg 之中副檔名為 .mp4 時,預設的
video coder 是 mpeg-4 而 audio codec 是 aac,這裡只指定 video codec 為
libx264 的話,聲音則為 aac。
Windows下的ffmpeg用法
http://worldtv.com/blog/guides_tutorials/flv_converter.php
ffmpeg 是很方便的轉檔工具,麻雀雖小五藏俱全!
今天來介紹一下ffmpeg在Windows系統下加上圖形介面的用法。
下載 ffmpeg 轉檔程式
下載 avanti 圖形介面
以 7zip 解壓縮, 會有分別會有 ffmpeg 資料夾和 avanti 資料夾(實際上資料夾名稱會
加上版本編號)
將ffmpeg 資料夾內三個檔案複製到 avanti\ffmpeg 底下,這樣開啟 avanti 圖形介面時
就能夠以 ffmpeg後端程式進行轉檔囉!
接著執行 Avanti-GUI.exe,
從 Source 1 或是 Source 2加入檔案,設定Destination輸出檔案
接著設定輸出檔案格式,有Audio Setting 和 Video Setting,根據自己的需要設定吧
!
設定好之後點 Start process 即可轉檔。
---
FLV Converter - A Layman's Guide to Flash Video Conversion
FLV ConverterIf like me you have spent hours trying to find a simple and free
FLV file converter, then you've probably pulled out most of your hair
already.
The Internet is littered with products that claim to convert FLV files for
free, but invariably come with nasty surprises attached, or insist you pay up
for something that you probably feel you shouldn't. Why can't there be a
simple free FLV converter?...
tovid - a collection of GPL video disc authoring tools
http://txt2tags.sourceforge.net/ (Required by tovid)
tovid is a collection of GPL video disc authoring tools; it can help you
create your own DVDs, VCDs, and SVCDs for playback on your home DVD player.
MythVideo: Managing Your Videos
537105321&coll=portal&dl=ACM&CFID=931308&CFTOKEN=98734541
MythVideo: Managing Your Videos
Michael J. Hammel
Abstract
Managing your videos has gotten a little easier with MythVideo, but it helps
knowing a few expert tricks.
MythVideo is a video management plugin for the open-source personal video
recorder (PVR) system known as MythTV. Its primary purpose is to help
organize digital videos that are saved on a MythTV back-end server for
display on front-end client systems. The most common use of MythVideo is to
create a personal digital archive of videos ripped from DVDs.
Multimedia tools on OpenBSD
CVS/ ffmpeg2theora/ libquicktime/ streamdvd/ xine-ui/
Makefile gstreamer-0.10/ libtheora/ subrip/ xvidcore/
avidemux/ kaffeine/ lsdvd/ subtitleripper/
dvdauthor/ libdv/ mjpegtools/ transcode/
dvdbackup/ libdvdnav/ mkvtoolnix/ x264/
dvdcpy/ libmatroska/ ogmtools/ xine-lib/
[transcode for xvid]
transcode -i myfile.avi -o xvid.avi -y xvid
[ffmpeg for mpeg]
ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
ffmpeg -i myfile.avi -target dvd /tmp/dvd.mpg
ffmpeg -i dvd.mpg -target pal-vcd pal.mpg
[ffmpeg for flv]
install ruby & flvtool2 (manually from rubyforge) first
(http://rubyforge.org/projects/flvtool2/)
ffmpeg -y -i myfile.avi -f flv -s 320x240 -r 14.985 -b 384000 -acodec mp3
-ar 22050 -ab 48 -ac 2 - | flvtool2 -U stdin output.flv
目的檔的寬度和高度可以自訂,不過要小心會變形。一般來說320x240是4:3,320x180則
是16:9。目的frame rate一般都離不開8/10/14.985/15/23.976/24/25/29.97/30的,網上
播片的話14.985便夠了。至於 bitrate就要看您的伺服器的流量和您自己的要求了,米奇
的Demo網站用的是512000(512kbps),雖然幾乎沒起格,但檔案就頗大(186秒12.1MB),用
384000(384kbps)已經有不錯的效果。至於聲音參數方面,由於FLV格式有一點要求,所以
還是不要動好了。
Merging audio file and video file using ffmpeg
ffmpeg -i input.avi -i input.wav -vcodec copy -acodec copy output.avi
Linux video converter is now available!
: http://rudd-o.com/en/linux-and-free-software/linux-video-converter-is-now-av\
ailable
: Now you can convert your videos in Linux, in the easiest and most
: straightforward way.
: Linux video converter is now available
: This is what video conversion should look like
: True to its flexible and capable roots, Linux has a ton of ways to convert
: videos, with multiple competing projects all featuring astounding
: capabilities.
: Regrettably, they all are either command-line programs or very, very
: complicated applications with a myriad of options that no regular user
: understands how to operate. No one ever bothered to create a simple
: application that lets users quickly convert videos from one format to
: another.
: Up until today.
: So here it is, Linux video converter, for your personal benefit. Use it,
: smash it, it's free software and it's for you to use and enjoy.
: I do have one request: at the moment, the app is limited to the target format
: of YouTube, so please use the bug tracker to post requests for formats you'd
: like to see -- and if you can spare the extra time, details of what settings
: to use in the transcoding process.
java調用
用java程序調用ffmpeg執行視頻文件格式轉換flv
作者: 發布時間:2007-7-3 8:04:32 | 【字體:大 中 小】
用java小例題說明更直觀:(可以直接編譯運行)
環境我在windows平台下測試的。。。
需要在e:\下有ffmpeg.exe;mencoder.exe;drv43260.dll;pncrt.dll共4個文件。
如何得到這4個文件參考文章http://blog.sina.com.cn/u/4a424eca010005kb
還要在e:\input下放各種文件名為a的以下各種視頻文件;還要e:\output;java程序執行
后能得到一個a.flv的已轉換的文件。
ffmpeg.exe能解析的格式:(asx,asf,mpg,wmv,3gp,mp4,mov,avi,flv等)
對ffmpeg.exe無法解析的文件格式(wmv9,rm,rmvb等),
可以先用別的工具(mencoder)轉換為avi(ffmpeg能解析的)格式;
mencoder.exe;drv43260.dll;pncrt.dll這3個文件是為文件格式(wmv9,rm,rmvb等)
轉換為avi(ffmpeg能解析的)格式准備的;再把轉換好的avi文件再用ffmpeg.exe轉換成
flv格式的視頻文件...
java文件的內容如下:
Fuoco Tools - super video GUI on Ubuntu
Fuoco Tools
Video promo http://www.youtube.com/watch?v=YtFWdlphAs8 or
http://www.youtube.com/watch?v=S75pGGAI1c8
-for problems you can find more here :
http://fuocotools.byethost13.com/index.php?board=4.0
don't use CONFIGURATOR if you have medibuntun repo on..
.CONVERTER DVDWZARD AND IMAGES2MPG SHOULD WORK FINE!!!
What is Fuoco tools?
Fuoco tools is born from The same ideas of ConvertIT, so is mainly a
converter,but i have added some features, like Dvdwizard and Images2mpg plug
in. I thinked to Fuoco like a faster way to learn mencoder , ffmpeg and
company (basic learning)
Editing function with interface
You can edit , delete or ADD fuction with this interface how you can see here
To load a fuctioon double click on the commandline
sometime it can happend commanline is not modified as you want, be carefull
when you modify commandline with special characters if you have some problem
you can edit one file as you can see below
Editing function without interface
you can manage your function wiht a text editor with this
Code:
nano $HOME/.fuoco/treestore.txt
Fuoco has a button to open your prefered text editoryou can choose
gedit or kate or nano (gnome or kde)
a little example :
Code:
YouTube?To DOWNLOAD?FLV to AVI Tag Download and convert!example avi
conversion?youtube-dl INPUT -o 'OUTDIR/NUMBEROFTHEFILE.flv' ; mencoder
'OUTDIR/NUMBEROFTHEFILE.flv' -ofps 25 -ovc xvid -oac mp3lame -lameopts
abr:br=192 -srate 48000 -xvidencopts fixed_quant=4 -o
'OUTDIR/NUMBEROFTHEFILE.avi'
?= is a separator so we have
YouTube= cathegory
TO DOWNLOAD = subcathegory
FLV to AVI =kind of conversion
Download and convert!example avi conversion =tag
youtube-dl INPUT -o 'OUTDIR/NUMBEROFTHEFILE.flv' ; mencoder
'OUTDIR/NUMBEROFTHEFILE.flv' -ofps 25 -ovc xvid -oac mp3lame -lameopts
abr:br=192 -srate 48000 -xvidencopts fixed_quant=4 -o
'OUTDIR/NUMBEROFTHEFILE.avi'= commandline
note the command line
Code:
outube-dl etc etc ; mencoder etc etc
if you put ; that command wil be used for every file in your list fist
youtube and then mencoder
instead if i put
Code:
youtube etc etc ENDLOOP mencoder etc etc
This will execute youtube-dl for every files in your list AND THEN only 1
time mencoder etc etc
INSTALLATION
If you have not medibuntu repo turned on you can use configurator (First
loading and documentation)
FFMPEG合併轉檔程式 for Windows
將這個資料夾拷貝到Windows本機硬碟,資料夾中共有三個檔案,主要執行檔是
ffmpeg.exe。指令如下,即可將影音素材合併且轉檔為Vegas 7可以直接剪輯的
MPEG2(video: mpeg2video; audio: ac3)。
ffmpeg -i input.avi -i input.wav -target dvd output.mpg
其中,input.avi與input.wav為放在同一資料夾的影音檔案,可以換成絕對路徑指向
別的資料夾(最好用英文名稱並且沒有空格);output.mpg即為合併輸出之MPEG2檔案,預
設bitrate為6Mb/s。如果要改成MPEG2的極限 bitrate=8Mb/s,要加入bitrate參數
(-b單位為bit)如下。
ffmpeg -i input.avi -i input.wav -target dvd -b 8000000 output.mpg
如果要大量轉檔,可以將上述指令包在BATCH或VBscripts內,讀取檔案列表並用do loop
去循環執行之。或寫BASH指令稿來跑,但這樣就需要額外安裝一些Linux模擬程式在
Windows上,比較繁瑣些。
ffmpeg flv & sync tips (LXF 119)
$ ffmpeg -i xxx.mpg -ar 22050 -acodec libmp3lame -ab 32K -r 25 -s 320x240
-vcodec flv xxx.flv
<4:3>
$ ffmpeg -i xxx.mpg -croptop 30 -cropbottom 30 -padtop 30 -padbottom
=padcp;pr 000000 -target ntsc-dvd ntsc.mpg
$ ffmpeg -i break.flv -vcodec mpeg2video break.m2v -acodec copy break.mp3
$ ffmpeg -i break.mp3 -itsoffset 00:00:10.2 -i break.m2v output.flv
$ ffmpeg -i break.m2v -itsoffset 00:00:00.3 -i break.mp3 output.flv
Cinelerra - linux video editing
Cinelerra is the most advanced non-linear video editor and compositor for
Linux. It is developed by Adam Williams (formerly known as Jack Crossfire) at
Heroine Virtual Ltd..
To know more see the official Cinelerra home page and the SourceForge project
page.
Cinelerra's source code is available under the GNU General Public License
(GPL).
However, unlike most large Free Open Source projects, the development of
Cinelerra is not open to distributed collaboration and there is no support
for the software.
Cinelerra is tested on Fedora. Cinelerra4 is available also as Ubuntu
packages.
[Ffmpeg-user] it's possible to merge 2 file video
ffmpeg does not support appending of videos natively. On Unix or Linux
or MSys you can use something like (untested!)
cat utc_1434.mpg utc_1800.mpg | ffmpeg -i - -acodec copy -vcodec copy
jef2.mpg
(concatenates and remux).
On WXP you could use "copy a.mpg/b+b.mpg/b c.mpg/b" then remux with ffmpeg.
p.s. ffmpeg -i jef2.mpg -target ntsc-vcd jef2vcd.mpg is still needed to remux!!