夫婦で働いて猫を養っています。・・・kizifugeru-si☆excite.co.jp 。


by kizifugeru-si
カレンダー
S M T W T F S
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

VP6(flv4)ファイルを変換君で変換

VP6とはOn2 VP6/FLV4と言う最新の動画形式。
そのFLV動画を携帯動画変換君にD&Dしても変換が出来なかった。

それをJavaScriptで可能にするため、調べて、変換君を書き換えて可能にしました。

まず、ffmpegの最新版とpthreadGC2.dllをここに書いてある通りに入手、解凍する。
解凍したら、その最新版のffmpeg.exeとpthreadGC2.dllを携帯動画変換君の「cores」ディレクトリー内にD&Dでコピーする。そして、後でAvisynthを使う関係上、Avisynthが仕様としてVBRの映像音声を上手く読み込んでくれないので携帯動画変換君のディレクトリ内の「cores」フォルダー内の「AVS_Skelton.avs」と言うファイルに以下のような記述を追加して、AvisynthがVBRの映像音声を上手く読み込めるようにする。そうしないと出来たファイルが音ずれを起こしている可能性が高い。

「AVS_Skelton.avs」内の記述に

DirectShowSource~、と書かれている箇所があるがそれを

DirectShowSource("<%InputFile%>", convertfps=true)

と書き換えて、上書きして保存する。

更に(ここが実は肝心なのであるが)3GP_Converter034(現在配布されている携帯動画変換君は解凍すると上記のようなフォルダー名となる)フォルダーの中の「3GP_Converter.ini」内の[Avisynth]行より下に以下の記述を追加する。

Ext9=FLV:\cores\AVS_Skeleton.avs

(数字部分は環境において適時変更)

そうすると携帯動画変換君はAvisynthを通してソースファイルの読み込みを行うようになるのだがこのままでは変換が出来ない。ffmpegに対しての引数の記述方式が携帯動画変換君同梱のffmpegと変わってしまっているらしいのでそれを書き換えてやらないといけない。
そこでdefault_settingフォルダー内にある任意の機種の変換設定iniファイルをその新しいffmpegに対応した記述に書き換えてやらないといけない(-vcodecの前にある、-bitexactというテキストを ffmpegと -y の間に移動&、-b と -abと-maxrateと-bufsize(映像ビットレートと音声ビットレート)の数値にはkを付けないといけない)のだが、それを書き換えてくれるツールを遠慮なくお借りする事にしよう。

任意の機種のiniファイルをテキストエディターとかで開いてすべてコピーし、ここの左側のウインドーにペーストして貼り付け、上にある「バージョンアップ」というボタンをクリックすれば右側のウインドーに最新のffmpegに対応したiniの記述が出てくる。あとはそれをコピーして元のiniファイル上に上書きペーストしてiniを上書き保存すれば、新しいffmpegを使って携帯動画変換君でOn2 VP6/FLV4動画を喰って変換してくれるようになる。

これであのニコニコ動画のflvも怖くは無い、はず・・・・・。

入れ替えたffmpegのバージョンはffmpeg.rev8891と言うバージョン。以下は最新ffmpegに対応するように書き換えたそのini設定

[Info]

Title=機種別設定:3GPPファイル, P903iTV用設定

TitleE=Model: 3GPP, for P902iTV

Description=FOMA P903iTV用の設定です(2005/11/23版)

DescriptionE=for FOMA P903iTV



[Item0]

Title=[MOVIE/AA] QVGA(320x240) 29.97fps Mビ500kbps ステレオ サ48kHz Sビ128kbps

TitleE=QVGA(320x240) 29.97fps 500kbps Stereo 48kHz 128kbps (Not FixAspect)

Command0=""<%AppPath%>\cores\ffmpeg" -bitexact -y -i "<%InputFile%>" -timestamp "<%TimeStamp%>" -vcodec mpeg4 -s 320x240 -r 29.97 -b 500k -acodec aac -ac 2 -ar 48000 -ab 128k -f 3gp "<%TemporaryFile%>.3gp""

Command1=""<%AppPath%>\cores\QT3GPPFlatten" "<%TemporaryFile%>.3gp" "<%OutputFile%>.3gp" -c QT_3GPP(MobileMP4)_QCIF_AAC.ini"

Command2="rm "<%TemporaryFile%>.3gp""



[Item1]

Title=[MOVIE/BB] QVGA(320x240) 15fps Mビ300kbps ステレオ サ44.1kHz Sビ64kbps

