From 0f4a047f7d3c6ba50935bfa77d1b2882ede9b5da Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sun, 4 Aug 2013 18:28:34 +0200 Subject: [PATCH] tc-video-custom: improved multifile support, added comments on concat --- .scripts/.tc-video-custom.in | 61 +++++++++++++++++++++++++----------- .scripts/tc-video-custom | 10 ++++-- 2 files changed, 50 insertions(+), 21 deletions(-) diff --git a/.scripts/.tc-video-custom.in b/.scripts/.tc-video-custom.in index ff8e6f66..40e14e8e 100644 --- a/.scripts/.tc-video-custom.in +++ b/.scripts/.tc-video-custom.in @@ -64,14 +64,11 @@ _transcode ###FILELIST ## Or one after another. # while read -r i; do # _transcode "$i" -# done<). ## quality*size ~= 1/speed ## ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo ## @@ -117,9 +125,26 @@ _transcode ###FILELIST ## Possible values: hex, umh... ## me=umh is default. ## -## WARNING: you should consider mixing down audio to 2 channels with '-ac -## 2'. This greatly reduce file size and avoid any confusion for playback, which -## is often the case when converting DTS to any other format because DTS has -## embedded channel description which is not available in other formats. ## ################################################################################ + +################################################################################ +## FALLACIOUS INPUT +## +## In general, FFmpeg is not so good at copying fallacious streams. Specifying +## video and audio encoding helps. +## +## "Can't write packet with unknown timestamp" +## => Put '-fflags genpts' before the input command. +################################################################################ + +################################################################################ +## MISC +## To check what fmmpeg supports: +## $ ffmpeg -codecs +## $ ffmpeg -formats +## +## Useful guides: +## x264: http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide +## ID3 details: http://en.wikipedia.org/wiki/ID3 +################################################################################ diff --git a/.scripts/tc-video-custom b/.scripts/tc-video-custom index 14bfd9f8..e9235fce 100755 --- a/.scripts/tc-video-custom +++ b/.scripts/tc-video-custom @@ -29,8 +29,6 @@ fi for i ; do REAL="$(realpath "$i")" FILELIST="${FILELIST:+$FILELIST }'$REAL'" - FILELINES="${FILELINES:+$FILELINES -}$REAL" done SCRIPT_PATH="${0%/*}" @@ -38,8 +36,14 @@ SCRIPT_NAME="${0##*/}" OUTPUT_NAME="tc-video" if [ -f "$SCRIPT_PATH/.$SCRIPT_NAME.in" ]; then cp -i "$SCRIPT_PATH/.$SCRIPT_NAME.in" "$OUTPUT_NAME" + # echo "$FILELIST" + # echo "$FILELINES" sed -i 's|###FILELIST|'"$FILELIST"'|' "$OUTPUT_NAME" - sed -i 's|###FILELINES|'"$FILELINES"'|' "$OUTPUT_NAME" + for i ; do + REAL="$(realpath "$i")" + sed -i "s|# FILELINES|# $REAL\n# FILELINES|" "$OUTPUT_NAME" + done + sed -i "s|###FILELINES||" "$OUTPUT_NAME" chmod +x "$OUTPUT_NAME" else echo ".$SCRIPT_NAME.in not found!"