Quicktime

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

Quicktime

Chris Cunnington
I found the Sophie dev image ( http://dev.opensophie.org/HomePage ) and the gang's all there: MPEG; Ogg; Vorbis; Quicktime; etc. 

Sophie is built on a Squeak3.8.2a image and it has functionality that people want to have in 4.1. I can watch three versions of Macbeth in Sophie. I want to do that in 4.1. I imagine the Documentation team would like that too. They could have links in the HelpSystem open movies from all over the Internet and have them play in the image. 

The files are available at http://source.opensophie.org/Sophie/. This file looks promising: Sophie-Quicktime-JMM.28.mcz. When I drag it onto the World I get an error that I think is telling me I need FFI installed. 

John, on a scale of 1 to 10 how hard would it be for people not you to play around with your code and install a video player in 4.1?

Chris 




Reply | Threaded
Open this post in threaded view
|

Re: Quicktime

johnmci
If someone wants to drag that Sophie source code into the squeak or Pharo mainstream I'll help from the side lines.  we did re-write the code *MANY* times so it's I think fairly easy to port. 

The concept is there is an abstraction that plays audio & video,  which concrete  classes are used is dependent on the media & what's on the platform, so when a URI is supplied,
I note everything in Sophie referring to a media object was a URI (memory pointer, file pointer, internet pointer), then it's passed to either quicktime which likes many flavours of URI or 
resolved to a file path for URI friendly codecs. 

Some of this was tied to tweak, but the concept was a heartbeat timer either polled every N seconds and then invalidate the form area, which later caused tweak to redraw the form, or tied to 
the quicktime plugin which had the responsibility to fire a semaphore when a movie frame changed so that  we didn't have to run a polling cycle. 

Some people might be offended by having to use quicktime, but we realized at the time that quicktime actually *is* everywhere because people for some reason install iTunes on all their computers
so they can listen to music or watch video....  As for the linux folks (*cough*) well there are frameworks that pretend to offer up the quicktime api, so just compile those up as a solution or provide some api to some other codec solution.

So take a look at the class hierarchy at SophieMovie 


So some porting thoughts 
resource is of course the sophie resource that wraps the media object, it contains meta-data. 
So for example
bounds
self resource ifNil:[^self rectangle].
^(self naturalRectangle scaleBy: (self resource applyTransformationsAgainst: 1@1)) rounded

The applyTransformationsAgainst:   runs a sequence of steps to turn the 1@1 into a float between 0-1 that is applied against the natural scale of a movie. 
This allowed the Sophie book creator to manipulate the size & orientation of the media resource as a set of steps. 
No doubt you can just return the size of the movie to simplify things where it's used to set the rectangle size for the frame via openMovieFromURI:

openMovieFromURI: foo
self setupOffscreen.
self rectangle: self bounds.
self time:0.  "This should likely go into a separate API, but it is needed to ensure clips start at the proper time 0, not the natural media's time 0"



On 2010-08-25, at 7:27 PM, Chris Cunnington wrote:

I found the Sophie dev image ( http://dev.opensophie.org/HomePage ) and the gang's all there: MPEG; Ogg; Vorbis; Quicktime; etc. 

Sophie is built on a Squeak3.8.2a image and it has functionality that people want to have in 4.1. I can watch three versions of Macbeth in Sophie. I want to do that in 4.1. I imagine the Documentation team would like that too. They could have links in the HelpSystem open movies from all over the Internet and have them play in the image. 

The files are available at http://source.opensophie.org/Sophie/. This file looks promising: Sophie-Quicktime-JMM.28.mcz. When I drag it onto the World I get an error that I think is telling me I need FFI installed. 

John, on a scale of 1 to 10 how hard would it be for people not you to play around with your code and install a video player in 4.1?

Chris 




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






Reply | Threaded
Open this post in threaded view
|

Re: Quicktime

Andreas.Raab
In reply to this post by Chris Cunnington
On 8/25/2010 7:27 PM, Chris Cunnington wrote:
> John, on a scale of 1 to 10 how hard would it be for people not you to
> play around with your code and install a video player in 4.1?

I'd looooooooooooooove to get this stuff back into Squeak!

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Quicktime

Douglas Brebner
In reply to this post by johnmci
  On 26/08/2010 04:52, John M McIntosh wrote:
> so they can listen to music or watch video....  As for the linux folks
> (*cough*) well there are frameworks that pretend to offer up the
> quicktime api, so just compile those up as a solution or provide some
> api to some other codec solution.
>
> Some people might be offended by having to use quicktime, but we
> realized at the time that quicktime actually *is* everywhere because
> people for some reason install iTunes on all their computers

heh, I recently uninstalled quicktime from my windows machines due to
some intensely aggravating behaviour it has and I've never used iTunes.
Does that make me weird? :)

Reply | Threaded
Open this post in threaded view
|

Re: Quicktime

Bert Freudenberg
In reply to this post by johnmci
So if there is a QuickTimePlugin, what do you need FFI for?

- Bert -

On 26.08.2010, at 05:52, John M McIntosh wrote:

If someone wants to drag that Sophie source code into the squeak or Pharo mainstream I'll help from the side lines.  we did re-write the code *MANY* times so it's I think fairly easy to port. 

The concept is there is an abstraction that plays audio & video,  which concrete  classes are used is dependent on the media & what's on the platform, so when a URI is supplied,
I note everything in Sophie referring to a media object was a URI (memory pointer, file pointer, internet pointer), then it's passed to either quicktime which likes many flavours of URI or 
resolved to a file path for URI friendly codecs. 

Some of this was tied to tweak, but the concept was a heartbeat timer either polled every N seconds and then invalidate the form area, which later caused tweak to redraw the form, or tied to 
the quicktime plugin which had the responsibility to fire a semaphore when a movie frame changed so that  we didn't have to run a polling cycle. 

Some people might be offended by having to use quicktime, but we realized at the time that quicktime actually *is* everywhere because people for some reason install iTunes on all their computers
so they can listen to music or watch video....  As for the linux folks (*cough*) well there are frameworks that pretend to offer up the quicktime api, so just compile those up as a solution or provide some api to some other codec solution.

So take a look at the class hierarchy at SophieMovie 


So some porting thoughts 
resource is of course the sophie resource that wraps the media object, it contains meta-data. 
So for example
bounds
self resource ifNil:[^self rectangle].
^(self naturalRectangle scaleBy: (self resource applyTransformationsAgainst: 1@1)) rounded

The applyTransformationsAgainst:   runs a sequence of steps to turn the 1@1 into a float between 0-1 that is applied against the natural scale of a movie. 
This allowed the Sophie book creator to manipulate the size & orientation of the media resource as a set of steps. 
No doubt you can just return the size of the movie to simplify things where it's used to set the rectangle size for the frame via openMovieFromURI:

openMovieFromURI: foo
self setupOffscreen.
self rectangle: self bounds.
self time:0.  "This should likely go into a separate API, but it is needed to ensure clips start at the proper time 0, not the natural media's time 0"



On 2010-08-25, at 7:27 PM, Chris Cunnington wrote:

I found the Sophie dev image ( http://dev.opensophie.org/HomePage ) and the gang's all there: MPEG; Ogg; Vorbis; Quicktime; etc. 

Sophie is built on a Squeak3.8.2a image and it has functionality that people want to have in 4.1. I can watch three versions of Macbeth in Sophie. I want to do that in 4.1. I imagine the Documentation team would like that too. They could have links in the HelpSystem open movies from all over the Internet and have them play in the image. 

The files are available at http://source.opensophie.org/Sophie/. This file looks promising: Sophie-Quicktime-JMM.28.mcz. When I drag it onto the World I get an error that I think is telling me I need FFI installed. 

John, on a scale of 1 to 10 how hard would it be for people not you to play around with your code and install a video player in 4.1?

Chris 




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








Reply | Threaded
Open this post in threaded view
|

Re: Quicktime

Edgar De Cleene
In reply to this post by Chris Cunnington
Re: [squeak-dev] Quicktime


On 8/25/10 11:27 PM, "Chris Cunnington" <[hidden email]> wrote:

I found the Sophie dev image ( http://dev.opensophie.org/HomePage ) and the gang's all there: MPEG; Ogg; Vorbis; Quicktime; etc. 

Sophie is built on a Squeak3.8.2a image and it has functionality that people want to have in 4.1. I can watch three versions of Macbeth in Sophie. I want to do that in 4.1. I imagine the Documentation team would like that too. They could have links in the HelpSystem open movies from all over the Internet and have them play in the image. 

The files are available at http://source.opensophie.org/Sophie/. This file looks promising: 
Sophie-Quicktime-JMM.28.mcz <http://source.opensophie.org/Sophie/Sophie-Quicktime-JMM.28.mcz> . When I drag it onto the World I get an error that I think is telling me I need FFI installed. 

John, on a scale of 1 to 10 how hard would it be for people not you to play around with your code and install a video player in 4.1?

Chris 

Chis.

My modest contribution of today is re-test Movies packages and change for working on last Squeak4.2-10382-alpha

Here how to get and try
File in the attached and you get SqueakSource Ladrillos
Open Monticello and load Movies-edc.11.mcz.
Once loaded, open FileList and navigate to your Movies folder or found some mpg
Enjoy and improve .

Edgar

P.S. I can’t found mr
Spielberg for sign it , but its MIT :=)


AgregaRepoLadrillos.st (252 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Quicktime

Peter Crowther-2
In reply to this post by Douglas Brebner
> From: Douglas Brebner
> heh, I recently uninstalled quicktime from my windows machines due to
> some intensely aggravating behaviour it has and I've never used
iTunes.
> Does that make me weird? :)

Sane, I think :-).  I don't allow Quicktime on Windows onto any network
I manage, as I consider it malware that makes undesirable changes to my
system and prevents me from undoing its changes.  I will continue to ban
it until Apple allows me to use the programs I wish to handle particular
file formats, rather than the programs that Apple dictates I should use.
Yet another example of Jobsian "my way or the highway".

                - Peter

Reply | Threaded
Open this post in threaded view
|

Re: Quicktime

johnmci
In looking at this the choice for the Sophie team was:
We had to support various codec (lots) and acquire legal licenses to use them, which was insane...

We did however add in the ogg support via the work done for OLPC for folks who choose not to have Apple, Microsoft, or Franuholfer
trample on their machine.

Sadly most people just *expect* any form of media they've downloaded from anywhere just to work.

On 2010-08-26, at 4:41 AM, Peter Crowther wrote:

>> From: Douglas Brebner
>> heh, I recently uninstalled quicktime from my windows machines due to
>> some intensely aggravating behaviour it has and I've never used
> iTunes.
>> Does that make me weird? :)
>
> Sane, I think :-).  I don't allow Quicktime on Windows onto any network
> I manage, as I consider it malware that makes undesirable changes to my
> system and prevents me from undoing its changes.  I will continue to ban
> it until Apple allows me to use the programs I wish to handle particular
> file formats, rather than the programs that Apple dictates I should use.
> Yet another example of Jobsian "my way or the highway".
>
> - Peter
>

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





