RSATom / WebChimera.js

[ABANDONED] libvlc binding for Electron
GNU Lesser General Public License v2.1
661 stars 104 forks source link

How to get "display" width and height for anamorphic videos? #107

Closed romaincointepas closed 3 years ago

romaincointepas commented 8 years ago

onFrameSetup returns width and height that should not be used to calculate the dimensions/ratio of the canvas for anamorphic videos (aka non-square pixels).

I thought the pixelFormat argument was here to help (by giving the pixel ratio, the equivalent of sample_aspect_ratio when using ffprobe), but it seems to always return 1 even for anamorphic videos.

This can be easily reproduced with the following video: https://mega.nz/#!cwZUiCTA!oP0RUNe93M-qsUDGxhG-hjJV6WU20oo2a9y9zt2frUQ

VLC itself being able to size anamorphic videos correctly, I assume that either there is a bug with pixelFormat that shouldn't be returning 1, or another argument may be added to handle correct sizing of anamorphic videos.

My personal suggestion would be that because WebChimera.js is meant to be used in a HTML environment, width and height should directly be converted to "display" dimensions to be directly used to size the canvas and pixelFormat should be removed. (In the above example, width and height would then be 853x480).

Any thoughts?

RSATom commented 8 years ago

It's known issue of libvlc's vmem plugin. There are just no way to get pixel aspect ratio from libvlc. It could be solved by custom plugin - something like vmem2, but unfortunately I can't find time to finish it.

RSATom commented 8 years ago

pixelFormat is just enum which could be VlcPlayer.RV32 (= 0) or VlcPlayer.I420 (= 1)

romaincointepas commented 7 years ago

@RSATom Got it, thanks! Do you know if libvlc 3.0 will make this possible without a custom plugin?

RSATom commented 7 years ago

Don't think so. Only if somebody will finish vmem2 (or something similar) and will send patch to videolan team.

RSATom commented 3 years ago

Closed as too old.