-   Linux - Server (
-   -   Apache handling mpg and mp4 (

SernOne 05-17-2013 02:23 PM

Apache handling mpg and mp4
Hello all I am having an issue with apache handling these types of files, i've added the AddType for both in the .htaccess file and in the httpd.conf and still nothing

here's what im getting

"GET /profile_videos/tdatech/1368814103-ResizedVideo_1360449282341.mpg HTTP/1.1" 304 -

any help please?

Habitual 05-17-2013 04:33 PM

SernOne 05-17-2013 06:02 PM


Originally Posted by Habitual (Post 4953315)

Thank you for that , i was chasing a ghost in that respect then. However i guess the root of the problem is that its not handling MPG's or MP4's from my webserver. However ogg files work so I am still at a crossroads.

TypesConfig /etc/mime.types

in there i have

video/mp4 mp4 mpg4
video/mpeg mpeg mpg mpe

Which is stock with the config so i know that's ok and here is my HTML.

                <video width="715" height="303" controls autoplay>
                        <source src="profile_videos/tdatech/1368814103-ResizedVideo_1360449282341.mpg" type="video/mpg" />
                        Your browser does not support the video tag.

Thank you once again for the quick reply's i always get here and the help.

SernOne 05-20-2013 03:08 PM

I am still struggling with this one if anyone has another idea it would be very much appreciated.

bloodstreetboy 05-24-2013 09:05 AM

Why don't you use the player to play the files. Use this code in your html file.

<table width="95%" border="0" align="center" cellpadding="0" cellspacing="5">
<td width="60%" align="center">
<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
WIDTH="320" HEIGHT="256" >
<PARAM NAME="src" VALUE="http://localhost/flv-avi-mpg-mov-mkv-mp4-player/b.flv">
<PARAM NAME="autoplay" VALUE="true">
<PARAM NAME="controller" value="true">
<EMBED SRC="QTMimeType.pntg" TYPE="image/x-macpaint"
PLUGINSPAGE="" QTSRC="http://localhost/flv-avi-mpg-mov-mkv-mp4-player/b.flv"
WIDTH="500" HEIGHT="300" AUTOPLAY="true" CONTROLLER="true">
Now instead of this path
Give the proper path of the video file with sufficient permissions.
Now open this html file in browser and see if you are able to play the files or not.

SernOne 05-25-2013 06:28 PM

Thanks mate! how come it wouldn't play nice with HTML5 though?

SernOne 05-25-2013 08:00 PM

Right then found a few issues with this way , can't play these videos on all browsers

bloodstreetboy 05-26-2013 07:31 AM

Have you flash installed in all your browsers?

Read these threads.

SernOne 05-27-2013 12:22 AM

Well yes but I'm looking for a method of users to upload videos in their profiles. How come html5 doesn't work any other methods you can suggest?

bloodstreetboy 05-27-2013 01:32 AM

The HTML5 video may play in Safari, Chrome and IE 9 but not Firefox or IE 7-8. If you fix the MIME-type issue, it will play in Firefox.

If you’re using the Apache web server or some derivative of Apache, you can use an AddType directive in your site-wide httpd.conf or in an .htaccess file in the directory where you store your video files. (If you use some other web server, consult your server’s documentation on how to set the Content-Type HTTP header for specific file types.)

AddType video/mpg .mpg
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm

AddType audio/mpeg .mp3
AddType audio/ogg .ogg
AddType audio/mp4 .m4a
AddType audio/wav /wav
Read this too

All times are GMT -5. The time now is 11:31 PM.