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

bug: video that is flipped or rotated in Cockpit does not record / save in this adjusted orientation. #1501

Open
1 task done
vshie opened this issue Dec 10, 2024 · 7 comments
Labels
bug Something isn't working ui UI related issues

Comments

@vshie
Copy link

vshie commented Dec 10, 2024

Bug description

Video streams can (very nicely) be rotated (even multiple times1) or flipped. However, when the recording is downloaded, the video is in the original orientation.

Steps to reproduce

Rotate video stream in edit interface menu, then make a recording. Rotation/flip of displayed video will not match recording.

Primary pain point(s)

The browser decodes, and then we flip, but João mentions that it may be possible to hint the correct orientation in the recording?

Additional context

No response

Prerequisites

  • I have checked to make sure that a similar request has not already been filed or fixed.
@vshie vshie added bug Something isn't working ui UI related issues labels Dec 10, 2024
@joaoantoniocardoso
Copy link
Member

Yeah, the video's metadata contains a rotation field for that purpose. Cockpit should be able to change it after processing the chunks.

@rafaellehmkuhl
Copy link
Member

Yeah, the video's metadata contains a rotation field for that purpose. Cockpit should be able to change it after processing the chunks.

Problem is we have to reprocess the chunk, right?

@joaoantoniocardoso
Copy link
Member

joaoantoniocardoso commented Dec 11, 2024

Yeah, the video's metadata contains a rotation field for that purpose. Cockpit should be able to change it after processing the chunks.

Problem is we have to reprocess the chunk, right?

So the two options are:

  1. Change the metadata of the final .mp4 video file and don't mess with the file data, should be quick.
  2. Decode, change rotate/flip frame frame, then re-encode every frame. We might want to do it since we are going to have a video processing pipeline anyway (for color lens and color correction, for example)

@ES-Alexander
Copy link
Contributor

Option 2 seems useful, but advanced. In cases where there isn't already processing happening it would be preferable to support option 1, especially for the sake of lower end systems that could struggle with encoding.

@rafaellehmkuhl
Copy link
Member

Although option 1 seems ideal, I'm struggling to find any way to do this in the browser @joaoantoniocardoso. If you have any clue let me know.

Would be ffmpeg.wasm to go.

@joaoantoniocardoso
Copy link
Member

Would be ffmpeg.wasm to go.

Yep, the ffmpeg can do that, I expect the wasm version to also be capable. Maybe something like https://www.npmjs.com/mp4js could also do that

@ES-Alexander
Copy link
Contributor

Noting that semantically the video recorder mini-widget acts on the incoming video stream, and is unrelated to any video display widget configuration options. Multiple display widgets could show the same stream in different ways, and we generally don't want or expect things like the widget scale or cropping to affect the recorded video.

If we wanted to record a stream as flipped/rotated then we'd need to add controls for that in the video configuration section, and potentially remove them from the video widget (if we don't expect users to need to handle them independently for different outputs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ui UI related issues
Projects
None yet
Development

No branches or pull requests

4 participants