Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in support of MPEG video after coder name-change to "video" #181

Open
zerocrates opened this issue Jun 4, 2022 · 5 comments
Open

Comments

@zerocrates
Copy link

zerocrates commented Jun 4, 2022

ImageMagick version

6.9.11-60

Operating system

Linux

Operating system, version and so on

Ubuntu 22.04

Description

The new "video" coder doesn't declare an "MPEG" format anymore, but there's several leftovers in the code referring to it, i.e.:

The result is that IM detects MPEG-1 ".mpeg/.mpg" video files as the MPEG format but doesn't know what to do from there. You can work around it by explicitly specifying the format of any of the video formats that are registered, but by default it will "magic" detect the format MPEG and fail (and of course manually specifying the format MPEG also fails).

I assume that this was just a bit of a mistake/confusion since MPEG used to be the generic coder name before it was changed to VIDEO.

Steps to Reproduce

$ identify test.mpg

From IM 6.9.11-60:

identify: no decode delegate for this image format `MPEG' @ error/constitute.c/ReadImage/575.

While IM 6.9.10-23 works. As does identify "MP4:test.mpg" on 6.9.11.

Images

No response

@urban-warrior
Copy link
Member

We could not reproduce this issue with the latest release of ImageMagick version 6 (6.9.12-54) or 7 (7.1.0-39). Upgrade your release and you should get expected results.

@zerocrates
Copy link
Author

The problem doesn't exist in latest 7, but I do still reproduce in 6. Built from current main branch:

Version: ImageMagick 6.9.12-55 beta Q16 x86_64 e76b0f833:20220620 https://legacy.imagemagick.org
identify: no decode delegate for this image format `MPEG' @ error/constitute.c/ReadImage/576.

The 7 codebase contains code registering the MPEG format with the video coder that is absent in 6.

zerocrates added a commit to zerocrates/ImageMagick6 that referenced this issue Jun 28, 2022
@zerocrates
Copy link
Author

zerocrates commented Jun 28, 2022

Looking more closely, what happened here is that the 6 version of the change to the "video" coder made a (presumed) mistake that the 7 version did not: it changed the MPEG format registration to VIDEO as well. So if you look at 6 vs 7, 6 now has a VIDEO format in -list format that's absent from 7 (and of course there's the basis of this issue: -list format on 6 is missing MPEG).

I linked to a line in the 7 codebase in my last comment. Note that the corresponding line in 6 registers the format VIDEO where 7 (and old versions of 6) register MPEG.

@zerocrates
Copy link
Author

zerocrates commented Jun 28, 2022

Recompiling with this change applied resolves the issue.

A simpler version that just changes the string on video.c's line 282 from "VIDEO" back to "MPEG" would also do it, though would be a possible issue for anyone having come to rely on the presence of the VIDEO format, since it has now existed in 6 for a while.

@urban-warrior
Copy link
Member

Thanks for the problem report. We can reproduce it and will have a patch to fix it in the GIT main branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://imagemagick.org/download/beta/ by sometime tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants