otsaloma / gaupol

Editor for text-based subtitle files
https://otsaloma.io/gaupol/
GNU General Public License v3.0
250 stars 35 forks source link

Audio languages are inverted #129

Closed sbraz closed 4 years ago

sbraz commented 5 years ago

Hi, with version 1.5, it looks like the languages from the preview menu are inverted. In the attached test file, the tracks are English, Russian and French but gaupol shows them in the opposite order (the tracks themselves are in the right order but the languages don't match): image

otsaloma commented 5 years ago

Haven't seen this before. That track order comes directly from GstPbutils.Discoverer. Could be a GStreamer bug or maybe the situation is just more complicated than stream numbers being the indexes of the stream list.

Test script:

import gi
import os
import sys
import urllib.parse

gi.require_version("Gst", "1.0")
gi.require_version("GstPbutils", "1.0")

from gi.repository import Gst
from gi.repository import GstPbutils

Gst.init(None)

fname = os.path.abspath(sys.argv[1])
uri = "file://{}".format(urllib.parse.quote(fname))
info = GstPbutils.Discoverer().discover_uri(uri)
print([x.get_language() for x in info.get_audio_streams()])
sbraz commented 5 years ago

It returns ['fr', 'ru', 'en'] on my system. I assume that it works for you?

otsaloma commented 5 years ago

I get ['fr', 'ru', 'en'] as well. That was just interim notes, I don't expect to look into this now, but might return to it later. If you wish you can ask or file a bug report against some appropriate part of GStreamer. That test script is minimal reproduction of what Gaupol does to construct the language menu.