Page MenuHomePhabricator

Undefined index in handlers/Mp4Handler.php
Closed, ResolvedPublic

Description

When Mp4Handler is used to handle MP3 files, there is a warning: Notice: Undefined index: video in (MediaWiki path)/extensions/TimedMediaHandler/handlers/Mp4Handler/Mp4Handler.php on line 95.

isset ($metadata['video']) && should be added to the condition in that line.

Event Timeline

alex-mashin raised the priority of this task from to Needs Triage.
alex-mashin updated the task description. (Show Details)
alex-mashin added a project: TimedMediaHandler.
alex-mashin subscribed.

I'm assuming that using Mp4Handler for mp3 files is a hack of some kind that should not be done. :D Does this also happen on audio-only .m4a/.mp4 files?

In T115197#1718751, @brion wrote:

I'm assuming that using Mp4Handler for mp3 files is a hack of some kind that should not be done.

Any alternatives to handle MP3?

In T115197#1718751, @brion wrote:

D Does this also happen on audio-only .m4a/.mp4 files?

Sorry, haven't got any.

Change 247548 had a related patch set uploaded (by TheDJ):
Do not throw errors on audio-only MP4 files

https://gerrit.wikimedia.org/r/247548

@alex-mashin Would be handy if you could point us at an example file so we can test.

So, if I try to upload an .mp4 file with only an AAC audio track:

, I get a failure during the upload process:

File extension ".mp4" does not match the detected MIME type of the file (audio/mp4).

(This is with $wgTmhEnableMp4Uploads enabled.)

Presumably needs more work elsewhere to support audio-only files.

Meanwhile, MP3 support should be done with a dedicated handler, just as with other file types.

Split mp4 audio details out to T116094; MP3 is in T115170.

Change 247548 merged by jenkins-bot:
Do not throw errors on audio-only MP4 files

https://gerrit.wikimedia.org/r/247548

brooke claimed this task.

Patch merged per above.