Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-97166 Qt6 Multimedia - Subtitle Language Metadata Detection Incorrect?
  3. QTBUG-97159

Qt6 Multimedia - Subtitle Language Metadata Detection Incorrect?

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • Not Evaluated
    • 6.2, 6.3.0 Alpha
    • Multimedia
    • None
    • Android version 11, armeabi-v7a, qt6.2.0

    • Android
    • 2022wk40FOQtforAndroid, 2022wk44FOQtforAndroid, 2022wk46FOQtforAndroid, 2022wk48FOQtforAndroid, 2023wk04FOQtforAndroid

    Description

      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: 

       

      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 entries highlighted in red are incorrect. 

       

      Upon digging a little further, it looks like Qt gets the first two letters of the code and not all the three letters. Hence, a wrong language description is returned.  

         

      ---------

       

      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!

       

      Attachments

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

        Activity

          People

            rampe Rami Potinkara
            kmurthyhegde Krishna Hegde
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes