Fix bufsize
Enhance readme
This commit is contained in:
1 parent
00cffa7b06
commit
040f6caab3
4 files changed
+10
-7
No files matched your search
@@ -37,7 +37,7 @@ Mail(){ # 1:kind(0:done, 1:wrong type, 2:encoding error) 2:logline I:email,name,
|
||||
# Rename upload and check type
|
||||
file=${upload%.upload} video=$file.mp4 name=${file##*/} key=${name%%.*}
|
||||
rest=${name#*.} date=${rest:0:15} _=${rest:15} email=${_%@*}
|
||||
# If email embedded, strip the '='
|
||||
# If email embedded, strip the '_'
|
||||
[[ $email ]] && email=${email:1}
|
||||
/usr/bin/mv "$upload" "$file"
|
||||
|
||||
@@ -45,15 +45,15 @@ type=$(file -bL --mime-type "$file")
|
||||
[[ ! ${type:0:5} = video ]] && Mail 1 "File $name is of type $type"
|
||||
|
||||
# Encode video
|
||||
start=$(date +'%Y-%m-%d at %H:%M') error=0
|
||||
start=$(date +'%Y-%m-%d at %H:%M:%S') error=0
|
||||
## Single pass
|
||||
#/usr/bin/ffmpeg -y -i "$file" -c:v libx264 -x264opts no-scenecut -b:v 6M -force_key_frames 'expr:gte(t,n_forced*2)' -c:a copy -tune zerolatency -f mp4 "$video" ||
|
||||
# Double pass
|
||||
/usr/bin/ffmpeg -y -i "$file" -c:v libx264 -x264opts no-scenecut -b:v 6M -maxrate 6M -bufsize 1M -force_key_frames 'expr:gte(t,n_forced*2)' -movflags faststart -c:a copy -tune zerolatency -pass 1 -f mp4 "$video" &&
|
||||
/usr/bin/ffmpeg -y -i "$file" -c:v libx264 -x264opts no-scenecut -b:v 6M -maxrate 6M -bufsize 1M -force_key_frames 'expr:gte(t,n_forced*2)' -movflags faststart -c:a copy -tune zerolatency -pass 2 -f mp4 "$video" ||
|
||||
/usr/bin/ffmpeg -y -i "$file" -c:v libx264 -x264opts no-scenecut -b:v 6M -maxrate 6M -bufsize 12M -force_key_frames 'expr:gte(t,n_forced*2)' -movflags faststart -c:a copy -tune zerolatency -pass 1 -f mp4 "$video" &&
|
||||
/usr/bin/ffmpeg -y -i "$file" -c:v libx264 -x264opts no-scenecut -b:v 6M -maxrate 6M -bufsize 12M -force_key_frames 'expr:gte(t,n_forced*2)' -movflags faststart -c:a copy -tune zerolatency -pass 2 -f mp4 "$video" ||
|
||||
error=1
|
||||
|
||||
finish=$(date +'%Y-%m-%d at %H:%M')
|
||||
finish=$(date +'%Y-%m-%d at %H:%M:%S')
|
||||
((error)) && Mail 2 "Error encoding $name"
|
||||
|
||||
# Schedule cron job
|
||||
|
||||
Reference in new issue
Block a user