TitleE=QVGA(320x240) 15fps 300kbps Stereo 44.1kHz 64kbps (Not FixAspect)

Command0=""<%AppPath%>\cores\ffmpeg" -bitexact -y -i "<%InputFile%>" -timestamp "<%TimeStamp%>" -vcodec mpeg4 -s 320x240 -r 15 -b 300k -acodec aac -ac 2 -ar 44100 -ab 64k -f 3gp "<%TemporaryFile%>.3gp""

Command1=""<%AppPath%>\cores\QT3GPPFlatten" "<%TemporaryFile%>.3gp" "<%OutputFile%>.3gp" -c QT_3GPP(MobileMP4)_QCIF_AAC.ini"

Command2="rm "<%TemporaryFile%>.3gp""



[Item2]

Title=[MOVIE/BC] QVGA(320x240) 15fps Mビ300kbps モノラル サ44.1kHz Sビ64kbps

TitleE=QVGA(320x240) 15fps 300kbps mono 44.1kHz 64kbps (Not FixAspect)

Command0=""<%AppPath%>\cores\ffmpeg" -bitexact -y -i "<%InputFile%>" -timestamp "<%TimeStamp%>" -vcodec mpeg4 -s 320x240 -r 15 -b 300k -acodec aac -ac 1 -ar 44100 -ab 64k -f 3gp "<%TemporaryFile%>.3gp""

Command1=""<%AppPath%>\cores\QT3GPPFlatten" "<%TemporaryFile%>.3gp" "<%OutputFile%>.3gp" -c QT_3GPP(MobileMP4)_QCIF_AAC.ini"

Command2="rm "<%TemporaryFile%>.3gp""



[Item3]

Title=[MOVIE/CB] QVGA(320x240) 15fps Mビ150kbps ステレオ サ44.1kHz Sビ48kbps

TitleE=QVGA 15fps 150kbps mono 44.1k(Not FixAspect)

Command0=""<%AppPath%>\cores\ffmpeg" -bitexact -y -i "<%InputFile%>" -timestamp "<%TimeStamp%>" -vcodec mpeg4 -s 320x240 -r 15 -b 150k -acodec aac -ac 2 -ar 44100 -ab 48k -f 3gp "<%TemporaryFile%>.3gp""

Command1=""<%AppPath%>\cores\QT3GPPFlatten" "<%TemporaryFile%>.3gp" "<%OutputFile%>.3gp" -c QT_3GPP(MobileMP4)_QCIF_AAC.ini"

Command2="rm "<%TemporaryFile%>.3gp""



[Item4]

Title=[MOVIE/CC] QVGA(320x240) 15fps Mビ150kbps モノラル サ44.1kHz Sビ48kbps

TitleE=QVGA 15fps 150kbps mono 44.1k(Not FixAspect)

Command0=""<%AppPath%>\cores\ffmpeg" -bitexact -y -i "<%InputFile%>" -timestamp "<%TimeStamp%>" -vcodec mpeg4 -s 320x240 -r 15 -b 150k -acodec aac -ac 1 -ar 44100 -ab 48k -f 3gp "<%TemporaryFile%>.3gp""

Command1=""<%AppPath%>\cores\QT3GPPFlatten" "<%TemporaryFile%>.3gp" "<%OutputFile%>.3gp" -c QT_3GPP(MobileMP4)_QCIF_AAC.ini"

Command2="rm "<%TemporaryFile%>.3gp""



[Item5]

Title=[MUSIC] 着うた (80kbps/ステレオ) 290KB(D900i以降最大サイズ)

TitleE=Audio-only Audio/80kbps(Stereo) 290KB

Command0=""<%AppPath%>\cores\ffmpeg" -bitexact -y -i "<%InputFile%>" -title "<%Title%>" -fs 290 -timestamp "<%TimeStamp%>" -vn -acodec aac -ac 2 -ar 16000 -ab 40k -f 3gp "<%TemporaryFile%>.3gp""

Command1=""<%AppPath%>\cores\QT3GPPFlatten" "<%TemporaryFile%>.3gp" "<%TemporaryFile%>_2.3gp" -c QT_3GPP(MobileMP4)_QCIF_AAC.ini"

Command2="rm "<%TemporaryFile%>.3gp""

Command3=""<%AppPath%>\cores\ATOMChanger" "<%TemporaryFile%>_2.3gp" "<%OutputFile%>.3gp" "Camouflage_iMotion.ini""

Command4="rm "<%TemporaryFile%>_2.3gp""



