Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-11-03 Thread Benoît Minisini
Le 03/11/2016 à 13:45, Benoît Minisini a écrit :
> Le 03/11/2016 à 12:02, Piper984 a écrit :
>> Hi Benoît,
>>
>> Just a quick update: I tried running my sample application on a newly
>> installed Ubuntu 16.04, and with my reference video clips and all is
>> working as expected!  Thanks a ton!
>>
>> Of interest, and perhaps some source of issues: Some of the video clips I
>> have for testing (Sintel and Big Buck Bunny trailers in .webm and
>> .mp4) will
>> not 'end' correctly and so the next video clip doesn't load.  *BUT* the
>> actual video clips I want to use (h264 clips converted to MP4 via MP4Box)
>> for my application do work.  gb.media plays them successfully, and when
>> .NextURL is set from the AboutToFinish event then the next video clip is
>> loaded and rendered gaplessly!  Huzzah!
>>
>> So: Thanks for helping with this Benoît.  I appreciate it, as I can
>> dev my
>> application in Gambas now and not Python/C++/Glade GTK tools.
>>
>> Best regards!
>>
>
> As I said, all that seems to heavily depend on which GStreamer version
> you use. I just hope that things becomes more stable with new versions
> of the library!
>
> FYI, the next GStreamer version introduces (again) a new media player
> plugin. So cross your fingers...
>

By the way, thanks for your big early X-Mas gift!

-- 
Benoît Minisini

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-11-03 Thread Benoît Minisini
Le 03/11/2016 à 12:02, Piper984 a écrit :
> Hi Benoît,
>
> Just a quick update: I tried running my sample application on a newly
> installed Ubuntu 16.04, and with my reference video clips and all is
> working as expected!  Thanks a ton!
>
> Of interest, and perhaps some source of issues: Some of the video clips I
> have for testing (Sintel and Big Buck Bunny trailers in .webm and .mp4) will
> not 'end' correctly and so the next video clip doesn't load.  *BUT* the
> actual video clips I want to use (h264 clips converted to MP4 via MP4Box)
> for my application do work.  gb.media plays them successfully, and when
> .NextURL is set from the AboutToFinish event then the next video clip is
> loaded and rendered gaplessly!  Huzzah!
>
> So: Thanks for helping with this Benoît.  I appreciate it, as I can dev my
> application in Gambas now and not Python/C++/Glade GTK tools.
>
> Best regards!
>

As I said, all that seems to heavily depend on which GStreamer version 
you use. I just hope that things becomes more stable with new versions 
of the library!

FYI, the next GStreamer version introduces (again) a new media player 
plugin. So cross your fingers...

-- 
Benoît Minisini

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-11-03 Thread Piper984
Hi Benoît,

Just a quick update: I tried running my sample application on a newly
installed Ubuntu 16.04, and with my reference video clips and all is
working as expected!  Thanks a ton!  

Of interest, and perhaps some source of issues: Some of the video clips I
have for testing (Sintel and Big Buck Bunny trailers in .webm and .mp4) will
not 'end' correctly and so the next video clip doesn't load.  *BUT* the
actual video clips I want to use (h264 clips converted to MP4 via MP4Box)
for my application do work.  gb.media plays them successfully, and when
.NextURL is set from the AboutToFinish event then the next video clip is
loaded and rendered gaplessly!  Huzzah!  

So: Thanks for helping with this Benoît.  I appreciate it, as I can dev my
application in Gambas now and not Python/C++/Glade GTK tools.

Best regards!



--
View this message in context: 
http://gambas.8142.n7.nabble.com/MediaPlayer-bug-with-AboutToFinish-and-URL-tp57513p57714.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-31 Thread Piper984
Hi,

Were you able to confirm that the video clips I attached could play via the
.NextURL + AboutToFinish events successfully on your development machine? 
For what's it's worth, I do see this error message now in the console output
window when after I play any video file (either just one and then the END
event fires, or if I try to set the .NextURL property during the
AboutToFinish event:

The program 'prjVideoTest01' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
  (Details: serial 1632 error_code 9 request_code 150 minor_code 9)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

If you don't have the error (and I am assuming you don't) then perhaps there
is some GTK lib or other dependence I could check into?  

Thanks for looking into this still! I could try to take a screencam type
video of my test running if that would be helpful at all? 




--
View this message in context: 
http://gambas.8142.n7.nabble.com/MediaPlayer-bug-with-AboutToFinish-and-URL-tp57513p57694.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-26 Thread Piper984
OK: attached are some sample clips. These might be the most uninteresting
video clips ever posted on the internet. ;)

test1-002.mp4   
test1-003.mp4   
test1-004.mp4   



--
View this message in context: 
http://gambas.8142.n7.nabble.com/MediaPlayer-bug-with-AboutToFinish-and-URL-tp57513p57623.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-26 Thread Benoît Minisini
Le 27/10/2016 à 00:49, Piper984 a écrit :
> Hello Benoît,
>
> Glad you were able to use the archive.  FYI: Looks like the Nabble website
> removes the .tar from the archive, but it's still a valid .tar file.  I
> opened it on 16.04, 14.04, and Mac OSX, and I could see the source files (I
> did have to turn hidden files off).
>
> Regarding gb.media.form and the MediaView control, when setting the .URL
> during the AboutToFinish() event it is the same as the control from the
> gb.media component.  I see the warning:
>
> gb.media: warning: could not catch end of stream
>
> ... and the next video clip does not load.  I tried the same set of code,
> but changing the .URL to .NextURL but this just made the app hang at the end
> of the first clip.  The 'END' event didn't fire, but the next URL didn't
> load either.  If I invoked the .Stop() method the warning above will print
> to the console.
>
> If you are seeing this work on your development machine(s), could I ask what
> video card you use?  Could the issue be related to the Intel video
> card/driver I am using?  Although all works as expected w/ Python +
> Gstreamer library to maybe that's not the case.
>

I just took your code, replaced .URL by .NextURL inside the 
AboutToFinish event handler, and the two media URLs by URLs that exist 
on my disk. And things worked as expected.

The End event is raised (according to the documentation) when the player 
finishes all its job. Not when a stream ends.

If your streams are not too big, maybe you can send them? Or put them on 
a server so that I can get and test them.

I have an Intel GPU on Ubuntu 16.04.

Regards,

-- 
Benoît Minisini

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-26 Thread Piper984
Hello Benoît,

Glad you were able to use the archive.  FYI: Looks like the Nabble website
removes the .tar from the archive, but it's still a valid .tar file.  I
opened it on 16.04, 14.04, and Mac OSX, and I could see the source files (I
did have to turn hidden files off).

Regarding gb.media.form and the MediaView control, when setting the .URL
during the AboutToFinish() event it is the same as the control from the
gb.media component.  I see the warning:

gb.media: warning: could not catch end of stream

... and the next video clip does not load.  I tried the same set of code,
but changing the .URL to .NextURL but this just made the app hang at the end
of the first clip.  The 'END' event didn't fire, but the next URL didn't
load either.  If I invoked the .Stop() method the warning above will print
to the console.  

If you are seeing this work on your development machine(s), could I ask what
video card you use?  Could the issue be related to the Intel video
card/driver I am using?  Although all works as expected w/ Python +
Gstreamer library to maybe that's not the case.





--
View this message in context: 
http://gambas.8142.n7.nabble.com/MediaPlayer-bug-with-AboutToFinish-and-URL-tp57513p57621.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-26 Thread Benoît Minisini
Le 27/10/2016 à 01:43, Benoît Minisini a écrit :
> Le 27/10/2016 à 01:41, Benoît Minisini a écrit :
>> Le 27/10/2016 à 01:37, Benoît Minisini a écrit :
>>> Le 26/10/2016 à 23:59, Piper984 a écrit :
 ok: Attached is the file that is produced via Project -> make -> source
 archive.

 Thanks!

 prjVideoTest01-0.gz
 

>>>
>>> Are you kidding? Your project is still almost void and unusable (no
>>> media player in it at all), and did you really create the source archive
>>> with the IDE? The IDE creates "tar.gz" files.
>>>
>>> Regards,
>>>
>>
>> Sorry, I found the media player. Can you do the same thing with the
>> MediaView control of gb.web.form? And tell me if it works for you?
>>
>
> By the way: if you want to create a media URL from a local file path,
> you can use the Media.URL() method.
>

OK, I found. You must use the NextURL property, not the URL property. 
Setting the URL property directly resets the player, and even can crash 
GStreamer if it is done while it is finishing a stream.

Regards,

-- 
Benoît Minisini

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-26 Thread Benoît Minisini
Le 27/10/2016 à 01:41, Benoît Minisini a écrit :
> Le 27/10/2016 à 01:37, Benoît Minisini a écrit :
>> Le 26/10/2016 à 23:59, Piper984 a écrit :
>>> ok: Attached is the file that is produced via Project -> make -> source
>>> archive.
>>>
>>> Thanks!
>>>
>>> prjVideoTest01-0.gz
>>> 
>>>
>>
>> Are you kidding? Your project is still almost void and unusable (no
>> media player in it at all), and did you really create the source archive
>> with the IDE? The IDE creates "tar.gz" files.
>>
>> Regards,
>>
>
> Sorry, I found the media player. Can you do the same thing with the
> MediaView control of gb.web.form? And tell me if it works for you?
>

By the way: if you want to create a media URL from a local file path, 
you can use the Media.URL() method.

-- 
Benoît Minisini

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-26 Thread Benoît Minisini
Le 27/10/2016 à 01:37, Benoît Minisini a écrit :
> Le 26/10/2016 à 23:59, Piper984 a écrit :
>> ok: Attached is the file that is produced via Project -> make -> source
>> archive.
>>
>> Thanks!
>>
>> prjVideoTest01-0.gz
>> 
>>
>
> Are you kidding? Your project is still almost void and unusable (no
> media player in it at all), and did you really create the source archive
> with the IDE? The IDE creates "tar.gz" files.
>
> Regards,
>

Sorry, I found the media player. Can you do the same thing with the 
MediaView control of gb.web.form? And tell me if it works for you?

-- 
Benoît Minisini

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-26 Thread Benoît Minisini
Le 26/10/2016 à 23:59, Piper984 a écrit :
> ok: Attached is the file that is produced via Project -> make -> source
> archive.
>
> Thanks!
>
> prjVideoTest01-0.gz
> 
>

Are you kidding? Your project is still almost void and unusable (no 
media player in it at all), and did you really create the source archive 
with the IDE? The IDE creates "tar.gz" files.

Regards,

-- 
Benoît Minisini

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-26 Thread Piper984
ok: Attached is the file that is produced via Project -> make -> source
archive.  

Thanks!

prjVideoTest01-0.gz
  



--
View this message in context: 
http://gambas.8142.n7.nabble.com/MediaPlayer-bug-with-AboutToFinish-and-URL-tp57513p57616.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-26 Thread Benoît Minisini
Le 26/10/2016 à 22:14, Piper984 a écrit :
> Hi Benoît,
>
> Touching base here to see if you had a chance to pull down the source I
> uploaded?  Any update?  Anything I can do to help?
>
> Regards!
>

Your project is apparently not complete and so unusable. Please send a 
usable project, and archive it with the IDE "make -> source archive" 
menu entry.

Regards,

-- 
Benoît Minisini

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-26 Thread Piper984
Hi Benoît,

Touching base here to see if you had a chance to pull down the source I
uploaded?  Any update?  Anything I can do to help?

Regards!



--
View this message in context: 
http://gambas.8142.n7.nabble.com/MediaPlayer-bug-with-AboutToFinish-and-URL-tp57513p57614.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-24 Thread Piper984
prjVideoTest01.tar
  

Hi Benoît, attached is src of my test application.  Thanks!



--
View this message in context: 
http://gambas.8142.n7.nabble.com/MediaPlayer-bug-with-AboutToFinish-and-URL-tp57513p57612.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-22 Thread Benoît Minisini
Le 22/10/2016 à 19:38, Benoît Minisini a écrit :
>
> Please the your project you used for testing.

oops --> Please send the project you used for testing

-- 
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-22 Thread Benoît Minisini
Le 22/10/2016 à 12:51, Piper984 a écrit :
> Hi Benoît,
>
> Hi pulled down the #7934 release from SourceForge and built+installed
> successfully.  3.9.90.  I made sure the gb.media component built.
>
> Unfortunately when I set the URL during the AboutToFinish event, the next
> clip didn't play.  In the Gambas console this warning was printed:
>
> gb.media: warning: could not catch end of stream
>
> Which might be of interest to us?  I tried with both .mp4 files and .webm
> format.
>
> I compiled under Ubuntu 16.04.  Let me know if/how I could help trouble
> shoot this with you.
>
> Thanks!
>

Please the your project you used for testing.

As for the warning, it means that when the video/audio stream ends, 
GStreamer didn't emit the message as it should according to the 
documentation.

Regards,

-- 
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-22 Thread Piper984
Hi Benoît,

Hi pulled down the #7934 release from SourceForge and built+installed
successfully.  3.9.90.  I made sure the gb.media component built.

Unfortunately when I set the URL during the AboutToFinish event, the next
clip didn't play.  In the Gambas console this warning was printed:

gb.media: warning: could not catch end of stream

Which might be of interest to us?  I tried with both .mp4 files and .webm
format. 

I compiled under Ubuntu 16.04.  Let me know if/how I could help trouble
shoot this with you.   

Thanks!



--
View this message in context: 
http://gambas.8142.n7.nabble.com/MediaPlayer-bug-with-AboutToFinish-and-URL-tp57513p57609.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-20 Thread Benoît Minisini
Le 19/10/2016 à 03:05, Benoît Minisini a écrit :
>
> Now I will try to find a workaround.
>
> Regards,
>

Hi,

The workaround is in revision #7933. That leads to a simplification of 
the MediaView control of the gb.media.form component, committed in 
revision #7934.

Please try it and tell me the result.

If it is ok, I will put these changes in the upcoming 3.9.2 release.

Regards,

-- 
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-18 Thread Benoît Minisini
Le 18/10/2016 à 13:18, Piper984 a écrit :
> OK, thanks for continuing to look into it!
>
> In case it helps: Below is a Python script + Gstreamer lib where setting the
> URL property behaves as expected.  It just toggles between playing two video
> clips, setting the URL property when the 'about-to-finish' event fires. Not
> sure if this will be of any use, but it might?  I ran this script w/ Ubuntu
> 16.04 and GStreamer 1.8.2, which is a different system than the one I
> originally asked about.  I have confirmed that running Gambas 3.9.0 on the
> same system that the Python script below runs doesn't behave as expected.
>
> Thanks again!
>

OK, I understood the problem:

If you want to define the next media to play, you HAVE TO do it during 
the 'about-to-finish' GStreamer signal, which is not run in the main thread.

As Gambas is not multi-threaded, its 'AboutToFinish' event is a delayed 
version of the 'about-to-finish' signal, raised in the main thread.

And apparently, setting the uri outside of the 'about-to-finish' leads 
to unexpected result, and to deadlock on my system.

When I say that GStreamer is an huge sensitive beast... :-/

Now I will try to find a workaround.

Regards,

-- 
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-18 Thread Benoît Minisini
Le 18/10/2016 à 13:18, Piper984 a écrit :
> OK, thanks for continuing to look into it!
>
> In case it helps: Below is a Python script + Gstreamer lib where setting the
> URL property behaves as expected.  It just toggles between playing two video
> clips, setting the URL property when the 'about-to-finish' event fires. Not
> sure if this will be of any use, but it might?  I ran this script w/ Ubuntu
> 16.04 and GStreamer 1.8.2, which is a different system than the one I
> originally asked about.  I have confirmed that running Gambas 3.9.0 on the
> same system that the Python script below runs doesn't behave as expected.
>
> Thanks again!
>

Can you send the python code as a file attachment?

Thanks.

-- 
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-18 Thread Piper984
OK, thanks for continuing to look into it!

In case it helps: Below is a Python script + Gstreamer lib where setting the
URL property behaves as expected.  It just toggles between playing two video
clips, setting the URL property when the 'about-to-finish' event fires. Not
sure if this will be of any use, but it might?  I ran this script w/ Ubuntu
16.04 and GStreamer 1.8.2, which is a different system than the one I
originally asked about.  I have confirmed that running Gambas 3.9.0 on the
same system that the Python script below runs doesn't behave as expected.

Thanks again!


#!/usr/bin/env python

import sys, os
import gi
gi.require_version('Gst', '1.0')
gi.require_version('Gtk', '3.0')
gi.require_version('GstVideo', '1.0') 
from gi.repository import Gst, GObject, Gtk
 
# Needed for window.get_xid(), xvimagesink.set_window_handle(),
respectively:
from gi.repository import GdkX11, GstVideo

class GTK_Main(object):
  
def __init__(self):
window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
window.set_title("Video-Player")
window.set_default_size(500, 400)
window.connect("destroy", Gtk.main_quit, "WM destroy")
vbox = Gtk.VBox()
window.add(vbox)
hbox = Gtk.HBox()
vbox.pack_start(hbox, False, False, 0)
self.entry = Gtk.Entry()
hbox.add(self.entry)
self.button = Gtk.Button("Start")
hbox.pack_start(self.button, False, False, 0)
self.button.connect("clicked", self.start_stop)
self.movie_window = Gtk.DrawingArea()
vbox.add(self.movie_window)
window.show_all()
self.iPos = 0
self.player = Gst.ElementFactory.make("playbin", "player")
bus = self.player.get_bus()
bus.add_signal_watch()
bus.enable_sync_message_emission()
bus.connect("message", self.on_message)
bus.connect("sync-message::element", self.on_sync_message)
self.player.connect("about-to-finish",  self.finished)


def finished(self, player):
print "About to Finish"
if self.iPos == 0:
self.player.set_property("uri", 
"file:///home/chris/Desktop/test5.mp4" )
self.iPos = 1
else:
self.player.set_property("uri", 
"file:///home/chris/Desktop/output.mp4" )
self.iPos = 0

def start_stop(self, w):
if self.button.get_label() == "Start":
filepath = self.entry.get_text().strip()
if os.path.isfile(filepath):
filepath = os.path.realpath(filepath)
self.button.set_label("Stop")
self.player.set_property("uri", 
"file:///home/chris/Desktop/output.mp4"
)
self.player.set_state(Gst.State.PLAYING)
else:
self.player.set_state(Gst.State.NULL)
self.button.set_label("Start")  

def on_message(self, bus, message):
t = message.type
if t == Gst.MessageType.EOS:
self.player.set_state(Gst.State.NULL)
self.button.set_label("Start")
elif t == Gst.MessageType.ERROR:
self.player.set_state(Gst.State.NULL)
err, debug = message.parse_error()
print "Error: %s" % err, debug
self.button.set_label("Start")

def on_sync_message(self, bus, message):
if message.get_structure().get_name() == 
'prepare-window-handle':
imagesink = message.src
imagesink.set_property("force-aspect-ratio", True)

imagesink.set_window_handle(self.movie_window.get_property('window').get_xid())
 

GObject.threads_init()
Gst.init(None)
GTK_Main()
Gtk.main()










--
View this message in context: 
http://gambas.8142.n7.nabble.com/MediaPlayer-bug-with-AboutToFinish-and-URL-tp57513p57595.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-18 Thread Benoît Minisini
Le 18/10/2016 à 01:01, Piper984 a écrit :
> Hi Benoît,
>
> Just checking in to see if you were able to learn any more regarding setting
> the URI during the about to finish event for the MediaPlayer component?
>
> Thanks and regards!
>

I started working on the problem, but just to not be able to reproduce 
yours, but find other ones. At the moment, when I try to change the URL 
property, GStreamer deadlocks, and the program freezes.

Maybe it's gb.media code's fault, but I didn't found what is wrong in it 
yet.

Regards,

-- 
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-17 Thread Piper984
Hi Benoît,

Just checking in to see if you were able to learn any more regarding setting
the URI during the about to finish event for the MediaPlayer component?  

Thanks and regards!




--
View this message in context: 
http://gambas.8142.n7.nabble.com/MediaPlayer-bug-with-AboutToFinish-and-URL-tp57513p57591.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-08 Thread Piper984
Cool, thanks for looking into it.

I have stubbed out the code into a small project here:

http://www.pitchpipetuner.com/gambas/prjVideoTest02.zip

It's about 12 megs. Also in the zip file are the two video files for
testing. Sounds like you already have a testing app going though.

Re: GStreamer: Yeah, it's a beast.  It's always an insane amount of work to
get that last 20% of functionality working in any app.

Thanks!





--
View this message in context: 
http://gambas.8142.n7.nabble.com/MediaPlayer-bug-with-AboutToFinish-and-URL-tp57513p57518.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-08 Thread Benoît Minisini
Le 09/10/2016 à 01:34, Piper984 a écrit :
> Hi Benoît: Posting again without 'html' boxed clicked. Whoops.
>
>
> I have been playing with the Gambas MediaPlayer and the related Gambas
> wrappers of GStreamer libs recently hoping that I can find enough
> functionality in the gb.media libraries to be able to construct my app and
> not have to ever go back to doing my GUIs in C.
>
> I have used the Playbin plugin in the past w/ PyGST and also C.  When the
> video is about done playing an event can fire that lets the hosting
> application set the URL property to a new video should the app want to play
> another video at the end of the current video.
>
> I am seeing two weird *bugs* w/ the Gambas MediaPlayer.  I looked at the C
> code here
> https://sourceforge.net/p/gambas/code/HEAD/tree/gambas/trunk/gb.media/src/c_mediaplayer.c
> and see that for the most part the MediaPlayer is a very slick wrapper of
> the Playbin element.  So hopefully the issue will be easy to find / correct
> for someone with some deeper background of the gb.media library.

On the contrary, as gb.media is just a thin wrapper, the bug will be 
hard to fix, if it can be fixed!

As for the AboutToFinish event, the corresponding glib signal is not 
raised in the main thread. So, as Gambas is single-threaded, the signal 
is postponed to the main thread to be raised as a Gambas event. As far 
as I know, this is the only logic difference with a program written in C!

>
> The issues:
>
> #1) Even though the "AboutToFinish" event fires successfully, setting the
> URL makes no effect here, and the "END" event will then fire at the end of
> the current video. The 'Video_Changed' event does not fire.  If after
> starting starting a video, I manually change the .URL property (from a
> button click event) then at the end of the first video I will get a
> 'Video_Changed' event and the second video will start.

I have done a simple test on my system: setting the URL during 
AboutToFinish... completely freezes the process. I will try to know what 
happens.

>
> #2) When I am able to get the MediaPlayer to set the .URL property to the
> second value, and the video does start to play at the end of the first
> video, the audio plays but the video does not update until I invoke the
> .Pause() method and even then it's just displays that frame and when I
> invoke .Play() after  .Pause() the video does not continue but the audio
> does.  Codec issue?

Maybe. GStreamer is a very sensitive animal.


-- 
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-08 Thread Piper984
Hi Benoît: Posting again without 'html' boxed clicked. Whoops.


I have been playing with the Gambas MediaPlayer and the related Gambas
wrappers of GStreamer libs recently hoping that I can find enough
functionality in the gb.media libraries to be able to construct my app and
not have to ever go back to doing my GUIs in C.

I have used the Playbin plugin in the past w/ PyGST and also C.  When the
video is about done playing an event can fire that lets the hosting
application set the URL property to a new video should the app want to play
another video at the end of the current video.

I am seeing two weird *bugs* w/ the Gambas MediaPlayer.  I looked at the C
code here
https://sourceforge.net/p/gambas/code/HEAD/tree/gambas/trunk/gb.media/src/c_mediaplayer.c
and see that for the most part the MediaPlayer is a very slick wrapper of
the Playbin element.  So hopefully the issue will be easy to find / correct
for someone with some deeper background of the gb.media library.

The issues:

#1) Even though the "AboutToFinish" event fires successfully, setting the
URL makes no effect here, and the "END" event will then fire at the end of
the current video. The 'Video_Changed' event does not fire.  If after
starting starting a video, I manually change the .URL property (from a
button click event) then at the end of the first video I will get a
'Video_Changed' event and the second video will start.  

#2) When I am able to get the MediaPlayer to set the .URL property to the
second value, and the video does start to play at the end of the first
video, the audio plays but the video does not update until I invoke the
.Pause() method and even then it's just displays that frame and when I
invoke .Play() after  .Pause() the video does not continue but the audio
does.  Codec issue?

I am using Ubuntu 14.04, Gambas 3.9.0.  GStreamer 1.2.4 (kinda old, but
playbin works as I'd expect under Python and C).

Here is some of the code:

' Gambas class file
Public objMedia1 As New MediaPlayer As "MP1"
Public Sub Button1_Click()
  objMedia1.URL = "file:///home/chris/Desktop/big-buck-bunny_trailer.webm"
  objMedia1.SetWindow(DrawingArea1, DrawingArea1.X, DrawingArea1.Y,
DrawingArea1.Width, DrawingArea1.Height)
  objMedia1.Play()
End

Public Sub btnNewURL_Click()
  ' invoking this 10-15 seconds into the video clip seems to have the
desired effect.
  objMedia1.URL = "file:///home/chris/Desktop/sintel_trailer-480p.webm"
End
 
Public Sub MP1_End()
  Print "Video Ended."
End

Public Sub MP1_AboutToFinish()
 ' this doesn't have any effect.
  objMedia1.URL = "file:///home/chris/Desktop/sintel_trailer-480p.webm"
End

Public Sub MP1_VideoChanged()
' This only fires when @ the end of the first video when I've manually set
the URL property from a button click.  If I set
' the URL property from the _AboutToFinish() event Sub then nothing happens
(other then _END firing when video #1 has completed). 
 Print "Video Changed."
End


Hopefully that's semi-clear. I hope this is something that can be easily
reproduced and fixed!  I really enjoy how productive I can be w/ Gambas and
now that I've gotten used to doing GUIs and semi-complex application
business logic with Gambas I really don't ever want to have to do those in C
again.  :)

Thanks!

Piper





--
View this message in context: 
http://gambas.8142.n7.nabble.com/MediaPlayer-bug-with-AboutToFinish-and-URL-tp57513p57516.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-08 Thread Benoît Minisini
Le 09/10/2016 à 02:53, Benoît Minisini a écrit :
> Le 09/10/2016 à 01:23, Piper984 a écrit :
>> Hi:I have been playing with the Gambas MediaPlayer and the related Gambas
>> wrappers of GStreamer libs recently hoping that I can find enough
>> functionality in the gb.media libraries to be able to construct my and
>> not
>> have to ever go back to doing my GUIs in C.I have used the Playbin
>> plugin in
>> the past w/ PyGST and also C.  When the video is about done playing an
>> event
>> can fire that lets the hosting application set the URL property to a new
>> video should the app want to play another video at the end of the current
>> video.I am seeing two weird *bugs* w/ the Gambas MediaPlayer.  I
>> looked at
>> the C code
>> herehttps://sourceforge.net/p/gambas/code/HEAD/tree/gambas/trunk/gb.media/src/c_mediaplayer.cand
>>
>> see that for the most part the MediaPlayer is a very slick wrapper of the
>> Playbin element.  So hopefully the issue will be easy to find /
>> correct for
>> someone with some deeper background of the gb.media library.The
>> issues:#1)
>> Even though the "AboutToFinish" event fires successfully, setting the URL
>> makes no effect here, and the "END" event will then fire at the end of
>> the
>> current video. The 'Video_Changed' event does not fire.  If after
>> starting
>> starting a video, I manually change the .URL property (from a button
>> click
>> event) then at the end of the first video I will get a 'Video_Changed'
>> event
>> and the second video will start.  #2) When I am able to get the
>> MediaPlayer
>> to set the .URL property to the second value, and the video does start to
>> play at the end of the first video, the audio plays but the video does
>> not
>> update until I invoke the .Pause() method and even then it's just
>> displays
>> that frame and when I invoke .Play() after  .Pause() the video does not
>> continue but the audio does.  Codec issue?I am using Ubuntu 14.04, Gambas
>> 3.9.0.  GStreamer 1.2.4 (kinda old, but playbin works as I'd expect under
>> Python and C).Here is some of the code:' Gambas class filePublic
>> objMedia1
>> As New MediaPlayer As "MP1"Public Sub Button1_Click()  objMedia1.URL =
>> "file:///home/chris/Desktop/big-buck-bunny_trailer.webm"
>> objMedia1.SetWindow(DrawingArea1, DrawingArea1.X, DrawingArea1.Y,
>> DrawingArea1.Width, DrawingArea1.Height)  objMedia1.Play()EndPublic Sub
>> btnNewURL_Click()  ' invoking this 10-15 seconds into the video clip
>> seems
>> to have the desired effect.  objMedia1.URL =
>> "file:///home/chris/Desktop/sintel_trailer-480p.webm"End Public Sub
>> MP1_End()  Print "Video Ended."EndPublic Sub MP1_AboutToFinish() ' this
>> doesn't have any effect.  objMedia1.URL =
>> "file:///home/chris/Desktop/sintel_trailer-480p.webm"EndPublic Sub
>> MP1_VideoChanged()' This only fires when @ the end of the first video
>> when
>> I've manually set the URL property from a button click.  If I set' the
>> URL
>> property from the _AboutToFinish() event Sub then nothing happens (other
>> then _END firing when video #1 has completed).  Print "Video
>> Changed."EndHopefully that's semi-clear. I hope this is something that
>> can
>> be easily reproduced and fixed!  I really enjoy how productive I can
>> be w/
>> Gambas and now that I've gotten used to doing GUIs and semi-complex
>> application business logic with Gambas I really don't ever want to
>> have to
>> do those in C again.  :)Thanks!Piper
>>
>
> Do you have a more readable version of your mail?
>

And can you post your project too? Or at least the media player part.

-- 
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] MediaPlayer bug with AboutToFinish and URL?

2016-10-08 Thread Benoît Minisini
Le 09/10/2016 à 01:23, Piper984 a écrit :
> Hi:I have been playing with the Gambas MediaPlayer and the related Gambas
> wrappers of GStreamer libs recently hoping that I can find enough
> functionality in the gb.media libraries to be able to construct my and not
> have to ever go back to doing my GUIs in C.I have used the Playbin plugin in
> the past w/ PyGST and also C.  When the video is about done playing an event
> can fire that lets the hosting application set the URL property to a new
> video should the app want to play another video at the end of the current
> video.I am seeing two weird *bugs* w/ the Gambas MediaPlayer.  I looked at
> the C code
> herehttps://sourceforge.net/p/gambas/code/HEAD/tree/gambas/trunk/gb.media/src/c_mediaplayer.cand
> see that for the most part the MediaPlayer is a very slick wrapper of the
> Playbin element.  So hopefully the issue will be easy to find / correct for
> someone with some deeper background of the gb.media library.The issues:#1)
> Even though the "AboutToFinish" event fires successfully, setting the URL
> makes no effect here, and the "END" event will then fire at the end of the
> current video. The 'Video_Changed' event does not fire.  If after starting
> starting a video, I manually change the .URL property (from a button click
> event) then at the end of the first video I will get a 'Video_Changed' event
> and the second video will start.  #2) When I am able to get the MediaPlayer
> to set the .URL property to the second value, and the video does start to
> play at the end of the first video, the audio plays but the video does not
> update until I invoke the .Pause() method and even then it's just displays
> that frame and when I invoke .Play() after  .Pause() the video does not
> continue but the audio does.  Codec issue?I am using Ubuntu 14.04, Gambas
> 3.9.0.  GStreamer 1.2.4 (kinda old, but playbin works as I'd expect under
> Python and C).Here is some of the code:' Gambas class filePublic objMedia1
> As New MediaPlayer As "MP1"Public Sub Button1_Click()  objMedia1.URL =
> "file:///home/chris/Desktop/big-buck-bunny_trailer.webm"
> objMedia1.SetWindow(DrawingArea1, DrawingArea1.X, DrawingArea1.Y,
> DrawingArea1.Width, DrawingArea1.Height)  objMedia1.Play()EndPublic Sub
> btnNewURL_Click()  ' invoking this 10-15 seconds into the video clip seems
> to have the desired effect.  objMedia1.URL =
> "file:///home/chris/Desktop/sintel_trailer-480p.webm"End Public Sub
> MP1_End()  Print "Video Ended."EndPublic Sub MP1_AboutToFinish() ' this
> doesn't have any effect.  objMedia1.URL =
> "file:///home/chris/Desktop/sintel_trailer-480p.webm"EndPublic Sub
> MP1_VideoChanged()' This only fires when @ the end of the first video when
> I've manually set the URL property from a button click.  If I set' the URL
> property from the _AboutToFinish() event Sub then nothing happens (other
> then _END firing when video #1 has completed).  Print "Video
> Changed."EndHopefully that's semi-clear. I hope this is something that can
> be easily reproduced and fixed!  I really enjoy how productive I can be w/
> Gambas and now that I've gotten used to doing GUIs and semi-complex
> application business logic with Gambas I really don't ever want to have to
> do those in C again.  :)Thanks!Piper
>

Do you have a more readable version of your mail?

-- 
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user