mediatombで使ってるtranscoding用スクリプト、Webで探したりもしてたけど、結局Debianのmediatomb-commonパッケージのexamplesに入ってたやつを利用中。
ということで製作者じゃないわけで、作者名が載ってないので公開していいのか判断に悩んだけど、とりあえず貼ってみる。
1 <div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$ more mediatomb-transcode</div>
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 $ more mediatomb-transcode#!/bin/sh# This script is used by MediaTomb for transcoding support.# Basic function that will transcode any input file into the target type# 'dvd' ffmpeg supportsvideo_common() {local input="$1"local output="$2"ffmpeg -i "$input" -target dvd -y "$output"}# Basic function that will transcode any input file into the wav formataudio_common() {local input="$1"local output="$2"ffmpeg -i "$input" -f wav -y "$output"}# Function to transcode matroska files to dvd compatible formattranscode_matroska() {local input="$1"local output="$2"local alang="$3"local slang="$4"# Default to english if languages are not set[ "$alang" ] || alang="eng"[ "$slang" ] || slang="eng"# Use mencoder if available, else fall back to using ffmpeg.# Transcoding using ffmpeg will not include subtitles.if which mencoder >/dev/null 2>&1; thenmencoder "$input" -oac lavc -ovc lavc -of mpeg -mc 0 -noskip \-lavcopts vcodec=mpeg2video:vbitrate=6000:acodec=ac3:abitrate=448 \-vf harddup -alang "$alang" \-slang "$slang" -font 'Bitstream Vera Sans' \-o "$output"elseffmpeg -alang "$alang" -slang "$slang" -i "$input" -target dvd \-y "$output"fi}# Our "main" function below.USAGE="This script is used by MediaTomb for transcoding support. It can also serve asa script to transcode various files in a format suitable for streaming directly.Synopsis:mediatomb-transcode [TRANSCODE FUNCTION OPTION] [GENERIC OPTIONS]Generic Options:-h, --help Display this help message.-i, --input Input file that is meant to be transcoded.-o, --output Output file that will be read back by MediaTomb.--audio-lang Specify ISO 639 language code to use for audio.--subtitle-lang Specify ISO 639 language code to use for subtitles.Transcode Function Options (one is required):--video-common Perform generic video transcoding.--audio-common Perform generic audio transcoding.--transcode-matroska Used in transcoding matroska files."while [ "$#" -gt "0" ]docase "$1" in-i|--input)INPUT="$2"shift; shift;;;-o|--output)OUTPUT="$2"shift; shift;;;--video-common)USE_VIDEO_COMMON=1shift;;--audio-common)USE_AUDIO_COMMON=1shift;;--transcode-matroska)USE_TRANSCODE_MATROSKA=1shift;;--audio-lang)ALANG="$2"shift; shift;;;--subtitle-lang)SLANG="$2"shift; shift;;;-h|--help|*)echo "${USAGE}"exit 1;;esacdone# Perform specified functionif [ $USE_VIDEO_COMMON ]; thenvideo_common "$INPUT" "$OUTPUT"elif [ $USE_AUDIO_COMMON ]; thenaudio_common "$INPUT" "$OUTPUT"elif [ $USE_TRANSCODE_MATROSKA ]; thentranscode_matroska "$INPUT" "$OUTPUT" "$ALANG" "$SLANG"else# Must specify one transcoding functionecho "${USAGE}"exit 1fi
てかね、手元の動画は基本x.264/aacでmp4かxvid/mp3なaviにしてるからあんまり関係ないんだけど。なんか修正したほうがいいとことかあれば、てぃーち・みー。
よく見られているヤーツ:
- ギシャルアクス+2(ペット被物理ダメ-10%)、完成(実は二本目)
- 私見による風水士の立ち回りとか
- ボヤーダ樹のGoVをお試し(微修正)
- 学者の装備をあれこれやってるのが今はとても楽しいのです。
- なんとなくIS04を初期化、再設定(画像ありません)
似てるヤーツ:
- JavaScriptでフォーム全体からチェックボックスだけ全選択/全解除処理 (2015/10/29 13:47)
- 自宅のDVDを一括で動画ファイルに (2010/09/22 13:49)
- ffmpegのとりあえず (2009/10/30 14:09)
- EUC-JPからUTF-8に変更したりして (2009/10/25 00:33)
- なんとなくmediatomb (2009/06/29 18:53)