Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation faults trying to package TTML captions #4

Closed
tieleman opened this issue Nov 26, 2014 · 11 comments
Closed

Segmentation faults trying to package TTML captions #4

tieleman opened this issue Nov 26, 2014 · 11 comments
Assignees
Labels

Comments

@tieleman
Copy link
Contributor

Hi,

I'm getting segmentation faults when trying to wrap TTML captions into ISOBMFF as explained here:

http://gpac.wp.mines-telecom.fr/2014/08/23/ebu-ttd-support-in-gpac/

I'm using the latest revision of GPAC (r5526). For the TTML file I'm using the file from your own regression tests (as well as several of my own):

https://raw.githubusercontent.com/gpac/gpac/master/regression_tests/ttml/ebu-ttd_sample.ttml

Segmentation faults occur on the following platforms:

  • OS X 10.10.1 (Yosemite)
  • Ubuntu 14.04.1 LTS 64-bit
$ MP4Box -add ebu-ttd_sample.ttml -new captions.mp4
TTML Import                                         
Segmentation fault (core dumped)
@rbouqueau rbouqueau self-assigned this Nov 26, 2014
@rbouqueau
Copy link
Member

I'm looking at it. The report of Valgrind here is perfect (except a small leak not related to ttml fixed at 37d4a1d).

I'll try in another VM.

@rbouqueau
Copy link
Member

I ould reproduce on a ubuntu 14.04 VM. Investigating.

@rbouqueau
Copy link
Member

79c5e36 should fix the issue. Thanks for reporting!

@tieleman
Copy link
Contributor Author

Hi Romain, that did fix the segfault (thanks!), but I still cannot package the sample EBU-TTD file from your own regression tests:

$ MP4Box -v -add ebu-ttd_sample.ttml -new caption.mp4
TTML Import                                         
Found root attribute name xmlns:ttp, value http://www.w3.org/ns/ttml#parameter
Found root attribute name xmlns:tts, value http://www.w3.org/ns/ttml#styling
Found root attribute name ttp:timeBase, value media
Found root attribute name ttp:cellResolution, value 50 30
Found root attribute name xml:lang, value de
Found root attribute name xmlns, value http://www.w3.org/ns/ttml
XML Subtitle SampleEntry: namespace, schema and location are mandatory. Abort.
TTML: incorrect sample description. Abort.
Note: TTML import - EBU-TTD detected
Saving caption.mp4: 0.500 secs Interleaving

I end up with an ISOBMFF file of only 500+ bytes (empty file essentially).

See text_import.c#1064:

e = gf_isom_new_xml_subtitle_description(import->dest, track, xmlns, NULL, NULL, &desc_idx);

It explicitly passes NULL and NULL for xml_schema_loc and mimes, which will trigger a failure in the TTML packaging ttml.c#252:

if (!xmlnamespace || !xml_schema_loc || !mimes) {
    GF_LOG(GF_LOG_WARNING, GF_LOG_PARSER, ("XML Subtitle SampleEntry: namespace, schema and location are mandatory. Abort.\n"));
    return GF_BAD_PARAM;
}

@rbouqueau
Copy link
Member

I'll have a look at the different specs involved. My examples come from the EBU spec and an example provided by EBU members. The code comes from the MPEG specs.

@tieleman
Copy link
Contributor Author

Ok, thanks, but can you confirm what I posted here above, that the current code (which passes explicit NULL values) results in the fact that no TTML documents currently can be imported because these NULL values will fail the test in ttml.c?

@rbouqueau
Copy link
Member

I confirm.

@rbouqueau
Copy link
Member

I checked on the latest spec draft and I fixed my prev patch: https://sourceforge.net/p/gpac/code/5530/
Now your content should pass rightfully.

@cconcolato cconcolato added the bug label Nov 27, 2014
@SoleneChiche
Copy link

Hello,

I am running the following version: "MP4Box - GPAC version 0.5.2-DEV-rev99-gb44dfd1-master".

I tried using the following command to package my ebu-tt-d captions into ISOBMMF file and obtained the following error report:

$ MP4Box -v -add subtitles-ebu-tt-d.xml:ext=ttml -new caption.mp4

TTML Import
Found root attribute name xmlns:tt, value http://www.w3.org/ns/ttml
Found root attribute name xml:space, value default
Found root attribute name ttp:timeBase, value media
Found root attribute name xml:lang, value en
Found root attribute name ttp:cellResolution, value 50 30
Found root attribute name xmlns:ttp, value http://www.w3.org/ns/ttml#parameter
Found root attribute name xmlns:tts, value http://www.w3.org/ns/ttml#styling
Found root attribute name xmlns:ttm, value http://www.w3.org/ns/ttml#metadata
Found root attribute name xmlns:ebuttm, value urn:ebu:tt:metadata
Found root attribute name xmlns:ebutts, value urn:ebu:tt:style
XML (Subtitle, Metadata or Text) SampleEntry: namespace is mandatory. Abort.
TTML: incorrect sample description. Abort.
Note: TTML import - EBU-TTD detected
Saving caption.mp4: 0.500 secs Interleaving

As well as @tieleman, I obtain a ~500ko file almost empty:

$ MP4Box -info caption.mp4
* Movie Info *
    Timescale 600 - Duration 00:00:00.000
    1 track(s)
    Fragmented File: no
    File suitable for progressive download (moov before mdat)
    File Brand isom - version 1
    Created: GMT Tue Mar  3 12:05:26 2015
    Modified: GMT Tue Mar  3 12:05:26 2015

File has no MPEG4 IOD/OD

Track # 1 Info - TrackID 1 - TimeScale 1000 - Media Duration 00:00:00.000
Media Info: Language "und (und)" - Type "subt:...." - 0 samples
Media Data Location: (null)
Unknown Text Stream
 Size 0 x 0 - Translation X=0 Y=0 - Layer 0

Thanks for the help.

@cconcolato
Copy link
Member

Hi Solène,
MP4Box does not currently support importing TTML documents that use a namespace prefix for the TTML namespace, i.e. "xmlns:tt".

@SoleneChiche
Copy link

Thanks

maki-rxrz pushed a commit to maki-rxrz/gpac_old that referenced this issue Jul 31, 2016


git-svn-id: svn://svn.code.sf.net/p/gpac/code/trunk/gpac@5529 63c20433-aa62-49bd-875c-5a186b69a8fb
RodolpheFouquet pushed a commit that referenced this issue Sep 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants