I just discovred this incredible player (thanks to the author, really!).
I wanted to add subtitles to some of my videos. I created the code with the setup wizard, with the .srt file url. But when I play the video, the "T" button appears but the subtitles don't. I also tried with the .srt file example (http://www.jeroenwijering.com/extras/subtitles_example.txt) but nothing...
Is that me (I looked for a solution, but maybe I did something wrong!) or the .srt format is not accepted by the player?
It could very well be that the SRT files are on another webserver than your SWF file. Then security restrictions in the flash player will prevent the reading of the SRT file.
There are some fixes for this, I’ve explained then in the playlist section [url=http://www.jeroenwijering.com/extras/readme.html]of the readme[/url]. (loading playlists from another domain causes the same problem)
The problem wasn't this one, actually. The subtitles didn't play because the FLV file didn't have correct metadata inserted. I fixed that, and the subtitles are now playing. :)
But... but first, the special caracters don't show. It's french subtitles so there's a weird symbol instead of the "" or "" letters. Secondly, the subtitles are not synchronised with the video, they show one second too late or so. When I play the same video with the same subtitles on my computer (with VLC), it fit completely though.
Please make sure to save your SRT files in UTF8 format for the special characters to appear OK. Ultimately, you could also send a UTF8 header along with the SRT files.
As to the timing problem; I just found out the captioning works at a resolution of 1 second in the player. I’ll set it to 1/10 of a second so the captions might display more in SYNC.
Congratulations for your player. From my experience is the only one that creates outlined text with transparent background (I can believe adobe captioning component does not support tts outline!). The only problem I am experiencing right now is that when I create a 3 lines caption in a srt file the player seems to create a space for 4 lines leaving a blank line between the second and third line. Is this a bug or may be srt files do not support more than 2 lines for caption?
The captioning component indeed supports just 2 lines. But perhaps the third line is a bit too large so a single dot or space drops to the fourth line?
try using the mediapler instead of the flash player. I tested your srt file with this code and works just fine. the size of the player is slightly different...
<html> <head> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript" src="swfobject.js" /> <div id="player">This text will be replaced</div> <script type="text/javascript"> var so = new SWFObject('mediaplayer.swf','mpl','352','305','7'); so.addParam('allowfullscreen','true'); so.addParam('allowscriptaccess','true'); so.addVariable('displayheight','288'); so.addVariable('file','honda_girl.flv'); so.addVariable('height','305'); so.addVariable('width','352'); so.addVariable('callback','honda_girl.srt'); so.write('player'); </script> </head> <body> <embed src="mediaplayer.swf" width="352" height="305" allowfullscreen="true" allowscriptaccess="always" flashvars="&displayheight=288&file=honda_girl.flv&height=305&width=352&captions=honda_girl.srt" /> </body> </html>
while screwing around with this, I discovered that yu can use simple HTML formatting in the SRT test:<code>1 00:00:01,440 --> 00:00:03,375 <font size="6" face="Verdana">6-Senator, we're making our final approach into Coruscant.</font>
3 00:00:05,600 --> 00:00:07,500 <font size="10" face="Verdana">10-Senator, _something seems to be wrong,_ I can't see the landing strip on my radar.</font>
4 00:00:09,000 --> 00:00:12,250 <font size="12" face="Verdana">12-Lieutenant, your radar must be faulty. There is the landing strip, right below us.</font>
5 00:00:14,500 --> 00:00:17,250 <font size="14" face="Verdana">14-It might look like a landing strip, but it is just an illusion.</font>
6 00:00:20,500 --> 00:00:25,750 <font size="16" face="Verdana">16-That's the landing strip, but the facilities are destroyed.</font>
7 00:00:27,500 --> 00:00:32,750 <font size="18" face="Verdana">18-Short because it's huge.</font>
note that the jw player works with a resolution of 0.01 second setting to 0.001 seconds is a waste of time
one final note in SRT caption files, *EVERY* line must end with a carriage return and a line feed not all text editors save the files this way check with a hex editor every line *MUST* end with 0A0D
Your code that outputs the actual line must end with something like"\r\n" or whatever means carriage return line feed in the programming language that you are using.
The "\r\n" shouldn't be showing, they are invisible control characters.
Common programming language notation is to use "\r\n" to print those invisible control characters at the end of a line. Most Windows text editors put CRLF at the end of the line, whereas Apple and *nix usually only use one character new line, same as LF.
bc.. And using a custom field to out all the captions. I don't understand. If you are using a custom field, and you put the correct line-ending characters at the end of the custom field, wouldn't that have automatically ouptut each line in the correct format? Or, can you change the line ending format of whatever program is using the custom field?
All the captions and time codes go into one custom field (a textarea) not individual custom fields for each line, sorry I didn't make that clear. I tried what you suggested by typing it in after the first few lines but they still showed up all as one block.
I'm using ExpressionEngine - http://expressionengine.com/
I searched through the Expression Engine site and could not find any reference to changing the line-ending characters, so I guess it's not possible.
You will have to output the srt files with Expression Engine, then open them with a text editor that does save files with CRLF and save them. Common Windows text editors such as Notepad and Wordpad do save text files with CRLF. Common *nix and Mac editors don't. If that's a BIG problem, then...
Can you upload and execute PHP scripts on your server? If the answer is YES, I could write a small PHP script that would load every srt file it can find and save them with the proper CRLF line-ending.
Hi, the "\r\n" way worked. Great. (I hate TimedText, and http://www.subtitle-horse.org/translator.php didn't work for me) Anyway, I was able to display SRT subtitle files correctly now. Here's the perl script I used:
bc.. #!/usr/bin/perl -w #Author: Bill Hung, Date: 2 Mar 2008
#1. open the file handler open (INFILE, "honda_girl.origin.srt") || die "can't open file";
#2. read and print every line while ($line = <INFILE>){ chomp($line); print $line . "\r\n"; }
#3. close the file handler close (INFILE);
Then I typed bc.. ~/script/add_newline.pl > honda_girl.srt in the terminal
honda_girl.origin,srt is the input of the script and honda_girl.srt is the output of the script. honda_girl.srt is the input to the flv player, using the same code and player as my last post
First of all .. Thanx for the splendid player. Now let`s get to the bussines. I have read most of the tutorials arownd here but i didn`t fownd someone with my problem .. wich is: I use a redirectional decripting code to take the movies from another website like megavideo to play on my website separeu.org it works just fine but .. when i wana add subtitles (captions) to the player it bothers me that wen i click full screen the progress bar is almost al the midle of the screen and and its big.. also the subtitles are shown the same at the middle of the screen almost.If i press full screen before the movie loads it`s ok ... the bar is down and small and the subtitles are upon it. But if i exit full screen mode and enter again i face the same problem as i explained first. What seems to be the problem? It can be fixed? here is an example: http://www.separeu.org/example/Game_Plan.php (sorry for my bad english) ps. i tried the stretch modes and they doesen`t work on full screen
When will 4.5 player be available for licencing and release?
I am working with 4.5 latest from tunk and the sub in .txt format are working great in a playlist.. but aware that this verison is beta etc... don't wan to put it live until all is well here!
Loving the new layout of the captions and links by the way!
I am finding that the srt files did not work on IIS servers as the MIME type does not seem to be configured by default.. after changing the fiels to .txt files all is well on appache and IIS servers..
Small snag will subs though.. if you play a file then paus and click to play another file... the previous subs appear before the first bit of timecode with text attached to it kicks in!
Andrew Minton, you are a life saver! :) Ive been searching like a maniac for days, when I saw your post about the MIME-types on IIS and Apache servers.
Fellas, try changing ".srt" to ".txt". Thanks, Andrew
Bye the way you don't necessarily need to change the .srt extension to .txt, By default IIS only serves those files whose mime type is configured. So just go to Default Web Siet -> Properties. Click the Http Headers tab, click the mime type button. you will see a new dialog in that click New. In the dialog box in the extension type .srt in the in the Mime Type text box type text/plain. click ok, again click ok to close the website dialog properties. Now IIS will be able to serve the .srt files
This question has received the maximum number of answers.