Reply | Threaded
Open this post in threaded view
|

Re: Quicktime

johnmci
In reply to this post by Bert Freudenberg
In Sophie the objective I took was that all interfaces to the operating system had to be done in FFI with a supporting abstract class with concrete classes for 
platform variances. This allows anyone who can read the operating system api docs to fiddle with the code. Otherwise the number of folks who undertake
doing plugin creation and maintenance is few... 

However there are some issues with that, one being you need a plugin to handle async callbacks.  In this case the QuickTimePlugin only responsibility is 
to handle a callback when QuickTime wants to indicate that a video frame has changed.  That signals a semaphore that lets the SophieMovie logic know
it needs to schedule a tweak frame update. 

There is no windows one because we couldn't find anyone to figure out the daunting process of installing the windows tool chain and building the plugin, 
so we settled for a polling cycle that blindly draws based on the supposed frame rate based on the video meta-data.  I'm not sure we actually quantified a 
difference... 

On 2010-08-26, at 2:47 AM, Bert Freudenberg wrote:

So if there is a QuickTimePlugin, what do you need FFI for?

- 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: Quicktime

Hannes Hirzel
In reply to this post by johnmci
On 8/26/10, John M McIntosh <[hidden email]> wrote:
> In looking at this the choice for the Sophie team was:
> We had to support various codec (lots) and acquire legal licenses to use
> them, which was insane...
>
> We did however add in the ogg support via the work done for OLPC for folks
> who choose not to have Apple, Microsoft, or Franuholfer
> trample on their machine.

I would say that from the Squeak documentation point of view  videos
in  Ogg format would be doable and the minimum thing to have. The rest
is nice to have.


> Sadly most people just *expect* any form of media they've downloaded from
> anywhere just to work.
Yes, and if we have Quicktime than this is great of course.

However I remember that earlier Squeak versions could play mpeg
videos. How was that done at the time?


--Hannes

> On 2010-08-26, at 4:41 AM, Peter Crowther wrote:
>
>>> From: Douglas Brebner
>>> heh, I recently uninstalled quicktime from my windows machines due to
>>> some intensely aggravating behaviour it has and I've never used
>> iTunes.
>>> Does that make me weird? :)
>>
>> Sane, I think :-).  I don't allow Quicktime on Windows onto any network
>> I manage, as I consider it malware that makes undesirable changes to my
>> system and prevents me from undoing its changes.  I will continue to ban
>> it until Apple allows me to use the programs I wish to handle particular
>> file formats, rather than the programs that Apple dictates I should use.
>> Yet another example of Jobsian "my way or the highway".
>>
>> - Peter
>>
>
> --
> ===========================================================================
> John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================
>
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Quicktime

johnmci

On 2010-08-26, at 10:12 AM, Hannes Hirzel wrote:

> However I remember that earlier Squeak versions could play mpeg
> videos. How was that done at the time?

We acquire a *license* to use the http://heroinewarrior.com/libmpeg3

Although this originally is GNU General Public License code we wrote the author and received permission
to use the source code in Squeak under either a LGPL or the Squeak-L.

(a) our code base is old, and not supported.
(b) the Sophie team found a few bugs, some MP3 files won't work.
(c) your user always picks a file which isn't mp3
--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================