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

Put back video metadata #13094

Merged
merged 1 commit into from Sep 9, 2016
Merged

Put back video metadata #13094

merged 1 commit into from Sep 9, 2016

Conversation

GuillaumeGomez
Copy link
Contributor

@GuillaumeGomez GuillaumeGomez commented Aug 28, 2016

I updated the video-metadata-rs crate: now, no more ffmpeg, just pure rust. The webm format isn't checked yet.


This change is Reviewable

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/lib.rs, components/script/Cargo.toml, components/script/dom/htmlmediaelement.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 28, 2016
@KiChjang
Copy link
Contributor

Does this require additional libraries to be installed on users' system?

@GuillaumeGomez
Copy link
Contributor Author

No. That's the whole point and the great improvement.

@jdm
Copy link
Member

jdm commented Aug 28, 2016

cc @splav This will impact the plans for using mp4parse.

@jdm
Copy link
Member

jdm commented Aug 28, 2016

r? @Manishearth
By random selection, since I don't intend to review code this week.

@highfive highfive assigned Manishearth and unassigned jdm Aug 28, 2016
@GuillaumeGomez
Copy link
Contributor Author

@jdm: I'll put @Ms2ger on it then.

r? @Ms2ger

@highfive highfive assigned Ms2ger and unassigned Manishearth Aug 28, 2016
@est31
Copy link
Contributor

est31 commented Aug 28, 2016

Related : #13024, #12769.

@splav
Copy link
Contributor

splav commented Aug 28, 2016

First: The current metadata structure seems to be suitable only for video content. Are there any plans to support audio content as well? May we should make it more general to support both?
Second: mp4_parse essentially does not have rust API yet. So the crate uses own patched version that makes some structs public. I saw the PR for mp4_parse, but I don't think it's a good long-term solution and that it will be used.

@GuillaumeGomez
Copy link
Contributor Author

I can make it more general (by providing a higher crate maybe? The name is video-metadata after all). And as for mp4parse, as long as it doesn't need strange dependencies, it's fine for the moment from my point of view.

@splav
Copy link
Contributor

splav commented Aug 28, 2016

@GuillaumeGomez I was talking about Servo's structure. But sure, this can be changed later.

@splav
Copy link
Contributor

splav commented Aug 28, 2016

As for video-metadata - may be it's ok, but ogg can contain audio as well and checking it twice in two crated seems a bit strange.

@GuillaumeGomez
Copy link
Contributor Author

@splav: For the moment, the thing is to target video to get their size. But if there are pure crates to get audio metadata, I can update video-metadata to add them (I still wonder if I should rename it...).

@est31
Copy link
Contributor

est31 commented Aug 28, 2016

My ogg_metadata crate which video-metadata-rs uses supports audio metadata parsing as well as video metadata parsing: it returns the duration and the sample frequency (at least for vorbis, opus has no fixed sampling frequency).

@splav
Copy link
Contributor

splav commented Aug 28, 2016

@est31, @GuillaumeGomez my point that it should be one metadata wrapper crate for servo for both audio and video containers. The other option is to have one crate for audio and one for video leads to parsing ogg container twice: in both video and audio crates. It seems a bit strange for me.

And IMO the crate rename is the thing that should be done the earlier the better, in case the crate will support both audio and video metadata parsing.

@GuillaumeGomez
Copy link
Contributor Author

I created the new crate (which handles both video and audio metadata) and updated this PR.

let dur = meta.audio.duration.unwrap_or(::std::time::Duration::new(0, 0));
*elem.video.borrow_mut() = Some(VideoMedia {
format: format!("{:?}", meta.format),
duration: Duration::seconds(dur.as_secs() as i64) +
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use Duration::from_std() here?

Copy link
Contributor

@splav splav Aug 29, 2016

Choose a reason for hiding this comment

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

And why not just clone()? Or at least new()

Copy link
Contributor

Choose a reason for hiding this comment

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

@splav dur is of type std::time::Duration, while the VideoMedia struct requires time::Duration from the time crate.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, yep.

@nox
Copy link
Contributor

nox commented Aug 29, 2016

Think you could publish audio_video_metadata? Would be great to avoid yet another Git dependency.

@GuillaumeGomez
Copy link
Contributor Author

@nox: No, I have mixed origin for this crate (because mp4rust didn't merge my PR yet) so I can't publish it for the moment.

@bors-servo
Copy link
Contributor

⌛ Trying commit 04a9f1b with merge d9c324d...

bors-servo pushed a commit that referenced this pull request Aug 29, 2016
Put back video metadata

I updated the `video-metadata-rs` crate: now, no more ffmpeg, just pure rust. The webm format isn't checked yet.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13094)
<!-- Reviewable:end -->
@GuillaumeGomez
Copy link
Contributor Author

GuillaumeGomez commented Aug 29, 2016

@bors-servo: try retry

@bors-servo
Copy link
Contributor

⌛ Trying commit 04a9f1b with merge 14c1a39...

bors-servo pushed a commit that referenced this pull request Aug 29, 2016
Put back video metadata

I updated the `video-metadata-rs` crate: now, no more ffmpeg, just pure rust. The webm format isn't checked yet.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13094)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - linux-dev

@nox
Copy link
Contributor

nox commented Sep 9, 2016

Not only this PR introduces timeouts, but it doesn't seem to make any new test pass.

@GuillaumeGomez
Copy link
Contributor Author

Updated.

@jdm
Copy link
Member

jdm commented Sep 9, 2016

The timeouts are fine, since the reflect the actual state of the world when it comes to audio elements. The current HTMLMediaElement code just lies about understanding audio metadata.

@nox nox removed the S-needs-rebase There are merge conflict errors. label Sep 9, 2016
@nox
Copy link
Contributor

nox commented Sep 9, 2016

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 94379bf has been approved by nox

@highfive highfive assigned nox and unassigned Ms2ger Sep 9, 2016
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Sep 9, 2016
@bors-servo
Copy link
Contributor

⌛ Testing commit 94379bf with merge 60d4c03...

bors-servo pushed a commit that referenced this pull request Sep 9, 2016
Put back video metadata

I updated the `video-metadata-rs` crate: now, no more ffmpeg, just pure rust. The webm format isn't checked yet.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13094)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - arm64

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Sep 9, 2016
@KiChjang
Copy link
Contributor

KiChjang commented Sep 9, 2016

@bors-servo r+

  • Little PIP-y boy is annoying

@bors-servo
Copy link
Contributor

💡 This pull request was already approved, no need to approve it again.

@bors-servo
Copy link
Contributor

📌 Commit 94379bf has been approved by KiChjang

@highfive highfive assigned KiChjang and unassigned nox Sep 9, 2016
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Sep 9, 2016
@KiChjang
Copy link
Contributor

KiChjang commented Sep 9, 2016

@bors-servo retry

@bors-servo
Copy link
Contributor

⌛ Testing commit 94379bf with merge 142578f...

bors-servo pushed a commit that referenced this pull request Sep 9, 2016
Put back video metadata

I updated the `video-metadata-rs` crate: now, no more ffmpeg, just pure rust. The webm format isn't checked yet.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13094)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

@bors-servo bors-servo merged commit 94379bf into servo:master Sep 9, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Sep 9, 2016
@GuillaumeGomez GuillaumeGomez deleted the the_comeback branch September 9, 2016 23:16
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.

None yet

10 participants