You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jonas Lundberg <my...@gmail.com> on 2006/06/07 14:19:22 UTC

How to extract image, audio and video metadata from media files in Cocoon?

I am working on a content management system, where I would like to
import images for image galleries, audio for podcasting, and video for
video galleries. When doing this, it would be very useful to be able
to figure out the dimensions of images, the length of podcasts, and
the dimensions and length of videos.

How do you people achieve this in Cocoon? Does anyone have a method to
share? Either for extracting metadata from the files, or for measuring
them.

Regards
Hans

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to extract image, audio and video metadata from media files in Cocoon?

Posted by Jason Johnston <co...@lojjic.net>.
If you're using CForms/flowscript for the upload form, then you can get
access in your flow code to the uploaded file.  From there you should be
able to pass that uploaded file (probably as an InputStream) into a Java
library that specializes in the kinds of metadata/property extraction you
need.  You'll have to hunt down those libraries and figure out their APIs
on your own, but it should be pretty straightforward once you have that.

Check out the following libraries as a starting point:
JavaSound - http://java.sun.com/products/java-media/sound/index.jsp
Drew Noakes' EXIF library for JPEG images -
http://www.drewnoakes.com/code/exif/


> I see... I was hoping that this was a common operation, and that
> someone had already made a solution. Anyone?
>
> Regards
> Hans
>
> On 6/7/06, Christofer Dutz <du...@c-ware.de> wrote:
>> Nope ... won't work then. I think you will have to do it manually then
>> and
>> implement your own generators. Maybe the DirectoryGenerator sources will
>> help you getting started.
>>
>> Chris
>>
>> [ c h r i s t o f e r   d u t z ]
>>
>> IT-Berater
>> univativ GmbH & Co. KG
>> Robert-Bosch-Str. 7, 64293 Darmstadt
>>
>> fon: 0 61 51 / 66 717 - 21
>> fax: 0 61 51 / 66 717 - 29
>> email: christofer.dutz@univativ.de
>> http://www.univativ.de
>>
>> Darmstadt, Stuttgart, Karlsruhe, Düsseldorf
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Jonas Lundberg [mailto:my.name.is.hans@gmail.com]
>> Gesendet: Mittwoch, 7. Juni 2006 14:47
>> An: users@cocoon.apache.org
>> Betreff: Re: How to extract image, audio and video metadata from media
>> files
>> in Cocoon?
>>
>> Thanks Christofer. That only solves part of the problem, because some
>> files will be uploaded using a web form, and directly put into a
>> database. Then I guess I can't use a directory generator?
>>
>> Regards
>> Hans
>>
>> On 6/7/06, Christofer Dutz <du...@c-ware.de> wrote:
>> > Hi Hans,
>> >
>> > Well if you use the ImageDirectoryGenerator, it generates an xml
>> > representing the file and directory structure of a specified directory
>> with
>> > additional size information ... don't think a Generator for videos
>> exists.
>> > There is a MP3DirectoryGenerator for generating file and directory xml
>> > containing MP3 files ID3 tags thou. I think you will have to implement
>> your
>> > own DirectoryGenerator for the videos and podcasts.
>> >
>> > Chris
>> >
>> > PS: For reding images in a specified resolution use the ImageReader ;)
>> >
>> > [ c h r i s t o f e r   d u t z ]
>> >
>> > IT-Berater
>> > univativ GmbH & Co. KG
>> > Robert-Bosch-Str. 7, 64293 Darmstadt
>> >
>> > fon: 0 61 51 / 66 717 - 21
>> > fax: 0 61 51 / 66 717 - 29
>> > email: christofer.dutz@univativ.de
>> > http://www.univativ.de
>> >
>> > Darmstadt, Stuttgart, Karlsruhe, Düsseldorf
>> >
>> > -----Ursprüngliche Nachricht-----
>> > Von: Jonas Lundberg [mailto:my.name.is.hans@gmail.com]
>> > Gesendet: Mittwoch, 7. Juni 2006 14:19
>> > An: users@cocoon.apache.org
>> > Betreff: How to extract image, audio and video metadata from media
>> files
>> in
>> > Cocoon?
>> >
>> > I am working on a content management system, where I would like to
>> > import images for image galleries, audio for podcasting, and video for
>> > video galleries. When doing this, it would be very useful to be able
>> > to figure out the dimensions of images, the length of podcasts, and
>> > the dimensions and length of videos.
>> >
>> > How do you people achieve this in Cocoon? Does anyone have a method to
>> > share? Either for extracting metadata from the files, or for measuring
>> > them.
>> >
>> > Regards
>> > Hans


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to extract image, audio and video metadata from media files in Cocoon?

Posted by "Steven D. Majewski" <sd...@virginia.edu>.
On Jun 7, 2006, at 12:15 PM, Jonas Lundberg wrote:

> I see... I was hoping that this was a common operation, and that
> someone had already made a solution. Anyone?
>
> Regards
> Hans

ImageDirectoryGenerator only extracts a very limited set of info from  
image files
   ( and I *think*, from a brief look at util/ImageUtils.java, only  
for GIFS and JPEGS. )
It doesn't look like it does any EXIF info or other metadata.

MP3DirectoryGenerator only works for MP3's -- not other audio formats  
supported.


Phil Harvey's ExifTool <http://www.sno.phy.queensu.ca/~phil/exiftool/>
is pretty much a universal metadata extractor, but it's written in Perl.
It would be nicer to have something similar to ExifTool in Java, but  
unfortunately,
Drew Noakes  Java EXIF/metadata-extractor library <http:// 
www.drewnoakes.com/code/exif/>
is the closest I could find. ( doesn't look like it does audio or  
movie file formats. )

Looking at the source for the DirectoryGenerators, it doesn't look  
like it would be
too difficult ( at the cost of an external process ) to generate the  
metadata with
ExifTool, and output it as SAX events to the pipeline.  But, if  
you're going to ingest
these files on upload to a database, then maybe it makes more sense  
to just
generate the metadata once and convert it to XML.



-- Steve Majewski






Re: How to extract image, audio and video metadata from media files in Cocoon?

Posted by Jonas Lundberg <my...@gmail.com>.
I see... I was hoping that this was a common operation, and that
someone had already made a solution. Anyone?

Regards
Hans

On 6/7/06, Christofer Dutz <du...@c-ware.de> wrote:
> Nope ... won't work then. I think you will have to do it manually then and
> implement your own generators. Maybe the DirectoryGenerator sources will
> help you getting started.
>
> Chris
>
> [ c h r i s t o f e r   d u t z ]
>
> IT-Berater
> univativ GmbH & Co. KG
> Robert-Bosch-Str. 7, 64293 Darmstadt
>
> fon: 0 61 51 / 66 717 - 21
> fax: 0 61 51 / 66 717 - 29
> email: christofer.dutz@univativ.de
> http://www.univativ.de
>
> Darmstadt, Stuttgart, Karlsruhe, Düsseldorf
>
>
> -----Ursprüngliche Nachricht-----
> Von: Jonas Lundberg [mailto:my.name.is.hans@gmail.com]
> Gesendet: Mittwoch, 7. Juni 2006 14:47
> An: users@cocoon.apache.org
> Betreff: Re: How to extract image, audio and video metadata from media files
> in Cocoon?
>
> Thanks Christofer. That only solves part of the problem, because some
> files will be uploaded using a web form, and directly put into a
> database. Then I guess I can't use a directory generator?
>
> Regards
> Hans
>
> On 6/7/06, Christofer Dutz <du...@c-ware.de> wrote:
> > Hi Hans,
> >
> > Well if you use the ImageDirectoryGenerator, it generates an xml
> > representing the file and directory structure of a specified directory
> with
> > additional size information ... don't think a Generator for videos exists.
> > There is a MP3DirectoryGenerator for generating file and directory xml
> > containing MP3 files ID3 tags thou. I think you will have to implement
> your
> > own DirectoryGenerator for the videos and podcasts.
> >
> > Chris
> >
> > PS: For reding images in a specified resolution use the ImageReader ;)
> >
> > [ c h r i s t o f e r   d u t z ]
> >
> > IT-Berater
> > univativ GmbH & Co. KG
> > Robert-Bosch-Str. 7, 64293 Darmstadt
> >
> > fon: 0 61 51 / 66 717 - 21
> > fax: 0 61 51 / 66 717 - 29
> > email: christofer.dutz@univativ.de
> > http://www.univativ.de
> >
> > Darmstadt, Stuttgart, Karlsruhe, Düsseldorf
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Jonas Lundberg [mailto:my.name.is.hans@gmail.com]
> > Gesendet: Mittwoch, 7. Juni 2006 14:19
> > An: users@cocoon.apache.org
> > Betreff: How to extract image, audio and video metadata from media files
> in
> > Cocoon?
> >
> > I am working on a content management system, where I would like to
> > import images for image galleries, audio for podcasting, and video for
> > video galleries. When doing this, it would be very useful to be able
> > to figure out the dimensions of images, the length of podcasts, and
> > the dimensions and length of videos.
> >
> > How do you people achieve this in Cocoon? Does anyone have a method to
> > share? Either for extracting metadata from the files, or for measuring
> > them.
> >
> > Regards
> > Hans
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to extract image, audio and video metadata from media files in Cocoon?

