Menu

#448 UTF-8 characters in name of a subtitle tracks in AVI not sho

Incorrect_result
open-accepted
3
2010-01-22
2010-01-22
ale5000
No

MediaInfo doesn't show these characters in the name of a subtitles track in a .avi file.

Example, look at the name of the track "Text #4" of this file: http://www.mediafire.com/download.php?ndzloe5zg2d
It should end with "日本語 È" but it show this "??? È"

Discussion

  • Jerome Martinez

    Jerome Martinez - 2010-01-22

    All the files I already saw are in local codepage, not in UTF-8.
    And because AVI is created by English people, they didn't think to say wich codepage should be used!

    I try to add UTF-8 support without breaking the old files in local code page.

     
  • Jerome Martinez

    Jerome Martinez - 2010-01-22
    • priority: 5 --> 3
    • status: open --> open-accepted
     
  • ale5000

    ale5000 - 2010-01-23

    The name of audio and video tracks are in local codepage, but the name of subtitles track (that was added later in the avi format) is in UTF-8.

     
  • ale5000

    ale5000 - 2010-01-24

    I have just found a document that explain well how to handle subtitles in avi files: http://www.alexander-noe.com/video/documentation/avi.pdf

    Taken from the pdf:

    This section explains how to store subtitles in AVI les, so that VSFilter can be used to load and select subtitles.
    One subtitle stream is stored in one single chunk. That chunk contains header data, followed by an entire SRT or SSA le. If that le is using UTF-8 encoding, the BOM should be included as well. The header is dened as follows:
    char[4]; // 'GAB2'
    BYTE 0x00;
    WORD 0x02; // unicode
    DWORD dwSize_name; // length of stream name in bytes
    char name[dwSize_name]; // zero-terminated subtitle stream
    name encoded in UTF-16
    WORD 0x04;
    DWORD dwSize; // size of SRT/SSA text file
    char data[dwSize]; // entire SRT/SSA file
    Stream header chunk
    typedef struct {
    FOURCC fccType; // "txts"
    FOURCC fccHandler; // 00 00 00 00
    DWORD dwFlags;
    WORD wPriority;
    WORD wLanguage;
    DWORD dwInitialFrames;
    DWORD dwScale;
    DWORD dwRate; // dwRate / dwScale == duration in seconds
    DWORD dwStart;
    DWORD dwLength; // In units above..., should be 1
    DWORD dwSuggestedBufferSize;
    DWORD dwQuality;
    DWORD dwSampleSize; // = 0 -> treated as VBR
    RECT rcFrame; // 0, 0, 0, 0
    } AVIStreamHeader;

     
  • ale5000

    ale5000 - 2010-01-24

    I have checked the video file with a hexadecimal editor and it seems that the name is stored two times, one time using local codepage and one time in UCS-2 Little Endian.

     
  • ale5000

    ale5000 - 2010-01-26

    Sorry, it isn't UCS-2 Little Endian but UTF-16 Little Endian.

     
  • Jerome Martinez

    Jerome Martinez - 2010-01-26

    Thanks for feedback.
    I check it, and modify MediaInfo when I have a bit time (unfortuntly, not before 2 weeks :( )

     

Log in to post a comment.