After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 763647 - mpegtsmux doesn't keep language code from the incoming audio stream
mpegtsmux doesn't keep language code from the incoming audio stream
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.7.91
Other All
: Normal enhancement
: 1.9.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-14 22:14 UTC by mguinzbourg
Modified: 2016-04-27 02:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mpegtsmux: write language descriptor when language is available (3.08 KB, patch)
2016-04-19 13:31 UTC, Thiago Sousa Santos
none Details | Review
mpegtsmux: write language descriptor when language is available (5.02 KB, patch)
2016-04-22 14:50 UTC, Thiago Sousa Santos
committed Details | Review
mpegts lib built with the patch (615.99 KB, application/x-msdos-program)
2016-04-22 15:02 UTC, Thiago Sousa Santos
  Details
mpegtsmux plugin built with the patch (463.53 KB, application/x-msdos-program)
2016-04-22 15:03 UTC, Thiago Sousa Santos
  Details

Description mguinzbourg 2016-03-14 22:14:55 UTC
I'm trying to pass audio stream language code from the source 
mpegts  to output mpegts stream. The language code is lost while 
demuxing-transcoding-muxing process. I traced the problem in the code 
to the following: in the tsmuxstream.c, line 745 (snip) (which 
suppose to write descriptor to the pmt table) the 
language code is simply ignored for audio type ac3 and for other 
audio types the descriptor not even created. Can anybody look at this 
problem or what's involved in fixing this part. This is critical for 
my project to have audio descriptors with the language code. Thanks!
Comment 1 Thiago Sousa Santos 2016-04-19 13:31:48 UTC
Created attachment 326322 [details] [review]
mpegtsmux: write language descriptor when language is available

Please check if this fixes your issue.

The remaining question I have here is whether the language code should be added only for audio streams or any stream. Also it seems that language assumed to be english when nothing is set from upstream, but this seems like a separate issue.

Patch still missing documentation for the new mpegts function, to be added before pushing.
Comment 2 mguinzbourg 2016-04-19 21:33:35 UTC
(In reply to Thiago Sousa Santos from comment #1)
> Created attachment 326322 [details] [review] [review]
> mpegtsmux: write language descriptor when language is available
> 
> Please check if this fixes your issue.
> 
> The remaining question I have here is whether the language code should be
> added only for audio streams or any stream. Also it seems that language
> assumed to be english when nothing is set from upstream, but this seems like
> a separate issue.
> 
> Patch still missing documentation for the new mpegts function, to be added
> before pushing.

I will check as soon as I get to my setup. Thanks a lot!
Comment 3 mguinzbourg 2016-04-21 12:58:22 UTC
(In reply to Thiago Sousa Santos from comment #1)
> Created attachment 326322 [details] [review] [review]
> mpegtsmux: write language descriptor when language is available
> 
> Please check if this fixes your issue.
> 
> The remaining question I have here is whether the language code should be
> added only for audio streams or any stream. Also it seems that language
> assumed to be english when nothing is set from upstream, but this seems like
> a separate issue.
> 
> Patch still missing documentation for the new mpegts function, to be added
> before pushing.

I need your help with the verification of the fix. I can't build gstreamer from the source. My project is built on Windows 64 bit platform and I'm using pre-built binaries for Visual Studio solution. I would really appreciate if tyou can send me a patched binaries so I can try them, or instruct me how to obtain them.

So far I've examined the changes and I see that this should fix my problem with audio streams. 
As for the video streams - I don't need them for my project but if it's easy to add support for video streams I don't see why not.
If the language is not set currently it shows up as unknown which is perfectly fine. I think in order to handle it better you can let the user to set default language and set the default code when language is not defined for the stream.
Comment 4 Thiago Sousa Santos 2016-04-22 14:50:58 UTC
Created attachment 326556 [details] [review]
mpegtsmux: write language descriptor when language is available

New version that only sets the language for audio tracks.
Comment 5 Thiago Sousa Santos 2016-04-22 15:02:46 UTC
Created attachment 326557 [details]
mpegts lib built with the patch
Comment 6 Thiago Sousa Santos 2016-04-22 15:03:45 UTC
Created attachment 326558 [details]
mpegtsmux plugin built with the patch

Hopefully those 2 dll can replace your installed versions and it should confirm if the patch fixes the issue.
Comment 7 mguinzbourg 2016-04-26 15:37:32 UTC
I've tried 2 dll files from the previous attachment and replace my installed dll's with the patched. gst-inspect-1.0 mpegtsmux was able to show very limited info with the message plugin not loaded. I guess two dll files are not enough. Then I get the whole thing with the cerbero - as a result I was able to build gst-plugins-bad. After that I've tried it with my application and it worked perfect! So please let me know what has to be done to make it to the official source as soon as possible. I need it to be included into windows installer package, no matter if it just experimental or beta. Thanks a lot for your excellent work!
Comment 8 Thiago Sousa Santos 2016-04-27 02:59:36 UTC
Thanks for confirming, it will be available in the next stable release (1.10)

commit 9cc00bf2c9b61236a3d65906ae7dbcb3fb8ef4fe
Author: Thiago Santos <thiagoss@osg.samsung.com>
Date:   Tue Apr 19 10:27:43 2016 -0300

    mpegtsmux: write language descriptor when language is available
    
    Adds a new function to mpegts lib to create a iso639 language
    descriptor from a language and use it in mpegtsmux to add
    a language descriptor to audio streams that have a language set.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763647