video duration for uploaded files

17 views
Skip to first unread message

Marco Mariani

unread,
Jun 8, 2012, 8:25:40 AM6/8/12
to mediacore-...@googlegroups.com
Hi there!

I found this old ticket:
https://github.com/mediacore/mediacore-community/issues/15

about setting the duration value of media, but I found no trace of the code in the sources.

So I added simple support for hachoir-metadata (pure python, license GPLv2, unchanged):

https://github.com/mediacore/mediacore-community/pull/144

and wonder if it's the right approach, because there might be a reason it was not done back then,
or I might miss something :-/

thanks

Felix Schwarz

unread,
Jun 8, 2012, 10:08:13 AM6/8/12
to mediacore-...@googlegroups.com
Hi Marco,

Am 08.06.2012 14:25, schrieb Marco Mariani:
> So I added simple support for hachoir-metadata (pure python, license GPLv2,
> unchanged):
>
> https://github.com/mediacore/mediacore-community/pull/144
>
> and wonder if it's the right approach, because there might be a reason it was
> not done back then, or I might miss something :-/

While I can't say why it wasn't done I suspect there were too many other
things to do and customers using Panda didn't have the problem...

I have some questions about hachoir (I never used it so far) and I suspect you
can answer them easily:
1. Does hachoir support Python 2.4+? I like to keep support for Python 2.4
for a while. If it doesn't support 2.4, let's try to make the dependency
optional.
2. Is hachoir GPL v2 only or v2+. Only the latter would be compatible with
MediaCore so we really need v2+ (or v3).
3. Do you have any knowledge if hachoir works on Windows or MacOS? While all
production instances I'm aware of run under Linux I'd hate to prevent
adventurous users from running it on system of their choice.

That being said, thank you very much for your contribution, much appreciated. :-)

fs

Marco Mariani

unread,
Jun 18, 2012, 9:21:10 AM6/18/12
to mediacore-...@googlegroups.com
On 8 June 2012 16:08, Felix Schwarz <felix....@oss.schwarz.eu> wrote:

I have some questions about hachoir (I never used it so far) and I suspect you
can answer them easily:

Not really, GPL makes me head go boom, and sorry for the delay, I was on holiday
 
1. Does hachoir support Python 2.4+?

So it seems, I'm going to test that
 
2. Is hachoir GPL v2 only or v2+.

the egg says v2

There is another library I didn't try, kaa.metadata (listed as python 2.6 and 2.7) which is
released as GPL with no release specified, so it should be v2+

 
Only the latter would be compatible with MediaCore so we really need v2+ (or v3).

I am no licensing expert, but I suppose that making the dependency optional (upon being able
to import the module and enable it in the admin settings) without distributing anything hachoir related
with mediacore, could be acceptable.

Every user is then free to "pip install hachoir-metadata" on its own virtualenv, or at the system level.

Alternative approach: a mediacore plugin (or two, for both hachoir and kaa, separate egg, possibly separate licenses)
that monkeypatches LocalFileStorage (or subclass + override the registration, if possible).

 
3. Do you have any knowledge if hachoir works on Windows or MacOS?

It's 100% python, I'm going to test on mac asap

so, to recap, I'll find the time if it helps:

1) ask hachoir authors to re-relase as v2+ :)
2) make hachoir optional or plug in
3) try hachoir with 2.4 and osx
4) do the same with kaa.metadata


Marco Mariani

unread,
Jun 18, 2012, 10:29:11 AM6/18/12
to mediacore-...@googlegroups.com
On 18 June 2012 15:21, Marco Mariani <bir...@gmail.com> wrote:


here is an (even simpler) implementation of the same with kaa.metadata

https://github.com/mmariani/mediacore-community/tree/kaa

but I had to manually pip install kaa_base and kaa_metadata since there is a mismatch in the dependencies
Untested (for now) with python 2.4 or osx

The license is stated as GPL with no version number

yet another option would be GNU libextractor which is GPL (2 or later) and has some python wrappers, but relies on C code.

Felix Schwarz

unread,
Jun 18, 2012, 4:49:06 PM6/18/12
to mediacore-...@googlegroups.com
Hi Marco,

Am 18.06.2012 15:21, schrieb Marco Mariani:
> 2. Is hachoir GPL v2 only or v2+.
>
> the egg says v2

Ok, I sent a mail to the hachoir mailing list [1] - maybe they can change the
licensing without too many troubles (or just add a clarification). From my
experience too many free software projects are very mere imprecise and fix
such minor things if you ask :-)

Should we wait what comes out here or go the kaas route? (Also for them we
would need to clarify the licensing, "GPL" without a version number looks
bogus to me.)

I don't think we should try to find loopholes in the GPL. If you don't like
dealing with licensing, I'll try to get that done for you.

Thank you very much for all your pull requests and commits - looks like your
going for commit access soon ;-)

Felix

[1] http://thread.gmane.org/gmane.comp.python.hachoir/564

Felix Schwarz

unread,
Jun 18, 2012, 4:56:50 PM6/18/12
to mediacore-...@googlegroups.com

I checked kaa quickly:
- pypi says 'GPL' for kaa-metadata
- github (https://github.com/freevo/kaa-base/) says LGPL

To me it looks like some modules are GPL while the more basic ones are LGPL:
http://doc.freevo.org/api/kaa/#svn-access

I found no way to contact the authors directly though.

fs

Marco Mariani

unread,
Jun 18, 2012, 5:04:09 PM6/18/12
to mediacore-...@googlegroups.com
On 18 June 2012 22:56, Felix Schwarz <felix....@oss.schwarz.eu> wrote:

To me it looks like some modules are GPL while the more basic ones are LGPL:
http://doc.freevo.org/api/kaa/#svn-access

yes. GPL with no version, in my understanding, means "any" version

BTW, 'enzyme' is GPL3 but uses syntax that doesn't work with 2.4, could be adapted but it's probably not worthwhile

https://github.com/Diaoul/enzyme

Felix Schwarz

unread,
Jun 23, 2012, 9:25:59 AM6/23/12
to mediacore-...@googlegroups.com
Hi Marco,

Am 18.06.2012 16:29, schrieb Marco Mariani:
> here is an (even simpler) implementation of the same with kaa.metadata
>
> https://github.com/mmariani/mediacore-community/tree/kaa
>
> The license is stated as GPL with no version number

I checked kaa.metadata more in depth now. There are license comments in
setup.py as well as files in src which explicitely state that the code is
covered under GPL v2 or later. I found no contradicting comments within their
code.

According to the FSF's GPL compatibility matrix [1] it's ok for us to use (or
even include) code under LGPL v2.1 only (kaa.base).

The project activity doesn't look too bad (better than hachoir) and the API
seems easy enough to use for us. Therefore I'm in favor of your kaa-based
implementation.

Items left before the feature is done:
- check what happens if the "video" file contains only random data, will
kaa.metadata throw an exception in that case? (error-handling)
- install kaa.metadata on a bare-bones system with MediaCore prerequisites
installed. Check if there are missing requires on their side.
- add the requirement to setup.py
- fetch the appropriate tar.gz and upload it to mediacore.com
- write short release notes ideally with a video demo.

fs
[1] http://gplv3.fsf.org/dd3-faq#compat-matrix-footnote-8

Marco Mariani

unread,
Jun 23, 2012, 9:46:01 AM6/23/12
to mediacore-...@googlegroups.com
On 23 June 2012 15:25, Felix Schwarz <felix....@oss.schwarz.eu> wrote:

Items left before the feature is done:

thanks, I'll do them soon

Felix Schwarz

unread,
Jun 25, 2012, 10:16:39 AM6/25/12
to mediacore-...@googlegroups.com
Am 23.06.2012 15:25, schrieb Felix Schwarz:
> - install kaa.metadata on a bare-bones system with MediaCore prerequisites
> installed. Check if there are missing requires on their side.

[x] I checked this on a CentOS 6 system (Python 2.6) and it works nicely
there. I'll check a CentOS 5 system later but I think we can consider
this done.


fs

Felix Schwarz

unread,
Jun 25, 2012, 3:43:06 PM6/25/12
to mediacore-...@googlegroups.com

I just noticed that kaa-base requires Python 2.5+.

From my experience the number of Python 2.4 installs reduces over time, since
severals months I did not set up a new MediaCore instance using Python 2.4.
Therefore I'd be ok with kaa to parse the duration as long as it is optional
(so MediaCore works fine with Python 2.4, just without duration parsing).

Any objections?

fs

Domen Kožar

unread,
Jun 25, 2012, 3:48:05 PM6/25/12
to mediacore-...@googlegroups.com
I coded this long time ago, but didn't release it due to some project specific code. I went for hachoir because original author was responsive enough to implement webm support in few days. Since kaa.metadata support mkv, it should be trivial to ad webm support :)


fs

--
You received this message because you are subscribed to the Google
Groups "MediaCore CE Developers" group.

You may also be interested in our facebook:
http://www.facebook.com/pages/MediaCore-Video-and-Podcasting-Platform/296505876256

You may follow us on twitter:
http://twitter.com/simplestation

To post to this group, send email to
mediacore-...@googlegroups.com
To unsubscribe from this group, send email to
mediacore-develo...@googlegroups.com

For more options, visit this group at
http://groups.google.com/group/mediacore-developers?hl=en?hl=en

Felix Schwarz

unread,
Jun 25, 2012, 6:06:45 PM6/25/12
to mediacore-...@googlegroups.com
Hi Domen,

Am 25.06.2012 21:48, schrieb Domen Kožar:
> I coded this long time ago, but didn't release it due to some project specific
> code. I went for hachoir because original author was responsive enough to
> implement webm support in few days. Since kaa.metadata support mkv, it should
> be trivial to ad webm support :)

