Hello everyone.
As the title said, I'm looking for some way to automatically embed .SRT subs in their respective Video files.
The subtitles files are already in my possession, and I've named them properly (same name of video files).
What I used to do is to insert them one by one using Subler, it works, but sometimes happens that I have many files and it's really annoying.
Is there any OSX software which can help me out?
Thank in advance for your advice!
+ Reply to Thread
Results 1 to 6 of 6
Thread
-
-
SublerCLI can do this with some shell scripting
download SublerCLI from the same place as Subler
put it in /usr/local/bin
the attached file "subadder.command" is a shell script that will take a folder of mp4 and srt movies and combine them (if they have the same name)
open the .command file in a text editor to see what it is doing...
and if it won't run for you do this....
open a terminal window
type chmod +x
then a space
then drag the .command file in and now it will run for you.
TEST ON A NON IMPORTANT FILE FIRST and then if you're happy..go for it on the rest!
cheers
jamie -
Fascinating!
It works! I wasn't aware about this alternative version of subler which can runs commands.
Did you make this command? It's very impressive.
The only thing I've noticed is that the subtitles "meta" which are embedded have an unspecified language; also every files end to have as meta name: MY_SUBS.
Although this, it was REALLY HELPFUL!
Many thanks! -
yep i wrote the command.
if you open the .command with textedit (set to plain text) and edit the line that starts with
SublerCLI
there are settings in there that were just guesses on my part so the -metadata "Name:MY_SUBS" can be changed there (or just deleted)
and also the -language i guessed as eng for english (for me) but i'm unsure of what quicktime/ps3 etc is expecting in that bit!
when you've done just save the file (and make sure it doesn't get .txt at the end)
just play around and post back here so i learn something!
cheers
jamie -
Well, I think you can only teach mejust play around and post back here so i learn something!

Anyway... after experimenting for a while I came up with this:
Since my files are .m4v and I use to embed both Italian and English subtitles I've edited a couple of things...Code:#! /bin/sh echo drag folder with video and srt files in echo for each language the subs MUST have the following pre-extensions: !! echo ENGLISH: .en example mysubs.en.srt echo ITALIAN: .it example mysubs.it.srt read thefolder cd "$thefolder" for i in *.m4v and for i in *.mp4 do subname=`basename "$i"|rev|cut -c 5-|rev` SublerCLI -source "$subname.en".srt -language English -dest "$i" | subname=`basename "$i"|rev|cut -c 5-|rev` SublerCLI -source "$subname.it".srt -language Italian -dest "$i" done clear echo all done. Your subs are in the video files
I personally tried it and it works, but again... if everyone wants to give it a try please test first on non-important files.
Also, can you please explain me this part of the code?
Thank you very much! I really appreciate!Code:subname=`basename "$i"|rev|cut -c 5-|rev`
-
subname=`basename "$i"|rev|cut -c 5-|rev`
is a way of getting the name of the movie but without the ".suffix" at the end
ie
thingy.avi
becomes
thingy
it basically does this
subname is the name of our "variable" whaere we want to store the information we want
then the ` means "the result of everything inside the ` signs
basename "$i" this gets the name of the file from the full path ie /users/me/folder1/myfilm.avi gives just myfilm.avi
then the | means do the next thing as well
rev reverses the string so myfilm.avi is iva.mlifym
cut -c 5- means cut from the 5th character so that gives mlifym
rev reverses it again to myfilm
there is a much shorter way of doing it involving {...} type things but i can never remember it whereas the step by step approach has stuck in my head!
you shouldn't need the second subname=`basename "$i"|rev|cut -c 5-|rev`
line because once it is "set" it doesn't become "unset" until YOU reset it or the program quits.
great hacking on the code I'll have that back thankyou very much!
all the best
jamie
Similar Threads
-
Is it possible to embed subtitles on to MKV & MP4 files using Virtualdub?
By Sulli in forum Newbie / General discussionsReplies: 2Last Post: 9th Oct 2012, 10:50 -
How to change fast container of many files (from avi to mp4)?
By wacus in forum Newbie / General discussionsReplies: 3Last Post: 30th Jul 2012, 16:32 -
need to put content of FLV container into MP4 container
By arraboy in forum Newbie / General discussionsReplies: 3Last Post: 29th Jun 2012, 19:52 -
Can flac or .ass files be muxed into a MP4 container?
By Cyber Akuma in forum Newbie / General discussionsReplies: 5Last Post: 29th Oct 2010, 14:47 -
embed srt into mkv
By Soixante in forum Video ConversionReplies: 3Last Post: 16th Oct 2010, 04:00



Quote