Discussion:
wxpython: wx.media.MediaCtrl with icecast streaming: won't work as expected.
(too old to reply)
nextime
2009-05-30 00:57:33 UTC
Permalink
Hello all.

I'm fighting with a strange issue that smell like a bug.

Short version:
--------------

I'm trying to open an ogg audio stream from an icecast server. No video,
just audio. I need to do this in a cross-platform client (osx, win,
linux).

- On Linux, with gstreamer, it work great.
- On windows, i have some issues in vista cause of the codec, and some
strange things happens, but more or less it work.
- On OSX, it work "ramdomly"


Long version:
-------------

wx version: 2.8.10.1
python version: 2.5.2

I do basically the same thing on all the three OS:

self.mc = wx.media.MediaCtrl(mypanel)
self.Bind(...)
self.mc.LoadFromURI(myurl)

and when the loaded event is fired:

self.mc.Play()

This on linux is working perfectly, i can hear my stream, it is rapid in
loading it, it sounds good.

On Windows, it work ( except from some codec questions, but this is
another story ), it is a little "slow" in loading the remote stream,
about 15 seconds before i get the loaded event fired, and also i need to
call self.mc.LoadFromURI() 2 times or the loaded event will be not fired
at all.

On OSX, i also need to call 2 times self.mc.LoadFromURI(), it is also
slow, but the loaded event get fired 1 time every 4/5 try, apparently in
a random manner.

My code is here:
http://www.astronomix.org/trac/browser/trunk/skylive-ng/src/gui/stream.py

Anyone have any suggestion or idea on how to solve my issue?
--
Franco (nextime) Lanza
Busto Arsizio - Italy
SIP://***@casa.nexlab.it

NO TCPA: http://www.no1984.org
you can download my public key at:
http://danex.nexlab.it/nextime.asc || Key Servers
Key ID = D6132D50
Key fingerprint = 66ED 5211 9D59 DA53 1DF7 4189 DFED F580 D613 2D50
-----------------------------------
echo 16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D212153574F444E49572045535520454D20454B414D204F54204847554F4E452059415020544F4E4E4143205345544147204C4C4942snlbxq | dc
-----------------------------------
Jacob
2009-05-30 12:02:34 UTC
Permalink
Have you tried upgrading your version of Python to 2.6? Perhaps there is an
issue with the way python is handling something on the OS. It works on Linux
like it should you say.


Jacob
Post by nextime
Hello all.
I'm fighting with a strange issue that smell like a bug.
--------------
I'm trying to open an ogg audio stream from an icecast server. No video,
just audio. I need to do this in a cross-platform client (osx, win,
linux).
- On Linux, with gstreamer, it work great.
- On windows, i have some issues in vista cause of the codec, and some
strange things happens, but more or less it work.
- On OSX, it work "ramdomly"
-------------
wx version: 2.8.10.1
python version: 2.5.2
self.mc = wx.media.MediaCtrl(mypanel)
self.Bind(...)
self.mc.LoadFromURI(myurl)
self.mc.Play()
This on linux is working perfectly, i can hear my stream, it is rapid in
loading it, it sounds good.
On Windows, it work ( except from some codec questions, but this is
another story ), it is a little "slow" in loading the remote stream,
about 15 seconds before i get the loaded event fired, and also i need to
call self.mc.LoadFromURI() 2 times or the loaded event will be not fired
at all.
On OSX, i also need to call 2 times self.mc.LoadFromURI(), it is also
slow, but the loaded event get fired 1 time every 4/5 try, apparently in
a random manner.
http://www.astronomix.org/trac/browser/trunk/skylive-ng/src/gui/stream.py
Anyone have any suggestion or idea on how to solve my issue?
--
Franco (nextime) Lanza
Busto Arsizio - Italy
NO TCPA: http://www.no1984.org
http://danex.nexlab.it/nextime.asc || Key Servers
Key ID = D6132D50
Key fingerprint = 66ED 5211 9D59 DA53 1DF7 4189 DFED F580 D613 2D50
-----------------------------------
echo
16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D212153574F444E49572045535520454D20454B414D204F54204847554F4E452059415020544F4E4E4143205345544147204C4C4942snlbxq
| dc
-----------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkoghH0ACgkQ3+31gNYTLVA1ggCgmeKLAO+WLQgIyDDhOExOSuI5
VgsAoKqg8sN1turduVdwkPO/saGHYs6i
=y8tc
-----END PGP SIGNATURE-----
_______________________________________________
wx-users mailing list
http://lists.wxwidgets.org/mailman/listinfo/wx-users
nextime
2009-05-31 10:00:53 UTC
Permalink
After trying also to update, the issue remain the same.
But i've found something new.

After many try, i found that if i try to open the stream using
mplayer ( with subprocess.Popen ), if i set the -nocache option in the
mplayer command line, i don't get any sound and i see in stdout "stream
not seekable", if i put a -cache 32, all work great.

The same using directly WMP, if i let the player doing some caching, it
work, if i set cache to 0 it won't work.

So, maybe can be just a caching issue, on gstreamer it work, but on
quicktime and wmp if i don't let the player doing some minimal caching,
the stream won't work, and wx.media.mediactrl seem to launch the player
without any caching.

Is there any way to set a minimal cache on both wmp and quicktime?
Post by Jacob
Have you tried upgrading your version of Python to 2.6? Perhaps there is an
issue with the way python is handling something on the OS. It works on Linux
like it should you say.
Jacob
Post by nextime
Hello all.
I'm fighting with a strange issue that smell like a bug.
--------------
I'm trying to open an ogg audio stream from an icecast server. No video,
just audio. I need to do this in a cross-platform client (osx, win,
linux).
- On Linux, with gstreamer, it work great.
- On windows, i have some issues in vista cause of the codec, and some
strange things happens, but more or less it work.
- On OSX, it work "ramdomly"
-------------
wx version: 2.8.10.1
python version: 2.5.2
self.mc = wx.media.MediaCtrl(mypanel)
self.Bind(...)
self.mc.LoadFromURI(myurl)
self.mc.Play()
This on linux is working perfectly, i can hear my stream, it is rapid in
loading it, it sounds good.
On Windows, it work ( except from some codec questions, but this is
another story ), it is a little "slow" in loading the remote stream,
about 15 seconds before i get the loaded event fired, and also i need to
call self.mc.LoadFromURI() 2 times or the loaded event will be not fired
at all.
On OSX, i also need to call 2 times self.mc.LoadFromURI(), it is also
slow, but the loaded event get fired 1 time every 4/5 try, apparently in
a random manner.
http://www.astronomix.org/trac/browser/trunk/skylive-ng/src/gui/stream.py
Anyone have any suggestion or idea on how to solve my issue?
--
Franco (nextime) Lanza
Busto Arsizio - Italy
NO TCPA: http://www.no1984.org
http://danex.nexlab.it/nextime.asc || Key Servers
Key ID = D6132D50
Key fingerprint = 66ED 5211 9D59 DA53 1DF7 4189 DFED F580 D613 2D50
-----------------------------------
echo
16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D212153574F444E49572045535520454D20454B414D204F54204847554F4E452059415020544F4E4E4143205345544147204C4C4942snlbxq
| dc
-----------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkoghH0ACgkQ3+31gNYTLVA1ggCgmeKLAO+WLQgIyDDhOExOSuI5
VgsAoKqg8sN1turduVdwkPO/saGHYs6i
=y8tc
-----END PGP SIGNATURE-----
_______________________________________________
wx-users mailing list
http://lists.wxwidgets.org/mailman/listinfo/wx-users
_______________________________________________
wx-users mailing list
http://lists.wxwidgets.org/mailman/listinfo/wx-users
--
Franco (nextime) Lanza
Busto Arsizio - Italy
SIP://***@casa.nexlab.it

NO TCPA: http://www.no1984.org
you can download my public key at:
http://danex.nexlab.it/nextime.asc || Key Servers
Key ID = D6132D50
Key fingerprint = 66ED 5211 9D59 DA53 1DF7 4189 DFED F580 D613 2D50
-----------------------------------
echo 16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D212153574F444E49572045535520454D20454B414D204F54204847554F4E452059415020544F4E4E4143205345544147204C4C4942snlbxq | dc
-----------------------------------
Steve Cookson
2009-05-31 12:44:52 UTC
Permalink
Hi Franco,

It's good to hear that I'm not the only one using wxMediaCtrl :)

Although it has a steep learning curve, I do seem to get around all my
problems eventually. And I now have a nice display of wxMediaCtrl and I
even have some editing going on.

With regard to your problem:

1) Firstly, do you have control over the server end? Maybe you could
experiment with using a different codec?

2) Secondly Windows is generally very tolerant of poor encoding, but VLC is
better. There is a VLC backend out there somewhere:

http://www.nabble.com/Introduction-%2B-patches-for-wxGrid-%2B-proposal-for-v
lcbackend-td20090167.html

But it's not part of wxWidgets yet (apparently).

I think it would be very a nice addition.

Try using VLC standalone and see if it works.

Good luck.

Regards

Steve

São Paulo,
Brasil



-----Original Message-----
From: wx-users-***@lists.wxwidgets.org
[mailto:wx-users-***@lists.wxwidgets.org] On Behalf Of nextime
Sent: 31 May 2009 07:01
To: wx-***@lists.wxwidgets.org
Subject: Re: wxpython: wx.media.MediaCtrl with icecast streaming: won'twork
as expected.

After trying also to update, the issue remain the same.
But i've found something new.

After many try, i found that if i try to open the stream using mplayer (
with subprocess.Popen ), if i set the -nocache option in the mplayer command
line, i don't get any sound and i see in stdout "stream not seekable", if i
put a -cache 32, all work great.

The same using directly WMP, if i let the player doing some caching, it
work, if i set cache to 0 it won't work.

So, maybe can be just a caching issue, on gstreamer it work, but on
quicktime and wmp if i don't let the player doing some minimal caching, the
stream won't work, and wx.media.mediactrl seem to launch the player without
any caching.

Is there any way to set a minimal cache on both wmp and quicktime?
Post by Jacob
Have you tried upgrading your version of Python to 2.6? Perhaps there
is an issue with the way python is handling something on the OS. It
works on Linux like it should you say.
Jacob
Post by nextime
Hello all.
I'm fighting with a strange issue that smell like a bug.
--------------
I'm trying to open an ogg audio stream from an icecast server. No
video, just audio. I need to do this in a cross-platform client
(osx, win, linux).
- On Linux, with gstreamer, it work great.
- On windows, i have some issues in vista cause of the codec, and
some strange things happens, but more or less it work.
- On OSX, it work "ramdomly"
-------------
wx version: 2.8.10.1
python version: 2.5.2
self.mc = wx.media.MediaCtrl(mypanel)
self.Bind(...)
self.mc.LoadFromURI(myurl)
self.mc.Play()
This on linux is working perfectly, i can hear my stream, it is
rapid in loading it, it sounds good.
On Windows, it work ( except from some codec questions, but this is
another story ), it is a little "slow" in loading the remote stream,
about 15 seconds before i get the loaded event fired, and also i
need to call self.mc.LoadFromURI() 2 times or the loaded event will
be not fired at all.
On OSX, i also need to call 2 times self.mc.LoadFromURI(), it is
also slow, but the loaded event get fired 1 time every 4/5 try,
apparently in a random manner.
http://www.astronomix.org/trac/browser/trunk/skylive-ng/src/gui/stre
am.py
Anyone have any suggestion or idea on how to solve my issue?
--
Franco (nextime) Lanza
Busto Arsizio - Italy
NO TCPA: http://www.no1984.org
http://danex.nexlab.it/nextime.asc || Key Servers Key ID = D6132D50
Key fingerprint = 66ED 5211 9D59 DA53 1DF7 4189 DFED F580 D613 2D50
-----------------------------------
echo
16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D212153574F444E4957204553552045
4D20454B414D204F54204847554F4E452059415020544F4E4E414320534554414720
4C4C4942snlbxq
| dc
-----------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkoghH0ACgkQ3+31gNYTLVA1ggCgmeKLAO+WLQgIyDDhOExOSuI5
VgsAoKqg8sN1turduVdwkPO/saGHYs6i
=y8tc
-----END PGP SIGNATURE-----
_______________________________________________
wx-users mailing list
http://lists.wxwidgets.org/mailman/listinfo/wx-users
_______________________________________________
wx-users mailing list
http://lists.wxwidgets.org/mailman/listinfo/wx-users
--
Franco (nextime) Lanza
Busto Arsizio - Italy
SIP://***@casa.nexlab.it

NO TCPA: http://www.no1984.org
you can download my public key at:
http://danex.nexlab.it/nextime.asc || Key Servers Key ID = D6132D50 Key
fingerprint = 66ED 5211 9D59 DA53 1DF7 4189 DFED F580 D613 2D50
-----------------------------------
echo
16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D212153574F444E49572045535520454D20454B
414D204F54204847554F4E452059415020544F4E4E4143205345544147204C4C4942snlbxq |
dc
-----------------------------------
nextime
2009-05-31 14:04:03 UTC
Permalink
Post by Steve Cookson
1) Firstly, do you have control over the server end? Maybe you could
experiment with using a different codec?
Yes, but i'm something limited on codec/bitrate. My stream is the
icecast broadcasting of an asterisk audio conference, so, i can just
stream in mp3 and ogg, other encodings aren't feasible without crude
hacks.

