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:
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://ca...@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
-----------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkoghH0ACgkQ3+31gNYTLVA1ggCgmeKLAO+WLQgIyDDhOExOSuI5
VgsAoKqg8sN1turduVdwkPO/saGHYs6i
=y8tc
-----END PGP SIGNATURE-----
_______________________________________________
wx-users mailing list
wx-u...@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wx-users
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?
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
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.
> 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
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.
>
> Try using VLC standalone and see if it works.
It work. But also wmp and quicktime are working stand-alone...
On Sat, May 30, 2009 at 02:57:33AM +0200, nextime wrote:
--SNIP--
>
> 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
> - 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.
> - 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 --
> My code is here:
> http://www.astronomix.org/trac/browser/trunk/skylive-ng/src/gui/stream.py
--