Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Can't open mp4 file


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Nov 15, 2017 5:11 AM Last Post By: Greg Reese Threads: [ Previous | Next ]
Greg Reese

Posts: 84
Registered: 7/15/05
Can't open mp4 file  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 14, 2017 6:17 AM
Hi Folks,

I'm using Builder 10.2, Update 1 on Windows 10 in a FireMonkey program. I'm not able to load an MP4 file. I get the error
"Unsupported media file file_name"
I've tried 6 or 7 MP4 files and they all fail with the same error, although Windows' Movie & TV app reads them all.

As far as I can tell I do have the MP4 codec installed. If I call TMediaCodecManager.IsCodedExists("*.mp4") it returns true, meaning that there is a codec for the MP4 extension. Similarly, if I call TMediaCodecManager.GetFileTypesByType( TMediaType ::Video ), the returned list of file extensions includes MP4, indicating that MP4 is a supported format.

I've also tried the StreamingMedia demo program that comes with Builder and it doesn't read seven of the nine video formats it should be demonstrating, including MP4.

Work: AVI, WMV,

Don't work: MOV, MPG, MP4, FLV, SWF, WEBM, MKV

Any suggestions?

Thanks.

Greg Reese

P.S. - On a tangential yet related note, does anyone know what the specific values are that can be passed for the fourth parameter in TMediaCodecManager.RegisterMediaCodecClass? Its signature is

void __fastcall RegisterMediaCodecClass(const System::UnicodeString Extension, const System::UnicodeString Description, TMediaType MediaType, TCustomMediaCodecClass MediaCodecClass);
Remy Lebeau (Te...


Posts: 8,905
Registered: 12/23/01
Re: Can't open mp4 file  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 14, 2017 9:55 AM   in response to: Greg Reese in response to: Greg Reese
Greg Reese wrote:

Work: AVI, WMV,

Don't work: MOV, MPG, MP4, FLV, SWF, WEBM, MKV

According to The TMediaCodecManager documentation:

http://docwiki.embarcadero.com/Libraries/en/FMX.Media.TMediaCodecManager

On Windows, only AVI and WMV "can usually be opened without OS
modifications", even though AVI, WMV, MP4, M4V, and MOV are registered.

P.S. - On a tangential yet related note, does anyone know what the
specific values are that can be passed for the fourth parameter in
TMediaCodecManager.RegisterMediaCodecClass? Its signature is

It is the actual TCustomMediaCodec-derived class that handles the data
type being registered, eg:

class TMyVideoMediaCodec : public TCustomMediaCodec
{
public
    TMedia* __fastcall CreateFromFile(const String AFileName)
    {
        ...
    }
 
    ...
};
 
RegisterMediaCodecClass(L"Ext", L"Description", TMediaType::Video,
__classid(TMyVideoMediaCodec));


--
Remy Lebeau (TeamB)
Greg Reese

Posts: 84
Registered: 7/15/05
Re: Can't open mp4 file  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 15, 2017 5:11 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thanks Remy.
Greg Reese
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02