See here for how I started : http://ubuntuforums.org/showthread.php?t=2112462
Using the recommendations there i now have this script:
Code:
#!/bin/bash
vidfile='<show name and number>'
mkvextract chapters -s $vidfile.mkv > $vidfile.txt
ffmpeg -i $vidfile.mkv -map 0:s:0 <show name and number>.ass
ffmpeg -i $vidfile.mkv -vf "ass=<show name and number>.ass" -c:v libx264 -profile:v high -level 4.1 -crf 18 -preset veryslow -tune animation -deblock -2:-2 -x264opts qpmin=10:qpmax=28:aq-mode=2:no-mbtree:threads=auto -c:a copy $vidfile.mp4 2>&1 | tee $vidfile-enc.log
Here is my problem now. I get mkv anime shows from different sub groups and I'm wanting to make the above script more generic so i can put in a centralized bin folder for running.
Example of file name ( some file names have '_' instead of ' ' in the file name):[<fansub group name>] <show name> - <eposide number> [<bit depth>][<resolution>][<crc number>].mkv
or
[<sub group>]_<show name>_-_<epnumber>_[<v pix>x<h pix>][<crc>].mkv
Example file contents(generated using mkvmerge --identify on one of the files I currently have):
Code:
File '[<sub group>]_<show name>_-_<epnumber>_[<v pix>x<h pix>][<crc>].mkv': container: Matroska
Track ID 1: video (V_MPEG4/ISO/AVC)
Track ID 2: audio (A_AAC)
Track ID 3: subtitles (S_TEXT/ASS)
Attachment ID 1: type 'application/x-truetype-font', size 75156 bytes, file name 'Caxton_Book_BT.ttf'
Attachment ID 2: type 'application/octet-stream', size 5872144 bytes, file name 'DFKKS9.TTC'
Attachment ID 3: type 'application/octet-stream', size 5754084 bytes, file name 'KaiC_0.ttc'
Attachment ID 4: type 'application/x-truetype-font', size 98272 bytes, file name 'TektonPro-Bold.otf'
Attachment ID 5: type 'application/x-truetype-font', size 97260 bytes, file name 'TektonPro-BoldCond.otf'
Attachment ID 6: type 'application/x-truetype-font', size 99808 bytes, file name 'TektonPro-BoldExt.otf'
Attachment ID 7: type 'application/x-truetype-font', size 111532 bytes, file name 'TektonPro-BoldObl.otf'
Attachment ID 8: type 'application/x-truetype-font', size 65492 bytes, file name 'UVNThangVu.TTF'
Attachment ID 9: type 'application/x-truetype-font', size 104372 bytes, file name 'VINERITC.TTF'
Attachment ID 10: type 'application/x-truetype-font', size 30980 bytes, file name 'ABYSSTSFONT.TTF'
Attachment ID 11: type 'application/x-truetype-font', size 70180 bytes, file name 'cwelegnc.ttf'
Chapters: 5 entries
Currently I'm using mkvextract to rip the subs to a new file but it is not pulling the fonts out plus i have to manually create the sub file name and insert it in the above script in the needed places.
I need the script to process the shows name so that it will pull the subs to a file that is named for the show minus the group name, bit depth, resolution, and crc number( for use in the encode process).
Then pull all the fonts contained in the file and put them in $HOME/.fonts with their name and type intact so that they are usable by the system.
Do the encode and incert chapters into the mp4.
Resultant file name : [<fansub group name>]_<show name>_-_<eposide number>_[<h pix>p].mp4
All Help is greatly welcomed.
Bookmarks