Sophie MPEG Player

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Sophie MPEG Player

Chris Cunnington
OK, I've pulled the MPEG player from Sophie. It looks worlds better. 



It opens with: 

MPEGMoviePlayerMorph new openInWorld 

Chris 




Reply | Threaded
Open this post in threaded view
|

Re: Sophie MPEG Player

Bert Freudenberg

On 28.08.2010, at 02:21, Chris Cunnington wrote:

OK, I've pulled the MPEG player from Sophie. It looks worlds better. 



It opens with: 

MPEGMoviePlayerMorph new openInWorld 

Chris 

Awesome! :)

IIRC it was rather hard to recode video to an mpeg format this would accept.

And a solution that would not require recoding would be preferable.

On Linux we have John's GStreamer plugin, and he once compiled it on OS X too. Not sure how hard it would be to port to Windows.

The Best Way would be a generic VideoPlugin that would have different implementations for each platform (e.g. QuickTime on Mac, GStreamer on Linux, DirectShow on Windows). That would be quite some development effort, however. 

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: Sophie MPEG Player

johnmci
Ok, it's fairly impossible to rely on GStreamer on os-x. The problem is that you need to use MacPorts or something as root to 
install giga-bytes of software related to GStreamer.  That's just not likely, too much magic for MacIntosh users. 

Sophie btw did deal with multiple layers of codec support and would ask the plugins if they supported OGG or MPEG and work 
their way down to a solution. It used a weighted decision tree for that, so for example if the Ogg audio was supported by 
a codec in Quicktime that the user had installed it would take the quicktime logic path, versus the Ogg plugin path.. 

So if you had an mpeg video it would play nicely on your mac with quicktime, or on windows if quicktime was installed, or fall back to 
the mpeg player code if supported on linux. 

On 2010-08-28, at 3:32 AM, Bert Freudenberg wrote:


On 28.08.2010, at 02:21, Chris Cunnington wrote:

OK, I've pulled the MPEG player from Sophie. It looks worlds better. 



It opens with: 

MPEGMoviePlayerMorph new openInWorld 

Chris 

Awesome! :)

IIRC it was rather hard to recode video to an mpeg format this would accept.

And a solution that would not require recoding would be preferable.

On Linux we have John's GStreamer plugin, and he once compiled it on OS X too. Not sure how hard it would be to port to Windows.

The Best Way would be a generic VideoPlugin that would have different implementations for each platform (e.g. QuickTime on Mac, GStreamer on Linux, DirectShow on Windows). That would be quite some development effort, however. 

- Bert -



--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================






Reply | Threaded
Open this post in threaded view
|

Re: Sophie MPEG Player

Levente Uzonyi-2
In reply to this post by Chris Cunnington
On Fri, 27 Aug 2010, Chris Cunnington wrote:

> OK, I've pulled the MPEG player from Sophie. It looks worlds better.
>
> http://smalltalktelevision.com/player2.jpg
>
> It's also at http://www.squeaksource.com/MultiMedia.html
>
> It opens with:
>
> MPEGMoviePlayerMorph new openInWorld

Hm. That's Squeak's player which was removed during 3.9/3.10 along with
some other cool stuff related to audio/video, because the classes were not
referenced... A tool doesn't have to be referenced by code IMHO). If you
get a 3.8 full image, it will have that.


Levente

>
> Chris
>

Reply | Threaded
Open this post in threaded view
|

Re: Sophie MPEG Player

Sean P. DeNigris
Administrator
In reply to this post by Chris Cunnington
Chris Cunnington-3 wrote
OK, I've pulled the MPEG player from Sophie. It looks worlds better.
Thanks - this is *so cool!*  Multimedia is important.  My secret wish is for a PdfMorph.

Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Sophie MPEG Player

Sean P. DeNigris
Administrator
In reply to this post by Chris Cunnington
Chris Cunnington-3 wrote
OK, I've pulled the MPEG player from Sophie. It looks worlds better.
Chris, have you been using this successfully?  I imported a flash (.flv - H.264, 320 x 216, Millions; AAC, Stereo, 22.050 kHz) file into OpenSophie, but when I played it, the sound played for just a moment and the video only updated when I clicked pause or play.

Thanks.
Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Sophie MPEG Player

Chris Cunnington
In reply to this post by Chris Cunnington

Sure. Download Sophie-MPEG-Kernel and Sophie-MPEG-Player from the MultiMedia repo. Then

MPEGMoviePlayerMorph new openInWorld

The buttons can guide you from there. Actually, I think I made a movie about this. But it is
MPEG only and such. If you want an example of the QuickTime player download the example book
from the Sophie site about Macbeth.

What you may want, I think, for Flash is in the OpenCobalt download. (http://www.opencobalt.org). It comes
with an swf file called actin-myosin.swf, which is an animation. It plays fine in my Adobe Flash CS5.

The problem I think you're having with it in Sophie is that you're trying to play a movie. Time was Flash
was for animations only. You may be trying to make it do something it can't. This stuff is old, dude.

(JMM gets kind of itchy about these conversations, because
we're talking about ancient stuff. The vein of gold runs from SophieMovie. I'm digging that
out, but asking me why I can't do it overnight is to ask my why I'm not an advanced programmer.
March 2011 ETA for the Sophie Media Player in Squeak 4.2. There's only one person who can wake-up and know
all these things without coffee - JMM. i.e. Morphic/Tweak Player, Process, QuickTime framework,
Carbon/Squeak event management, C, MCGetMovie, FFI, SophieMovieFramePlayer,SophieQuickTimeMovieViaPlugin,
and the Surface Plugin. But I most certainly digress.)


Chris


Reply | Threaded
Open this post in threaded view
|

Re: Sophie MPEG Player

Sean P. DeNigris
Administrator
Chris Cunnington-3 wrote
MPEGMoviePlayerMorph new openInWorld... I think I made a movie
about this
Ah, yes. I remember the movie.  I'm trying to play a flash movie, so I don't know why I thought this would work (although if I get desperate, I could convert to mpeg first...)

Chris Cunnington-3 wrote
If  you want an example of the QuickTime player download the example book from the Sophie site about Macbeth.
Strange, now my .flv is playing correctly in OpenSophie!  But I can't figure out how to recreate what Sophie is doing from the UI in the API.  I tried:
        t _ SophieQuickTimeMovie new.
        uri _ URI fromString: 'file:///Users/sean/textmovie.mov'.
        t openMovieFromURI: uri.
        t play.
But got: MNU #metaDataValueAt: in SophieQuickTimeMovie>>inPoint
How do you open a Quicktime file programmatically?

Thanks.
Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Sophie MPEG Player

Chris Cunnington
In reply to this post by Chris Cunnington
How to open a QT movie programmatically?

What you added in the last message looks about as good as it gets. As
in, I don't know how, because I don't think that works.

SophieQuickTimeMovie class >> example example2 example3

has a simple solution to that question, which I can see you've found.
But it doesn't work. Running the Tests for Sophie shows some stuff is
broken.

I gave up trying to open a movie with code in a Workspace, and decided
to learn from what works, which is to open the Macbeth example file.
That shows a Tweak-managed infinite loop ( [self isMovieDone]
whileFalse: in SophieQuickTimeAudio>>playMovieScript) running between
SophieMovieFramePlayer and SophieQuickTimeMovieViaPlugin. The Player has
the buttons. ViaPlugin accesses QuickTime on the Mac.

I'm still in the middle of digging out details about Tweak and
#startScript: before I go back to that part. It's lead me down an
AsyncScriptMessageSend rabbit hole. If  you want to freak yourself out,
open the ProcessBrowser. Freaked me out.

Chris

Reply | Threaded
Open this post in threaded view
|

Re: Sophie MPEG Player

Sean P. DeNigris
Administrator
On Dec 28, 2010, at 6:01 PM, "Chris Cunnington-3 [via Smalltalk]" <[hidden email]> wrote:

> I... decided to learn from what works, which is to open the Macbeth example file.
> That shows a Tweak-managed infinite loop
I know nothing about Tweak.  How did you jump from seeing the Sophie UI to finding that loop?  When I couldn't bring up halos, I started fruitlessly searching brute-force through the class browser.

> If  you want to freak yourself out, open the ProcessBrowser.
I'll check it out - I like excitement :)

Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Sophie MPEG Player

Chris Cunnington-4
In reply to this post by Chris Cunnington
"How did you jump from seeing the Sophie UI to finding that loop?"

You've put your finger on the big question in Tweak: how did this go
from here to there? Tweak teleports the flow of execution from one place
to another using method annotations. Stuff like <on: movieChanged> is
everywhere.

The simple way is to know that anything with <on: movieChanged> is going
to have a correlative method somewhere called #onMovieChanged:.

So, if I'm in SophieMovie>>updateMovie and I see signal: #movieUpdated,
I'm pretty sure there's going to be an #onMovieUpdated somewhere. Using
the MethodFinder, I find one in - you guessed it -
SophieMovieFramePlayer>>onMovieUpdated. It's a kind of convention.

Or you can use the Annotations browser from the menu with Monticello
Browser. I find knowing the convention more useful than the
AnnotationsBrowser, though.

When Teleplace asks questions of prospective employees "can you get up
to speed quickly with different UIs?" I think they are talking about
this Tweak transporter system that would be at home on the USS Enterprise.

Chris

Reply | Threaded
Open this post in threaded view
|

Re: Sophie MPEG Player

Chris Cunnington
In reply to this post by Chris Cunnington
"How did you jump from seeing the Sophie UI to finding that loop?"

You've put your finger on the big question in Tweak: how did this go
from here to there? Tweak teleports the flow of execution from one place
to another using method annotations. Stuff like <on: movieChanged> is
everywhere.

The simple way is to know that anything with <on: movieChanged> is going
to have a correlative method somewhere called #onMovieChanged:.

So, if I'm in SophieMovie>>updateMovie and I see signal: #movieUpdated,
I'm pretty sure there's going to be an #onMovieUpdated somewhere. Using
the MethodFinder, I find one in - you guessed it -
SophieMovieFramePlayer>>onMovieUpdated. It's a kind of convention.

Or you can use the Annotations browser from the same menu as Monticello
Browser. I find knowing the convention more useful than the
AnnotationsBrowser, though.

When Teleplace asks questions of prospective employees "can you get up
to speed quickly with different UIs?" I think they are talking about
this Tweak transporter system that would be at home on the USS Enterprise.

Chris

Reply | Threaded
Open this post in threaded view
|

Re: Sophie MPEG Player

Sean P. DeNigris
Administrator
I'm going to start a new thread since we're talking about QuickTime now...
Cheers,
Sean