[MPlayer-users] dynamically resize video while playing

Alexander Strasser eclipse7 at gmx.net
Sat Aug 8 02:29:33 EEST 2020


On 2020-08-03 15:55 +0000, Darryl Burchfield wrote:
> Thank you for replying.
> I was able to figure out how to get MPlayer to resize to the full screen size.  The screen size can be specified in the constructor.  See below for my solution to this issue.
>
> The code below is written in C# but should be able to do the same with any dotnet language.  It is in a WinForm app ported from Windows to Linux, which was the challenge I was faced with. Mono is required to run a WinForm app on Linux.
>
> using System.Windows.Forms;
> using LibMPlayerCommon;
> // _screen is equal to 0 or 1 according to which screen the video is playing.
> Size = Screen.AllScreens[_screen].Bounds.Size;
> _mPlayer = new MPlayer((long)Handle, MplayerBackends.SDL, "/usr/bin/mplayer", false, new TimeSpan(0, 0, 1), String.Format("-slave -quiet -idle -v -ontop -fs -vf scale={0}:{1}", Size.Width, Size.Height));
>
> I now have the app running on Debian with a little cleanup to do.   Thanks for your help.

I assume my interpretation of the situation was mostly correct then.

So while your solution kind of works I think it's showing that
something is not working so well. If you have to resize in software
(-vf scale) for playback, it usually shows that the video output you
use is probably not very efficient and that there might be more
typical playback problems like no vsync etc.

IIRC I have written some pointers in my initial reply. Glad you
found a way to get things working, but re-reading my mail might
give you some hints on how to further evaluate the possibilities
and improve your applications.

Good Luck!


  Alexander

> ________________________________
> From: MPlayer-users <mplayer-users-bounces at mplayerhq.hu> on behalf of The Wanderer <wanderer at fastmail.fm>
> Sent: Wednesday, July 29, 2020 5:35 PM
> To: mplayer-users at mplayerhq.hu <mplayer-users at mplayerhq.hu>
> Subject: Re: [MPlayer-users] dynamically resize video while playing
>
> On 2020-07-29 at 14:17, Alexander Strasser wrote:
>
> > Hi!
> >
> > On 2020-07-27 14:40 +0000, Darryl Burchfield wrote:
> >
> >> Is MPlayer capable of resizing a video while playing. I have an
> >> application that runs on imbedded systems with two different
> >> display sizes but with the same video for both displays.  The app
> >> is a Windows 7/10 app written in C# but I am porting it over to
> >> Linux by running the app with Mono on Debian.  I do have the video
> >> playing on Linux but it does not resize to the actual size of the
> >> display.
> >
> > Heavily depends on the exact circumstances.
>
> <snip>
>
> > Hope that helps a bit. I must admit didn't completely understand
> > your exact setup and your motivation.
>
> I parse the situation as being:
>
> * A single computer, connected to two different monitors with different
> resolutions.
>
> * Using a "mirror" display configuration, so that both monitors display
> the same content. (Depending on the details, in some cases it may be
> possible to have this happen with the content dynamically rescaled to
> fit whichever monitor is involved. The nearest real-world examples I can
> think of from the Windows world involve "extend" configurations rather
> than "mirror", though.)
>
> * Want to have the video rescaled on the fly so that it exactly fits the
> screens of both monitors at once, irrespective of their different
> resolutions. (Vs. fitting one screen but being either too large or too
> small for the other, as apparently happens now.)
>
> At a glance, that looks to me as if it's not an issue for MPlayer, or
> for any given video-producing application, but for whatever is doing
> the "mirror"ing of the displays. I have basically no dual-displays
> experience under Linux, to date, so I can't really advise here.
>
> The question to get started investigating would probably be: what
> exactly does "with the same video for both displays" mean, and what
> software is producing that behavior? My guesses about the former are
> above, but I have no idea about the latter.
>
> --
>    The Wanderer


More information about the MPlayer-users mailing list