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

TT1 to TT3/MSPA 704 sequence identifier #42

Merged
merged 20 commits into from
Nov 26, 2019

Conversation

nigelmegitt
Copy link
Collaborator

Add EBU-TT 1 to EBU-TT 3 conversion

Does not handle time conversion.
Sets ebuttp:sequenceIdentifier to the value of tt/head/metadata/documentMetadata/documentIdentifier if present, otherwise uses "TestConverter".
Resets the conformsToStandard to say it is EBU-TT-3 conformant.
Sets the timeBase to media whether you like it or not, but doesn't do any other conversions.

Tests for valid EBU-TT-3 document on output.

@nigelmegitt nigelmegitt changed the base branch from master to tt1-to-tt3-conversion November 20, 2019 14:39
@nigelmegitt nigelmegitt force-pushed the tt1-to-tt3/mspa-704-sequence branch from b347f48 to 2bda6a8 Compare November 20, 2019 15:10
@nigelmegitt nigelmegitt requested a review from PyvesB November 20, 2019 15:17
Copy link

@mm326 mm326 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, tests pass, I've printed the output doc and the sequence identifier is there

@nigelmegitt
Copy link
Collaborator Author

Thanks @mm326 I realised overnight that the node config override settings of the sequence identifier aren't being carried through. I think that's a minor addition though, so I propose to merge this and open a separate issue/pr to fix that.

Copy link
Member

@danielthepope danielthepope left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a few bits of feedback from flake8 WRT unused imports and styling, but there are some other important things to address too.

ebu_tt_live/bindings/converters/ebutt1_ebutt3.py Outdated Show resolved Hide resolved
ebu_tt_live/bindings/converters/ebutt1_ebutt3.py Outdated Show resolved Hide resolved
ebu_tt_live/bindings/converters/ebutt1_ebutt3.py Outdated Show resolved Hide resolved
ebu_tt_live/bindings/converters/ebutt1_ebutt3.py Outdated Show resolved Hide resolved
ebu_tt_live/bindings/converters/ebutt1_ebutt3.py Outdated Show resolved Hide resolved
ebutt3_bindings = converter.convert_document(ebutt1_in.binding)
doc_xml = ebutt1_in.get_xml()
ebutt1_doc = EBUTT1Document.create_from_xml(doc_xml)
ebutt3_bindings = converter.convert_document(ebutt1_doc.binding)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bit confuses me. Here we're taking an EBUTT1Document object, getting its XML, reading that back into an EBUTT1Document object, then converting it to EBUTT3.
The XML-and-back-again conversion seems unnecessary. Any particular reason for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's consistent with the ebutt3_to_ebuttd function, but I agree it isn't clear why this approach is taken in either place. Also it looks to me as though neither function is ever even called.

_semantic_dataset = None
_sequenceIdentifier = None

def __init__(self, sequence_id):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By adding this extra sequence_id parameter, the converter's usage in converters.py won't work. Can you set a default value here?
Alternatively set a value in converters.py

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, a value should be set in converters.py but I'm now wondering why that file even exists!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we'd use those helper functions in Distiller - they seem pretty handy to me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK we haven't discussed exactly how we're going to instantiate the classes and run them in Distiller yet, so we should do that. My thinking was that we would be in closer control within the Distiller component of exactly how we do the conversion. For example wiring in the Denester etc.

@danielthepope
Copy link
Member

Also worth mentioning that when this does get merged, it should be squashed. There are all sorts of duplicated commit messages that appear to change whitespace, and these should be removed from the history.

Also allows for a setting that specifies whether or not to use `ebuttm:documentIdentifier` element value in the input as the `ebuttp:sequenceIdentifier` attribute value in the output. Adds a test for this.
Address some warnings and add a page for EBU-TT 1 to EBU-TT 3 conversion. WIP.
Should have been committed with previous commit.
* Fix validation error messages for unexpected attributes so it doesn't say they are missing.
* Fix cloning of unknown element, and conversion of metadata
* Make EBUTT1Document instantiatable by including required attributes and elements in the constructor
* Add unit test cases for programmatical construction with smpte (skipped) and media timebase
* Add unit test cases for from-document construction with smpte (skipped) and media timebase
Copy link
Member

@danielthepope danielthepope left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try and get linting hints set up in your editor ;)

ebu_tt_live/node/ebutt1_ebutt3_producer.py Outdated Show resolved Hide resolved
ebu_tt_live/node/ebutt1_ebutt3_producer.py Outdated Show resolved Hide resolved
ebu_tt_live/strings.py Outdated Show resolved Hide resolved
ebu_tt_live/bindings/__init__.py Show resolved Hide resolved
ebu_tt_live/bindings/__init__.py Show resolved Hide resolved
ebu_tt_live/documents/ebutt1.py Outdated Show resolved Hide resolved
ebu_tt_live/documents/test/test_converters.py Outdated Show resolved Hide resolved
ebu_tt_live/documents/test/test_converters.py Outdated Show resolved Hide resolved
Pass pep8 wherever we can.
Helps distinguish test EBU-TT 1 files from test EBU-TT 3 files.
Copy link
Member

@danielthepope danielthepope left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good to me now, well done 😄

@nigelmegitt nigelmegitt merged commit 71ac319 into tt1-to-tt3-conversion Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants