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
Put back video metadata #13094
Conversation
Heads up! This PR modifies the following files:
|
Does this require additional libraries to be installed on users' system? |
No. That's the whole point and the great improvement. |
cc @splav This will impact the plans for using mp4parse. |
r? @Manishearth |
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? |
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. |
@GuillaumeGomez I was talking about Servo's structure. But sure, this can be changed later. |
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. |
@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...). |
My |
@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. |
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) + |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yep.
Think you could publish audio_video_metadata? Would be great to avoid yet another Git dependency. |
@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. |
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: try retry |
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 -->
💔 Test failed - linux-dev |
Not only this PR introduces timeouts, but it doesn't seem to make any new test pass. |
Updated. |
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. |
@bors-servo r+ |
📌 Commit 94379bf has been approved by |
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 -->
💔 Test failed - arm64 |
@bors-servo r+
|
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 94379bf has been approved by |
@bors-servo retry |
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 -->
☀️ Test successful - arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev |
I updated the
video-metadata-rs
crate: now, no more ffmpeg, just pure rust. The webm format isn't checked yet.This change is