[libdcp] Convert MXF subtitles to XML

Anything and everything to do with DCP-o-matic.
ydedy
Posts: 18
Joined: Thu Jan 14, 2016 11:56 am

[libdcp] Convert MXF subtitles to XML

Post by ydedy »

Hi everyone,

I currently need to convert (unencrypted) SMPTE/MXF subtitles to XML text files. It seems that the dcp::SMPTESubtitleAsset::xml_as_string() methods in libdcp allows to do this but I want to make sure of this before diving into the compilation of the library.
Any other suggestion of an easier workaround is also welcome :)

Thanks!
carl
Site Admin
Posts: 2548
Joined: Thu Nov 14, 2013 2:53 pm

Re: [libdcp] Convert MXF subtitles to XML

Post by carl »

asdcp-unwrap from asdcplib will do this. Do you need to do it from a C++ program or the command line?
ydedy
Posts: 18
Joined: Thu Jan 14, 2016 11:56 am

Re: [libdcp] Convert MXF subtitles to XML

Post by ydedy »

Thanks! I just headed towards the wrong library.
I managed to compile asdcplib and this asdcp-unwrap binary works like a charm through the cli.

For those who are interested, you have to specify the output file if you don't want to xml to be written in the current directory :

Code: Select all

$> ./asdcp-unwrap ./path/to/the/sub.mxf ./path/to/the/output.xml
I also noticed that even the font file is outputted using its associated UUID as filename.

Do I just need to include asdcp-unwrap.cpp if I plan to make a light GUI of this command ?
carl
Site Admin
Posts: 2548
Joined: Thu Nov 14, 2013 2:53 pm

Re: [libdcp] Convert MXF subtitles to XML

Post by carl »

I think you'd have to link against the asdcp and kumu libraries.
vijm1972
Posts: 5
Joined: Thu Feb 23, 2017 9:05 am

Re: [libdcp] Convert MXF subtitles to XML

Post by vijm1972 »

Hi,

Can you please suggest the command which I need to use while converting from MXF subtitle to XML. I am using below command.

DCP_Test\asdcplib-1.12.60-tools\asdcp-unwrap.exe Z:\21-2-2017\PFTJAN17TEST3_FTR-2-25_C_EN-EN_IN-UA_20_HD_20170117_VF_01_tt.mxf D:\DCP_Test\Test.xml

I am getting below error:

Operational pattern is not OP-Atom: OP1a
Operational pattern is not OP-Atom: OP1a
Buffer for footer partition not created: IndexByteCount = 0
Program stopped on error.


Please suggest.

Thanks,
Vijay
vijm1972
Posts: 5
Joined: Thu Feb 23, 2017 9:05 am

Re: [libdcp] Convert MXF subtitles to XML

Post by vijm1972 »

Hi Team,

Any update on below request please.

Thanks,
Vijay
carl
Site Admin
Posts: 2548
Joined: Thu Nov 14, 2013 2:53 pm

Re: [libdcp] Convert MXF subtitles to XML

Post by carl »

What you've done should work. Perhaps you could attach the MXF in question.
vijm1972
Posts: 5
Joined: Thu Feb 23, 2017 9:05 am

Re: [libdcp] Convert MXF subtitles to XML

Post by vijm1972 »

Please find attached sub.mxf in zip.
PFT_Test_tt.rar
You do not have the required permissions to view the files attached to this post.
carl
Site Admin
Posts: 2548
Joined: Thu Nov 14, 2013 2:53 pm

Re: [libdcp] Convert MXF subtitles to XML

Post by carl »

That looks like MXF-wrapped timed-text markup, which is not what DCPs use for subtitles so asdcplib won't understand it.
The

Code: Select all

strings
utility on Unix fishes the XML out fine, I think; I've attached the result.
You do not have the required permissions to view the files attached to this post.
vijm1972
Posts: 5
Joined: Thu Feb 23, 2017 9:05 am

Re: [libdcp] Convert MXF subtitles to XML

Post by vijm1972 »

Can you explain in detail please? (Step by step procedure)

Thanks,
Vijay