Posted by Kaj Kandler <Ka...@Conficio.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Jonas Lundberg wrote:
> Thanks Christofer. That only solves part of the problem, because some
> files will be uploaded using a web form, and directly put into a
> database. Then I guess I can't use a directory generator?
> 
> Regards
> Hans
> 
Hi Hans,
how about if you determine the meta-data in the upload (store the file
temporarily in a directory, extract the data with the
directory-generator and store the image then together with the metadata
as attributes in the DB. This way you can use the existing tools and
also query on your metadata easily.

Just a thought.

K<o>

- --
KajKandler@Conficio.com

- -----------------------------------------------------
|  We produce animated software manuals that click  |
- -----------------------------------------------------
 Conficio
 http://www.conficio.com/
 P.O.Box 761062,  Melrose,
 MA 02176

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)

iD8DBQFEjEDjRDUvrJRNjTARAhVsAJoDARWik+MGIm3TAdz2WpzZ5obDIwCghknU
4aw8SeCLcR1ImZD9zfkQAss=
=yUu6
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


AW: How to extract image, audio and video metadata from media files in Cocoon?

Posted by Christofer Dutz <du...@c-ware.de>.
Nope ... won't work then. I think you will have to do it manually then and
implement your own generators. Maybe the DirectoryGenerator sources will
help you getting started. 

Chris 

[ c h r i s t o f e r   d u t z ]

IT-Berater
univativ GmbH & Co. KG
Robert-Bosch-Str. 7, 64293 Darmstadt

fon: 0 61 51 / 66 717 - 21
fax: 0 61 51 / 66 717 - 29
email: christofer.dutz@univativ.de
http://www.univativ.de

Darmstadt, Stuttgart, Karlsruhe, Düsseldorf


-----Ursprüngliche Nachricht-----
Von: Jonas Lundberg [mailto:my.name.is.hans@gmail.com] 
Gesendet: Mittwoch, 7. Juni 2006 14:47
An: users@cocoon.apache.org
Betreff: Re: How to extract image, audio and video metadata from media files
in Cocoon?

Thanks Christofer. That only solves part of the problem, because some
files will be uploaded using a web form, and directly put into a
database. Then I guess I can't use a directory generator?

Regards
Hans

On 6/7/06, Christofer Dutz <du...@c-ware.de> wrote:
> Hi Hans,
>
> Well if you use the ImageDirectoryGenerator, it generates an xml
> representing the file and directory structure of a specified directory
with
> additional size information ... don't think a Generator for videos exists.
> There is a MP3DirectoryGenerator for generating file and directory xml
> containing MP3 files ID3 tags thou. I think you will have to implement
your
> own DirectoryGenerator for the videos and podcasts.
>
> Chris
>
> PS: For reding images in a specified resolution use the ImageReader ;)
>
> [ c h r i s t o f e r   d u t z ]
>
> IT-Berater
> univativ GmbH & Co. KG
> Robert-Bosch-Str. 7, 64293 Darmstadt
>
> fon: 0 61 51 / 66 717 - 21
> fax: 0 61 51 / 66 717 - 29
> email: christofer.dutz@univativ.de
> http://www.univativ.de
>
> Darmstadt, Stuttgart, Karlsruhe, Düsseldorf
>
> -----Ursprüngliche Nachricht-----
> Von: Jonas Lundberg [mailto:my.name.is.hans@gmail.com]
> Gesendet: Mittwoch, 7. Juni 2006 14:19
> An: users@cocoon.apache.org
> Betreff: How to extract image, audio and video metadata from media files
in
> Cocoon?
>
> I am working on a content management system, where I would like to
> import images for image galleries, audio for podcasting, and video for
> video galleries. When doing this, it would be very useful to be able
> to figure out the dimensions of images, the length of podcasts, and
> the dimensions and length of videos.
>
> How do you people achieve this in Cocoon? Does anyone have a method to
> share? Either for extracting metadata from the files, or for measuring
> them.
>
> Regards
> Hans
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to extract image, audio and video metadata from media files in Cocoon?

