rjw57 / yt

Experiments with the YouTube API
MIT License
83 stars 25 forks source link

Different commands based on video aspect #17

Open parkerlreed opened 10 years ago

parkerlreed commented 10 years ago

This may sound really weird and is more of a feature request than a bug.

I have a machine setup without X11 installed. It is primarily just using tty and framebuffer when I need graphics.

mplayer has an fbdev video output mode for situations where you want to watch a video on the framebuffer.

mplayer by default plays the video at whatever size it is normally. SO if you have a 1280x720 video ona a1366x768 screen you get some border and of you have a 720x480 video on a 1366x768 screen you get big borders. (It errors out on videos larger than the framebuffer screen size but I'll get to that in a sec)

mplayer graciously has the option to scale videos up or down to match the framebuufer screen size.

mplayer -vo fbdev2 -zoom -xy 1366 video.file

This will scale videos to the horizontal 1366. This is fine for 16:9 and 16:10 videos. The issue comes in when you have a 4:3 video and use those options. It will scale the horizontal to 1366 but then that make the vertical res 1024 and errors out (Because 1024 is greater than the 768)

Short of a patch for mplayer I was thinking having something like

if 4:3 ['mplayer', '-vo', 'fbdev2', '-zoom', '-xy', '1024', '-quiet', '', '--', url.decode('UTF-8').strip()],

if 16:9 or 16:10 ['mplayer', '-vo', 'fbdev2', '-zoom', '-xy', '1366, '-quiet', '', '--', url.decode('UTF-8').strip()],

I know this is an extreme use case but would be great to have the option. Obviously people could change that to suite their particular screen size.

hololight commented 10 years ago

If I get a chance ill look at this. May also require specifying framebuffer since it is not always the same on all systems.

parkerlreed commented 10 years ago

Very true. There is also fbdev and directfb. Thanks for the reply. :D

parkerlreed commented 10 years ago

Just as a small follow up. Each aspect would most likely need it's own command. Didn't actually try a 16:10 video until after posting the issue. I'm actually seeing what I can do in the code with my limited experience with python. (Now is as good of a time to learn as any)