This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
ubuntu:handbrake [2014/01/02 14:53] tschulz [Movie Resize Script] |
ubuntu:handbrake [2017/01/13 14:35] tschulz [Merge Video Files] |
||
---|---|---|---|
Line 43: | Line 43: | ||
</file> | </file> | ||
+ | ===== Rename Script ===== | ||
+ | <file bash> | ||
+ | #!/bin/sh | ||
+ | CONV_EXT="*.flv|*.avi|*.mkv|*.mp4" | ||
+ | |||
+ | LIST="`find * | grep -E \"${CONV_EXT}\" | sed \"s/ /+/g\"`" | ||
+ | |||
+ | for i in $LIST | ||
+ | do | ||
+ | FILENAME="`echo $i| sed \"s/+/ /g\"`" | ||
+ | BASENAME="`echo \"${FILENAME}\" | sed \"s/\.mp4//g\" | sed \"s/\.avi//g\" | sed \"s/\.mkv//g\" | sed \"s/\.m4v//g\" | sed \"s/\.flv//g\"`" | ||
+ | NEWFILENAME="`echo \"$FILENAME\" | sed \"s/_hxmc//g\"`" | ||
+ | mv "$FILENAME" "$NEWFILENAME" | ||
+ | done | ||
+ | </file> | ||
+ | |||
+ | |||
+ | ===== Ffmeg Convert AAC 5.1 to AC3 5.1 ===== | ||
+ | <file bash convert_aac_to_ac3.sh> | ||
+ | #!/bin/sh | ||
+ | |||
+ | ffmpeg -i $1 -vcodec copy -acodec ac3 -ar 48000 -ab 384k -ac 6 -aspect 16:9 $1.ac3.mp4 | ||
+ | </file> | ||
+ | |||
+ | ===== Ffmeg Encode to x264/AC3 ===== | ||
+ | <file bash> | ||
+ | ffmpeg -i <INPUT_FILE> -vcodec libx264 -acodec ac3 -ar 48000 -ab 384k -ac 6 <OUTPUT_FILE> | ||
+ | </file> | ||
+ | |||
+ | ===== Ffmeg Encode to MP4/AC3 ===== | ||
+ | <file bash> | ||
+ | ffmpeg -i <INPUT_FILE> -vcodec mpeg4 -acodec ac3 -ar 48000 -ab 384k -ac 6 <OUTPUT_FILE> | ||
+ | </file> | ||
+ | |||
+ | ===== Ffmeg Split Video File ===== | ||
+ | <file bash> | ||
+ | ffmpeg -i ORIGINALFILE.mp4 -acodec copy -vcodec copy -ss START(00:00:00) -t LENGTH(01:00:00) OUTFILE.mp4 | ||
+ | </file> | ||
===== External Refs ===== | ===== External Refs ===== | ||
[[https://trac.handbrake.fr/wiki/CLIGuide|Offical CLI Guide]] | [[https://trac.handbrake.fr/wiki/CLIGuide|Offical CLI Guide]] | ||
+ | |||
+ | ===== Merge (Concat) Video Files ===== | ||
+ | - Create a text file with the files you want to merge. Simply put one file on each line and start each line with file then the filename in quotes<file txt mergelist.txt> | ||
+ | file 'jan_2017_game_part1.m4v' | ||
+ | file 'jan_2017_game_part2.m4v' | ||
+ | file 'jan_2017_game_part3.m4v' | ||
+ | file 'jan_2017_game_part4.m4v' | ||
+ | file 'jan_2017_game_part5.m4v' | ||
+ | file 'jan_2017_game_part6.m4v' | ||
+ | file 'jan_2017_game_part7.m4v' | ||
+ | file 'jan_2017_game_part8.m4v'</file> | ||
+ | - Then run **ffmpeg** with **-f concat -i <LISTFILE> -copy <OUTPUTFILE>** or <file>ffmpeg -f concat -i mergelist.txt -c copy output.mp4</file> | ||