Posted by Jonas Lundberg <my...@gmail.com>.
Thanks Christofer. That only solves part of the problem, because some
files will be uploaded using a web form, and directly put into a
database. Then I guess I can't use a directory generator?

Regards
Hans

On 6/7/06, Christofer Dutz <du...@c-ware.de> wrote:
> Hi Hans,
>
> Well if you use the ImageDirectoryGenerator, it generates an xml
> representing the file and directory structure of a specified directory with
> additional size information ... don't think a Generator for videos exists.
> There is a MP3DirectoryGenerator for generating file and directory xml
> containing MP3 files ID3 tags thou. I think you will have to implement your
> own DirectoryGenerator for the videos and podcasts.
>
> Chris
>
> PS: For reding images in a specified resolution use the ImageReader ;)
>
> [ c h r i s t o f e r   d u t z ]
>
> IT-Berater
> univativ GmbH & Co. KG
> Robert-Bosch-Str. 7, 64293 Darmstadt
>
> fon: 0 61 51 / 66 717 - 21
> fax: 0 61 51 / 66 717 - 29
> email: christofer.dutz@univativ.de
> http://www.univativ.de
>
> Darmstadt, Stuttgart, Karlsruhe, Düsseldorf
>
> -----Ursprüngliche Nachricht-----
> Von: Jonas Lundberg [mailto:my.name.is.hans@gmail.com]
> Gesendet: Mittwoch, 7. Juni 2006 14:19
> An: users@cocoon.apache.org
> Betreff: How to extract image, audio and video metadata from media files in
> Cocoon?
>
> I am working on a content management system, where I would like to
> import images for image galleries, audio for podcasting, and video for
> video galleries. When doing this, it would be very useful to be able
> to figure out the dimensions of images, the length of podcasts, and
> the dimensions and length of videos.
>
> How do you people achieve this in Cocoon? Does anyone have a method to
> share? Either for extracting metadata from the files, or for measuring
> them.
>
> Regards
> Hans
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


AW: How to extract image, audio and video metadata from media files in Cocoon?

Posted by Christofer Dutz <du...@c-ware.de>.
Hi Hans,

Well if you use the ImageDirectoryGenerator, it generates an xml
representing the file and directory structure of a specified directory with
additional size information ... don't think a Generator for videos exists.
There is a MP3DirectoryGenerator for generating file and directory xml
containing MP3 files ID3 tags thou. I think you will have to implement your
own DirectoryGenerator for the videos and podcasts.

Chris

PS: For reding images in a specified resolution use the ImageReader ;)

[ c h r i s t o f e r   d u t z ]

IT-Berater
univativ GmbH & Co. KG
Robert-Bosch-Str. 7, 64293 Darmstadt

fon: 0 61 51 / 66 717 - 21
fax: 0 61 51 / 66 717 - 29
email: christofer.dutz@univativ.de
http://www.univativ.de

Darmstadt, Stuttgart, Karlsruhe, Düsseldorf

-----Ursprüngliche Nachricht-----
Von: Jonas Lundberg [mailto:my.name.is.hans@gmail.com] 
Gesendet: Mittwoch, 7. Juni 2006 14:19
An: users@cocoon.apache.org
Betreff: How to extract image, audio and video metadata from media files in
Cocoon?

I am working on a content management system, where I would like to
import images for image galleries, audio for podcasting, and video for
video galleries. When doing this, it would be very useful to be able
to figure out the dimensions of images, the length of podcasts, and
the dimensions and length of videos.

How do you people achieve this in Cocoon? Does anyone have a method to
share? Either for extracting metadata from the files, or for measuring
them.

Regards
Hans

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org