Ranger: OGG info.

Shell: trancoding functions ++.
master
Pierre Neidhardt 2013-01-19 20:01:49 +01:00
parent 709698d92c
commit 95b13d1a13
2 changed files with 38 additions and 24 deletions

View File

@ -47,6 +47,9 @@ case "$extension" in
success && exit 0 || exit 1;;
# CUSTOM
ogg)
mediainfo "$path" | sed 's/ \+:/: /;'
success && exit 5 || exit 1;;
# MKV videos:
mkv)
mediainfo "$path" | sed 's/ \+:/: /;'

View File

@ -3,11 +3,12 @@
## Shell -- Trancode function set.
## Date 2013-01-19
################################################################################
## Tool list: ffmpeg, recode
## Useful guide:
# http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide
################################################################################
## Text
@ -73,26 +74,11 @@ tc_text_2utf8 ()
## TODO: option to replace original file.
## TODO: handle srt encoding.
## TODO: Chapters
## TODO: work with -threads option.
## TODO: crop options.
## TODO: audio copy if AAC or OGG.
## High in Handbrake:
# b-adapt=2:rc-lookahead=50:me=umh
## Mine in Handbrake:
# ref=1:weightp=1:subq=2:rc-lookahead=10:trellis=0:8x8dct=0
## Mine with details:
# cabac=1:ref=1:deblock=1:0:0:analyse=0x1:0x111:me=hex:subme=2:psy=1:psy_rd=1.00:0.00:mixed_ref=0:me_range=16:chroma_me=1:trellis=0:8x8dct=0:cqm=0:deadzone=21,11:fast_pskip=1:chroma_qp_offset=0:threads=6:sliced_threads=0:nr=0:decimate=1:interlaced=0:bluray_compat=0:constrained_intra=0:bframes=3:b_pyramid=2:b_adapt=1:b_bias=0:direct=1:weightb=1:open_gop=0:weightp=1:keyint=240:keyint_min=24:scenecut=40:intra_refresh=0:rc_lookahead=10:rc=crf:mbtree=1:crf=20.0:qcomp=0.60:qpmin=3:qpmax=69:qpstep=4:ip_ratio=1.40:aq=1:1.00
## Mine diff with default:
# ref=1:analyse=0x1:0x111:me=hex:subme=2:trellis=0:8x8dct=0:chroma_qp_offset=0:b_adapt=1:direct=1:weightp=1:keyint=240:rc_lookahead=10
## Best for bad quality movies.
# me=hex
## Vars
TC_AUDIO_QUAL=192k
TC_OUTDIR="$HOME/temp"
@ -108,7 +94,7 @@ TC_VIDEO_PRESET=slow
## Overall quality. Logarithmic scale.
# 18 is near perfection.
# 22 is really good compression, while a bit more blurry than original.
# 22 is really good compression, while a bit more blurry than the original.
# 20 is a good compromise.
TC_VIDEO_QUAL=20
@ -121,14 +107,15 @@ TC_VIDEO_TUNE="film"
# me=umh is default. Possible values: hex, umh...
TC_VIDEO_OPTS="me=umh"
tc_mux()
tc_demux_audio()
{
echo "void"
ffmpeg $TC_OVERWRITE -i "$1" -c:a copy
}
tc_demux()
tc_audio()
{
ffmpeg -y -i "$1" -c:a copy
echo "================================================================================"
ffmpeg -threads 4 $TC_OVERWRITE -i "$1" -vn -c:a libvorbis -b:a $TC_AUDIO_QUAL "${1%.*}-$(date "+%F-%H%M%S").ogg"
}
tc_transcode()
@ -137,7 +124,31 @@ tc_transcode()
ffmpeg $TC_OVERWRITE -i "$1" \
-c:v libx264 -preset $TC_VIDEO_PRESET -crf $TC_VIDEO_QUAL -tune $TC_VIDEO_TUNE -x264opts $TC_VIDEO_OPTS \
-c:a libvorbis -b:a $TC_AUDIO_QUAL \
"${1%.*}-$(date "+%F-%H%M%S").mkv"
-c:s copy \
-map 0 "${1%.*}-$(date "+%F-%H%M%S").mkv"
}
# tc_mux()
# {
# ffmpeg -y -i "$1" -i "$2" -metadata:s:a:1 language=fre -c:v copy -c:a copy -map 0 -map 1 "final.mkv"
# }
################################################################################
## OLD
## High in Handbrake:
# b-adapt=2:rc-lookahead=50:me=umh
## Mine in Handbrake:
# ref=1:weightp=1:subq=2:rc-lookahead=10:trellis=0:8x8dct=0
## Mine with details:
# cabac=1:ref=1:deblock=1:0:0:analyse=0x1:0x111:me=hex:subme=2:psy=1:psy_rd=1.00:0.00:mixed_ref=0:me_range=16:chroma_me=1:trellis=0:8x8dct=0:cqm=0:deadzone=21,11:fast_pskip=1:chroma_qp_offset=0:threads=6:sliced_threads=0:nr=0:decimate=1:interlaced=0:bluray_compat=0:constrained_intra=0:bframes=3:b_pyramid=2:b_adapt=1:b_bias=0:direct=1:weightb=1:open_gop=0:weightp=1:keyint=240:keyint_min=24:scenecut=40:intra_refresh=0:rc_lookahead=10:rc=crf:mbtree=1:crf=20.0:qcomp=0.60:qpmin=3:qpmax=69:qpstep=4:ip_ratio=1.40:aq=1:1.00
## Mine diff with default:
# ref=1:analyse=0x1:0x111:me=hex:subme=2:trellis=0:8x8dct=0:chroma_qp_offset=0:b_adapt=1:direct=1:weightp=1:keyint=240:rc_lookahead=10
## Best for bad quality movies.
# me=hex