webm support is a good catch, we should check that for kaa (even though the
lack of webm support would be just another task for later to me).

Unfortunately hachoir seems to be almost dead these days:
https://bitbucket.org/haypo/hachoir/changesets
http://thread.gmane.org/gmane.comp.python.hachoir/

Also with a GPLv2-only license there is no way we can ship this...

How did you get in touch with the author?

fs

Marco Mariani

unread,
Jun 27, 2012, 11:44:26 AM6/27/12
to mediacore-...@googlegroups.com
On Sat, Jun 23, 2012 at 3:46 PM, Marco Mariani <bir...@gmail.com> wrote:

Items left before the feature is done:
- check what happens if the "video" file contains only random data, will
 kaa.metadata throw an exception in that case? (error-handling)

It should not happen, I tried to feed garbage data and added an extra check for that,
but then I don't have a lot of broken video files, with semi-valid metadata.

 
- install kaa.metadata on a bare-bones system with MediaCore prerequisites
 installed.

Yes, I always use a clean buildout from a virtualenv.
 

- add the requirement to setup.py

this is a little troublesome, as I need to make sense of the dependencies, installing from pypi does not work for me.


Felix Schwarz

unread,
Jun 27, 2012, 2:46:39 PM6/27/12
to mediacore-...@googlegroups.com

Am 27.06.2012 17:44, schrieb Marco Mariani:
> It should not happen, I tried to feed garbage data and added an extra check
> for that, but then I don't have a lot of broken video files, with semi-valid metadata.

I think garbage data is good enough for a start. :-)

> - add the requirement to setup.py
>
> this is a little troublesome, as I need to make sense of the dependencies,
> installing from pypi does not work for me.

Are you aware that MediaCore's setup.cfg blocks pypi? This was done by
SimpleStation so that there are known "good" versions. Try to install the egg
manually. I'll take care to get this uploaded to mediacore.com.

fs

Marco Mariani

unread,
Jun 28, 2012, 6:16:33 AM6/28/12
to mediacore-...@googlegroups.com

On 27 June 2012 20:46, Felix Schwarz <felix....@oss.schwarz.eu> wrote:
 

> this is a little troublesome, as I need to make sense of the dependencies,
> installing from pypi does not work for me.

Are you aware that MediaCore's setup.cfg blocks pypi? This was done by
SimpleStation so that there are known "good" versions.

Indeed, the kaa-data 0.6.0 on pypi is a bad version and breaks when reading the setup.py of kaa-metadata
(the namespace package part is a little unusual I think)
I suppose there will be some other release before 1.0

But for the feature we need, the github master versions work fine.


Try to install the egg
manually. I'll take care to get this uploaded to mediacore.com.

They work with pip (just pip install package.tar.gz) but I stull have issues with easy_install
and can't get them to build a .egg.

