quicktime-java

[Prev] Thread [Next]  |  [Prev] Date [Next]

Arabic TextMedia in Movie? Joshua Foster Thu Aug 07 08:01:04 2008

Hi,
I need to display an Arabic caption over a movie.  I've got the basics of 
creating a text track and adding it to a movie:

  String text = "all your base are belong to us"
  QTPointer textPtr = new QTPointer( text.getBytes());
  
  Track textTrack = movie.addTrack( 320, 50, 0 );
  QDRect textBounds = new QDRect( 0, 0, 320, 50 );

  Media textMedia = new TextMedia( textTrack, movie.getTimeScale());
  textMedia.beginEdits();
        
  TextMediaHandler handler = (TextMediaHandler)textMedia.getHandler();
  handler.addTextSample( textPtr,           
      1, textSize, QDConstants.bold,
      QDColor.white, QDColor.black,    
      QDConstants.teCenter,  
      textBounds,
      StdQTConstants.dfDontAutoScale |
      ... bla bla more constants ...
      StdQTConstants.dfKeyedText,
      0,                               
      0, 0,                            
      QDColor.white,                   
      movie.getDuration());
        
  textMedia.endEdits();
  textTrack.insertMedia( 0, 0, textMedia.getDuration(), 1 );

But thus far I have been unable to show an Arabic string, it comes out as a 
bunch of question marks.  I've tried running the string through CharsetEncoder 
with different charsets: UTF-16, UTF-16BE, etc., and they just give me 
different combinations of unprintable-character squares and question marks.

I've read about two other possibilities... storing the Arabic text in a file 
and reading it into a Track using MediaImporter, and somehow specifying the 
movie and caption both in an XML file (??) but I've been unable to find 
examples for either.

Can anybody give me a hint or point me to any code or documentation? Keep in 
mind that I know nothing about Quicktime and I was only introduced to QTJava 
two days ago, so talk to me like a five-year-old...



________________________________________

Joshua Foster
Sr. Computer Programmer
2721 X-Ray Drive
Gastonia, NC 28054
(704) 824-0199 x217
(704) 824-0241 Fax

[EMAIL PROTECTED]
www.dtiweb.net
 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-java mailing list      ([EMAIL PROTECTED])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-java/alexiscircle%40gmail.com

This email sent to [EMAIL PROTECTED]