Also, i need to limit the more i can the bitrate couse i need to have
about 3/4000 users (concurrents) when i need to stream, and my bandwidth
is limited.

With linux no problem at all, with windows i can use oggcodecs and it
work great for win <= XP, but oggcodecs have some problems with some
windows vista and seven, so i need also mp3 stream for those.
Post by Steve Cookson
2) Secondly Windows is generally very tolerant of poor encoding, but VLC is
http://www.nabble.com/Introduction-%2B-patches-for-wxGrid-%2B-proposal-for-v
lcbackend-td20090167.html
I love vlc and i use it for many things. Anyway, i can't use it in this
case cause i don't have the control of what my users ( many of which are
not computer skilled people ) have installed, and to use vlc api i need
to have also VLC installed on the client. This is why i want to use
wx.media, cause it wrap the "standard" media player that i can assert to
be present on the client. I distribute my app in both sources and
pre-packaged py2exe/py2app stand-alone application to be sure i have all
dependencies ( a lot ) installed.

In this context, i can think to use wx.media on linux (where it work
great), and maybe to use win32com api on windows ( controlling wmp this
way seem to work good, but i don't like to put platform dependant code),
but this way i don't cover osx/quicktime without using wx.media.

I'm thinking in using an embedded mplayer compiled static for
windows/osx and simply command it with subprocess.Popen, but if wx.media
will work in a reliable way, i prefer to use it.
Post by Steve Cookson
Try using VLC standalone and see if it works.
It work. But also wmp and quicktime are working stand-alone...
--
Franco (nextime) Lanza
Busto Arsizio - Italy
SIP://***@casa.nexlab.it

NO TCPA: http://www.no1984.org
you can download my public key at:
http://danex.nexlab.it/nextime.asc || Key Servers
Key ID = D6132D50
Key fingerprint = 66ED 5211 9D59 DA53 1DF7 4189 DFED F580 D613 2D50
-----------------------------------
echo 16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D212153574F444E49572045535520454D20454B414D204F54204847554F4E452059415020544F4E4E4143205345544147204C4C4942snlbxq | dc
-----------------------------------
nextime
2009-06-05 07:14:15 UTC
Permalink
Well, making some extra tests, there are some news about my issue.

On Sat, May 30, 2009 at 02:57:33AM +0200, nextime wrote:
--SNIP--
Post by nextime
I'm trying to open an ogg audio stream from an icecast server. No video,
just audio. I need to do this in a cross-platform client (osx, win,
linux).
- On Linux, with gstreamer, it work great.
... And it continue to work absolutely great
Post by nextime
- On windows, i have some issues in vista cause of the codec, and some
strange things happens, but more or less it work.
... A little hack solve the problem. Just using mp3 streaming ( bad
thing... but it is a codec issue, not a wxpython one ) and forcing WMP10
backend it work great.
Post by nextime
- On OSX, it work "ramdomly"
Here the problem remain. But it isn't really random, the problem is when
i try to open an icecast stream. Assuming to eliminate every codec
issue, i'm now trying to open the mp3 stream.

Using QuickTime directly, if i try to open the url of my stream,
http://skylive3.astronomix.org:8000/skylive.mp3, it won't work.
But if i do the trick to change http:// with icy://, it work good.

Trying to use http://skylive3.astronomix.org:8000/skylive.mp3.m3u won't
work.

Using wx.media.MediaCtrl, it won't work at all, my stream will never be
opened, and the MEDIA_LOADED event will be never catched, even if i try
to open icy://...

Anyone have an idea on what i can i try?

-- SNIP --
Post by nextime
http://www.astronomix.org/trac/browser/trunk/skylive-ng/src/gui/stream.py
--
Franco (nextime) Lanza
Busto Arsizio - Italy
SIP://***@casa.nexlab.it

NO TCPA: http://www.no1984.org
you can download my public key at:
http://danex.nexlab.it/nextime.asc || Key Servers
Key ID = D6132D50
Key fingerprint = 66ED 5211 9D59 DA53 1DF7 4189 DFED F580 D613 2D50
-----------------------------------
echo 16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D212153574F444E49572045535520454D20454B414D204F54204847554F4E452059415020544F4E4E4143205345544147204C4C4942snlbxq | dc
-----------------------------------
Loading...