[Ffmpeg-devel] [REQUEST] Unicode in the -title argument for PSP
Chris Dolan
chris
Mon Jun 5 23:25:25 CEST 2006
== My problem ==
I'm trying to create movies with non-ASCII titles for the Sony PSP.
The movies play great, but their titles contain '?' characters
instead of the proper Unicode characters in the PSP's video listing.
I'm using a build from today's SVN head (revision 5456).
== Details ==
The Sony PSP reads the MPEG4 "moov.uuid.MTDT" atom to get the title
of the video file for its onboard directory listing. This field gets
populated via the ffmpeg cmdline flag "-title <string>". Looking in
libavcodec/movenc.c, I see that this string is downsampled to ASCII
and then upgraded to UTF-16BE. This is done by changing any values
outside 0x20 and 0x7f to a question mark ('?') and then padding to 16
bits via the ascii_to_wc() function. It looks like this was done as
a simple expedient since the PSP expects a UTF-16 string (I believe).
The command line I tried is the following. It contains the greek
letter lambda encoded via UTF-8.
ffmpeg -v 1 -y -i mjpegA.mov -title 'The ?-Orionis Star Forming
Region' -s 368x208 -r 29.97 -b 550 -maxrate 700 -bufsize 700 -acodec
aac -ac 2 -ar 24000 -ab 48 -f psp M4V88803.MP4
== My request ==
I'd like a way to be able to provide a Unicode string for the title
value. I'm fine with any way to provide this data. Some options off
the top of my head:
* UTF-16BE read from a file (note: would you have to strip the BOM?)
* UTF-8 on the cmdline converted to UTF-16 internally
* \unnnn escapes in cmdline string converter to UTF-16 internally
The latter is the easiest to code, but could break compatibility with
users that already have backslashes in their titles. I would be
willing to implement this if others approve of the idea.
Thanks!
Chris
--
Chris Dolan, Software Developer, http://www.chrisdolan.net/
Public key: http://www.chrisdolan.net/public.key
vCard: http://www.chrisdolan.net/ChrisDolan.vcf
More information about the ffmpeg-devel
mailing list