mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-24 11:37:48 -05:00
UI: improve aspect ratio handling
As written in the changelog: Live streams formerly worked around a Firefox pixel aspect ratio bug by forcing all videos to 16:9, which dramatically distorted 9:16 camera views. Playback didn't, so anamorphic videos looked correct on Chrome but slightly stretched on Firefox. Now both live streams and playback are fully correct on all browsers.
This commit is contained in:
@@ -496,15 +496,20 @@ pub struct VideoSampleEntry {
|
||||
pub height: u16,
|
||||
pub pasp_h_spacing: u16,
|
||||
pub pasp_v_spacing: u16,
|
||||
pub aspect_width: u32,
|
||||
pub aspect_height: u32,
|
||||
}
|
||||
|
||||
impl VideoSampleEntry {
|
||||
fn from(e: &db::VideoSampleEntry) -> Self {
|
||||
let aspect = e.aspect();
|
||||
Self {
|
||||
width: e.width,
|
||||
height: e.height,
|
||||
pasp_h_spacing: e.pasp_h_spacing,
|
||||
pasp_v_spacing: e.pasp_v_spacing,
|
||||
aspect_width: *aspect.numer(),
|
||||
aspect_height: *aspect.denom(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user