[Item6]

Title=[MUSIC] 着うた (80kbps/モノラル) 290KB(D900i以降最大サイズ)

TitleE=Audio-only Audio/80kbps(Stereo) 290KB

Command0=""<%AppPath%>\cores\ffmpeg" -bitexact -y -i "<%InputFile%>" -title "<%Title%>" -fs 290 -timestamp "<%TimeStamp%>" -vn -acodec aac -ac 1 -ar 16000 -ab 40k -f 3gp "<%TemporaryFile%>.3gp""

Command1=""<%AppPath%>\cores\QT3GPPFlatten" "<%TemporaryFile%>.3gp" "<%TemporaryFile%>_2.3gp" -c QT_3GPP(MobileMP4)_QCIF_AAC.ini"

Command2="rm "<%TemporaryFile%>.3gp""

Command3=""<%AppPath%>\cores\ATOMChanger" "<%TemporaryFile%>_2.3gp" "<%OutputFile%>.3gp" "Camouflage_iMotion.ini""

Command4="rm "<%TemporaryFile%>_2.3gp""



[Item7]

Title=[MUSIC] 着うた (80kbps/ステレオ) 490KB/約50秒(D901i以降最大サイズ)

TitleE=Audio-only Audio/80kbps(Stereo) 490KB

Command0=""<%AppPath%>\cores\ffmpeg" -bitexact -y -i "<%InputFile%>" -title "<%Title%>" -fs 490 -timestamp "<%TimeStamp%>" -vn -acodec aac -ac 2 -ar 16000 -ab 40k -f 3gp "<%TemporaryFile%>.3gp""

Command1=""<%AppPath%>\cores\QT3GPPFlatten" "<%TemporaryFile%>.3gp" "<%TemporaryFile%>_2.3gp" -c QT_3GPP(MobileMP4)_QCIF_AAC.ini"

Command2="rm "<%TemporaryFile%>.3gp""

Command3=""<%AppPath%>\cores\ATOMChanger" "<%TemporaryFile%>_2.3gp" "<%OutputFile%>.3gp" "Camouflage_iMotion.ini""

Command4="rm "<%TemporaryFile%>_2.3gp""



[Item8]

Title=[MUSIC] 着うた (80kbps/モノラル) 490KB/約1分40秒(D901i以降最大サイズ)

TitleE=Audio-only Audio/80kbps(Mono) 490KB

Command0=""<%AppPath%>\cores\ffmpeg" -bitexact -y -i "<%InputFile%>" -title "<%Title%>" -fs 490 -timestamp "<%TimeStamp%>" -vn -acodec aac -ac 1 -ar 16000 -ab 40k -f 3gp "<%TemporaryFile%>.3gp""

Command1=""<%AppPath%>\cores\QT3GPPFlatten" "<%TemporaryFile%>.3gp" "<%TemporaryFile%>_2.3gp" -c QT_3GPP(MobileMP4)_QCIF_AAC.ini"

Command2="rm "<%TemporaryFile%>.3gp""

Command3=""<%AppPath%>\cores\ATOMChanger" "<%TemporaryFile%>_2.3gp" "<%OutputFile%>.3gp" "Camouflage_iMotion.ini""

Command4="rm "<%TemporaryFile%>_2.3gp""



[Item9]

Title=[MUSIC] CDクオリティ(128kbps/ステレオ)

TitleE=Audio-only Audio/64kbps(Stereo) 20000KB

Command0=""<%AppPath%>\cores\ffmpeg" -bitexact -y -i "<%InputFile%>" -title "<%Title%>" -timestamp "<%TimeStamp%>" -vn -acodec aac -ac 2 -ar 44100 -ab 128k -f 3gp "<%TemporaryFile%>.3gp""

Command1=""<%AppPath%>\cores\QT3GPPFlatten" "<%TemporaryFile%>.3gp" "<%TemporaryFile%>_2.3gp" -c QT_3GPP(MobileMP4)_QCIF_AAC.ini"

Command2="rm "<%TemporaryFile%>.3gp""

Command3=""<%AppPath%>\cores\ATOMChanger" "<%TemporaryFile%>_2.3gp" "<%OutputFile%>.3gp" "Camouflage_iMotion.ini""

Command4="rm "<%TemporaryFile%>_2.3gp""



これはドコモFOMAの3gp動画限定だがこれで携帯でも完全にニコニコ動画が見られるようになるはず。
by kizifugeru-si | 2007-06-24 09:37 | いつもの