I attach them to this reply, as I got them from github.
For which platforms do you need .eggs?
Sorry, I don't have more time at the moment


freevo-kaa-base-394fd23.tar.gz
freevo-kaa-metadata-76f785b.tar.gz

Felix Schwarz

unread,
Jun 28, 2012, 6:33:13 AM6/28/12
to mediacore-...@googlegroups.com

Am 28.06.2012 12:16, schrieb Marco Mariani:
> Indeed, the kaa-data 0.6.0 on pypi is a bad version and breaks when reading
> the setup.py of kaa-metadata
> (the namespace package part is a little unusual I think)
> I suppose there will be some other release before 1.0
>
> But for the feature we need, the github master versions work fine.

"kaa-data"? I assume you mean kaa-base?
kaa-base 0.6 seems to be quite old (2009) so I guess we just go with the
current development versions (0.99.x).

> They work with pip (just pip install package.tar.gz) but I stull have issues
> with easy_install and can't get them to build a .egg.

Don't worry. I'll fetch the tarballs, just let me know the version/revision
you tested. In generall we just source upload tarballs so they can be compiled
correctly on each platform.

fs

Marco Mariani

unread,
Jun 28, 2012, 6:43:21 AM6/28/12
to mediacore-...@googlegroups.com
On 28 June 2012 12:33, Felix Schwarz <felix....@oss.schwarz.eu> wrote:

"kaa-data"? I assume you mean kaa-base?

of course
 
kaa-base 0.6 seems to be quite old (2009) so I guess we just go with the
current development versions (0.99.x).

yes, except the ones (0.99.x) in pypi don't work together, so I took them from github
and opened https://github.com/freevo/kaa-base/issues/5
 
Don't worry. I'll fetch the tarballs, just let me know the version/revision
you tested. In generall we just source upload tarballs so they can be compiled
correctly on each platform.

in this case, it might be useful to check they compile on each platform.

I just tested them with venv+pip in 2.6 and 2.7, but easy_install did not work.
Will have a look at what's happening there as well..


Marco Mariani

unread,
Jun 28, 2012, 12:16:24 PM6/28/12
to mediacore-...@googlegroups.com
On 28 June 2012 12:33, Felix Schwarz <felix....@oss.schwarz.eu> wrote:


Don't worry. I'll fetch the tarballs, just let me know the version/revision
you tested. In generall we just source upload tarballs so they can be compiled
correctly on each platform.

As mentioned in the issue, the author of kaa.base will debug it with venv+easy_install and tag a release next week.
 
have a nice week end, and we'll maybe catch up at europython if you're there

Felix Schwarz

unread,
Aug 6, 2012, 11:07:51 AM8/6/12
to mediacore-...@googlegroups.com
Hi Marco,

Am 28.06.2012 18:16, schrieb Marco Mariani:
> As mentioned in the issue, the author of kaa.base will debug it with
> venv+easy_install and tag a release next week.

just catching up: Is the problem resolved by now?

fs

Marco Mariani

unread,
Aug 12, 2012, 1:04:06 PM8/12/12
to mediacore-...@googlegroups.com
On 6 August 2012 17:07, Felix Schwarz <felix....@oss.schwarz.eu> wrote:

> As mentioned in the issue, the author of kaa.base will debug it with
> venv+easy_install and tag a release next week.

just catching up: Is the problem resolved by now?

Felix Schwarz

unread,
Aug 13, 2012, 4:50:34 AM8/13/12
to mediacore-...@googlegroups.com

Am 12.08.2012 19:04, schrieb Marco Mariani:
> On 6 August 2012 17:07, Felix Schwarz <felix....@oss.schwarz.eu
> <mailto:felix....@oss.schwarz.eu>> wrote:
>
> > As mentioned in the issue, the author of kaa.base will debug it with
> > venv+easy_install and tag a release next week.
>
> just catching up: Is the problem resolved by now?
>
>
> Not quite, vacations are ongoing :)

Ah, right - IIRC August is the main vacation time in Italy, right? (in Germany
that's July usually)

Anyhow I added some information to the ticket and for me also kaa-base master
is broken with venv. In their __init__.py I see a couple of "advanced" import
stuff which is likely the culprit.

fs

Reply all
Reply to author
Forward
0 new messages