mpeg2encode licensing issue

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
AdamW
Posts: 10
Joined: 2008-08-07T11:19:06-07:00

mpeg2encode licensing issue

Post by AdamW »

Hi, there. I thought I'd reported this somewhere before but can't find any trace of it, so I'm doing it again. :)

ImageMagick relies on the 'mpeg2encode' tool for some MPEG video operations.

There's a problem here. mpeg2encode is not free / open source software. Its license terms - you can see them here: http://www.sfr-fresh.com/unix/misc/mpeg ... c/Makefile - don't explicitly address modification and redistribution, and you can't assume those rights if they're not explicitly granted. So it's not an F/OSS license.

This means that I, as a packager for Mandriva, cannot have mpeg2encode available for ImageMagick to use, so our ImageMagick package can't do the operations for which it relies on mpeg2encode.

It would be better if ImageMagick could switch to a free tool, like mpeg2enc from mjpegtools. Is there any possibility of this? Thanks.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: mpeg2encode licensing issue

Post by magick »

We tried building the latest mjpegtools release, 1.9.0rc3, and we get a compile error:
  • In file included from macroblock.hh:53,
    from macroblock.cc:25:
    encodertypes.h: In member function 'int MotionVector::CodingPenaltyForSAD() const':
    encodertypes.h:73: error: 'abs' was not declared in this scope
    macroblock.cc: In member function 'void MacroBlock::SelectCodingModeOnVariance()':
    macroblock.cc:58: error: 'INT_MAX' was not declared in this scope
In addition, mpeg2enc does not appear to be available from livna. We hesitate to depend on unstable software or software that is not readily available.

We did add this issue to our TO-DO list but we currently do not have an ETA on when we will have a solution.

If someone wants to tackle this problem and post a patch, we will get it into a future release of ImageMagick.
AdamW
Posts: 10
Joined: 2008-08-07T11:19:06-07:00

Re: mpeg2encode licensing issue

Post by AdamW »

One of these patches likely fixes it:

http://svn.mandriva.com/cgi-bin/viewvc. ... t/SOURCES/

mjpegtools is pretty widely available and used. I know mpeg2encode cannot be made available in Fedora because of the licensing issue (I've discussed this with Fedora's licensing guy, Tom Callaway).
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: mpeg2encode licensing issue

Post by magick »

These sorts of issues diminish our interest in mpeg2enc. It does not mean we won't use it, it just means we need to do additional research before we can bless it as a delegate in ImageMagick. Keep in mind that you could generate a patch specific to ImageMagick on Mandriva that uses mpep2enc until we get a blessed patch.
AdamW
Posts: 10
Joined: 2008-08-07T11:19:06-07:00

Re: mpeg2encode licensing issue

Post by AdamW »

Yes, but I try to avoid distro-specific stuff and work with upstream wherever possible. That and I have to figure out how to crowbar it in and adjust the parameters accordingly. =)
AdamW
Posts: 10
Joined: 2008-08-07T11:19:06-07:00

Re: mpeg2encode licensing issue

Post by AdamW »

See my comment on the Ubuntu bug on this issue here:

https://bugs.launchpad.net/ubuntu/+sour ... +bug/59908

I think I have a patch that will be good for decoding, but encoding is substantially trickier, as no usable modern encoder understands the .par file system that mpeg2encode uses, so it requires rather more substantial changes, and I am not a hacker at all.

BTW, the Google results for "mpeg2encode" and "mpeg2decode", if you look at them, will give you an idea of the extent of this issue - people from all sorts of distributions keep finding out that these applications are missing and so the ImageMagick functionality doesn't work.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: mpeg2encode licensing issue

Post by magick »

A patch from you or another user is the best path to getting this into the ImageMagick source base as quickly as possible. We are in agreement with you but the ImageMagick developers are currently swamped and we will not get to this problem for a minimum of several months.
AdamW
Posts: 10
Joined: 2008-08-07T11:19:06-07:00

Re: mpeg2encode licensing issue

Post by AdamW »

I can't get my patch attempt working. :\ Details in the Launchpad report.

For now I'll see if it's possible to centralize discussion of this issue here and in Launchpad - maybe if we can pull in the various places it's been discussed, we'll find someone who has the smarts to fix it.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: mpeg2encode licensing issue

Post by magick »

We can get decoding working for you, its encoding that is a bit more problematic. Our question is if we use mpeg2enc for encoding should we not use mpeg2dec for decoding? Or is ffmpeg a better choice?
AdamW
Posts: 10
Joined: 2008-08-07T11:19:06-07:00

Re: mpeg2encode licensing issue

Post by AdamW »

Well, first point, they're not actually related: mpeg2dec is part of libmpeg2 - http://libmpeg2.sourceforge.net/ - while mpeg2enc is part of mjpegtools . Actually completely separate projects.

But aside from that, yeah, mpeg2dec would be the logical choice (smaller and I think fewer deps than ffmpeg) - only it doesn't actually seem possible to get it to do what we want. As far as I can see it's hard coded to output files simply in the current directory, with sequential numerical names, and it only seems to do pgm , not ppm. So I figured it's not a workable option. But if it is - if one of the other output formats works and you can work with the filenames - then yes, it would probably be the sensible choice.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: mpeg2encode licensing issue

Post by magick »

Ok, we'll add ffmpeg support to ImageMagick this evening. We'll defer support for mpeg2enc to a later date. One of the reasons for sticking with mpeg2decode and mpeg2encode is that they both work under Windows and they are lightweight. We'll need to do a conditional compile for MPEG for Linux vs. Windows.
AdamW
Posts: 10
Joined: 2008-08-07T11:19:06-07:00

Re: mpeg2encode licensing issue

Post by AdamW »

Thanks a lot for that.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: mpeg2encode licensing issue

Post by magick »

Ok, got it working. Confirm that ffmpeg is your final decision (as the best MPEG decoder). If so, we'll get the patch into the ImageMagick subversion trunk in about 2 hours.
AdamW
Posts: 10
Joined: 2008-08-07T11:19:06-07:00

Re: mpeg2encode licensing issue

Post by AdamW »

I can't think of anything better. The only other obvious thing that comes to mind is transcode, but at least on MDV, transcode's deps are rather heavier than ffmpeg's. I think ffmpeg is the best option. So if anyone else disagrees, speak now or forever hold your peace =)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: mpeg2encode licensing issue

Post by magick »

Ok, done. The patch is in the subversion trunk and will be available as ImageMagick 6.4.2-8 Beta sometime tomorrow.
Post Reply