Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-97166

Qt6 Multimedia - Subtitle Language Metadata Detection Incorrect?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.2, 6.3.0 Alpha
    • 6.2.0
    • Multimedia
    • None
    • Android
    • 0aa6de09ebaee7630c165bdf967dd2d6e6b79cf2 (qt/qtmultimedia/dev) 7facfed5e6074c78d74b63c022474c8e51313fa3 (qt/qtmultimedia/6.2), e564564e7 (tqtc/lts-6.2), 4b976b27e (dev), 618b4bcde (6.4), f12eba209 (6.5)
    • 2022wk40FOQtforAndroid, 2022wk44FOQtforAndroid, 2022wk46FOQtforAndroid, 2022wk48FOQtforAndroid, 2023wk04FOQtforAndroid

      Kit: Android Qt 6.2.0 Clang armeabi-v7a

      Video Source: https://bhaart.s3.ap-south-1.amazonaws.com/sri_ramachandra_kripalu.mkv

      The goal is to parse the above video to list the subtitle track languages using MediaPlayer QML Type. 

      The above video was prepared by including multiple subtitle files using the below ffmpeg command. The language for each subtitle is set using the 3 character language code (eng, ben etc.), per the wiki spec

       

      ffmpeg -i input.mkv ^                
      -i SriRamachandraKripalu_en.ass ^
      -i SriRamachandraKripalu_bn.ass ^                
      -i SriRamachandraKripalu_gu.ass ^                
      -i SriRamachandraKripalu_hi.ass ^
      -i SriRamachandraKripalu_kn.ass ^  
      ...
      -map 0:v -map 0:a -map 1:s -map 2:s -map 3:s -map 4:s -map 5:s -map 6:s -map 7:s -map 8:s -map 9:s -map 10:s -map 11:s ^                
      -metadata:s:s:0 language=eng ^                
      -metadata:s:s:1 language=ben ^                
      -metadata:s:s:2 language=guj ^                
      -metadata:s:s:3 language=hin ^                
      -metadata:s:s:3 language=kan ^                 
      ...
      c:v copy -c:a copy -c:s ass ^                
      output.mkv
      

      The subtitle languages are shown in VLC Player as expected: See screenshot below.

       

      In Qt 6.2 MediaPlayer QML Type, I extracted the subtitle track language metadata using the below code snippet: 

      onSubtitleTracksChanged: { 
          subtitleTracks.forEach(function (subtitleTrack, index) {      
              console.log("subtitleTrack: ", subtitleTrack.stringValue(6)) //language
          });  
      } 
      

       

       

      -----------------

      Below is the logs from the above code.

      D qml : : subtitleTrack: English

      D qml : : subtitleTrack: Belarusian

      D qml : : subtitleTrack: Gujarati

      D qml : : subtitleTrack: Hindi

      D qml : : subtitleTrack: Georgian

      ...

      -----------------

      The language names highlighted in red are incorrect. 

       

      Upon digging a little further, it looks like Qt uses the first two letters of the language code and not all the three letters. Hence, a wrong language description is returned.  See  screenshot that indicates why Qt would have picked up the wrong language. 

       

      Can you please confirm if this is indeed a bug? If so, it would be nice to have the fix in 6.2.x

       

      Thanks!

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            bartlomiejmoskal Bartlomiej Moskal
            kmurthyhegde Krishna Hegde
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes