wx.media resize video

Hi, I am using wx.media to play video files which are quite small and wondered if there was a way to resize the video to make it bigger?
I am using the MediaCtrl.py from the Wxpython Demo. What would I need to add where to resize the video please?

Kind regards.

I use wxMediaCtrl inside a Sizer and I think the Sizer just handles
it all.

David
···
    Hi, I am using wx.media to play video files which

are quite small and wondered if there was a way to resize the
video to make it bigger?
I am using the MediaCtrl.py from the Wxpython Demo. What
would I need to add where to resize the video please?

Kind regards.

  You received this message because you are subscribed to the Google

Groups “wxPython-users” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to wxpython-users+unsubscribe@googlegroups.com.

  For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

Hi David, I can now get it to resize, but the when the video resizes it loose its aspect ratio (proportional size). I have tried using wx.SHAPED but this doesn’t seem to keep the original shape. I am on Mac, Python 2.7.11. Here is what I currently have, what am I doing wrong?

import wx
import wx.media
import os

class TestPanel(wx.Panel):
def init(self, parent, log):
self.log = log
wx.Panel.init(self, parent, -1)

    try:
        self.mc = wx.media.MediaCtrl(self, style=wx.SIMPLE_BORDER)
    except NotImplementedError:
        self.Destroy()
        raise

    sizer = wx.StaticBoxSizer(wx.StaticBox(self),wx.HORIZONTAL)
    sizer.Add(self.mc, wx.SHAPED)
    self.SetSizer(sizer)
    wx.CallAfter(self.DoLoadFile, os.path.abspath("Video_683x384.mp4"))
    self.mc.ShowPlayerControls()

def DoLoadFile(self, path):
    if not self.mc.Load(path):
        wx.MessageBox("Unable to load %s: Unsupported format?" % path,
                      "ERROR",
                      wx.ICON_ERROR | wx.OK)
    else:
        self.mc.SetInitialSize()
        self.GetSizer().Layout()

app = wx.App()
frame = wx.Frame(None, -1, “TestPanel”, size = (735, 473))
TestPanel(frame, -1)
frame.Show(1)
app.MainLoop()

``

···

On Thursday, May 26, 2016 at 8:44:36 PM UTC+1, David wrote:

I use wxMediaCtrl inside a Sizer and I think the Sizer just handles

it all.

David
    Hi, I am using wx.media to play video files which

are quite small and wondered if there was a way to resize the
video to make it bigger?
I am using the MediaCtrl.py from the Wxpython Demo. What
would I need to add where to resize the video please?

Kind regards.

  You received this message because you are subscribed to the Google

Groups “wxPython-users” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to wxpython-user...@googlegroups.com.

  For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

Here you have an example of how to make a videoplayer with mediaControl: wxPython: Creating a Simple Media Player - Mouse Vs Python
If you have the MediaPlayer properrly configured you should be able to execute the code (at least one of them If I’m not mistaken) without any issues

I usually use vlc bindings to make my work and with vlc I put the vlc Instance inside a BoxSizer in order to add the controls of the video and some menus.

Hope it helps

···

El jueves, 26 de mayo de 2016, 20:51:43 (UTC+2), kevjwells escribió:

Hi, I am using wx.media to play video files which are quite small and wondered if there was a way to resize the video to make it bigger?
I am using the MediaCtrl.py from the Wxpython Demo. What would I need to add where to resize the video please?

Kind regards.

Hi, I sorted out the aspect ratio for wxMediaCtrl, I just needed to use wx.SHAPED.
Marcos, I tried using VLC, but couldn’t get it working, read my post below:

https://forum.videolan.org/viewtopic.php?f=32&t=133191&sid=45829b4f2cbbbbeed6b9b78fbec668ee

···

On Friday, May 27, 2016 at 7:06:50 AM UTC+1, Marcos del Amo wrote:

Here you have an example of how to make a videoplayer with mediaControl: http://www.blog.pythonlibrary.org/2010/07/24/wxpython-creating-a-simple-media-player/
If you have the MediaPlayer properrly configured you should be able to execute the code (at least one of them If I’m not mistaken) without any issues

I usually use vlc bindings to make my work and with vlc I put the vlc Instance inside a BoxSizer in order to add the controls of the video and some menus.

Hope it helps

El jueves, 26 de mayo de 2016, 20:51:43 (UTC+2), kevjwells escribió:

Hi, I am using wx.media to play video files which are quite small and wondered if there was a way to resize the video to make it bigger?
I am using the MediaCtrl.py from the Wxpython Demo. What would I need to add where to resize the video please?

Kind regards.

I put the size in the MediaCtrl command, e.g.:

self.player = wx.media.MediaCtrl(self,-1,size=(588,448))

This works for me. I see that in your example you didn’t specify the size.

Patrick