LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache handling mpg and mp4 (https://www.linuxquestions.org/questions/linux-server-73/apache-handling-mpg-and-mp4-4175462379/)

SernOne 05-17-2013 01: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 03:33 PM

http://drron.com.au/2008/07/09/dont-...s-your-friend/

SernOne 05-17-2013 05:02 PM

Quote:

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/MP4V-ES
video/mpeg mpeg mpg mpe
video/mpeg4-generic

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

                <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.
                </video>

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

SernOne 05-20-2013 02:08 PM

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

bloodstreetboy 05-24-2013 08:05 AM

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

<table width="95%" border="0" align="center" cellpadding="0" cellspacing="5">
<tr>
<td width="60%" align="center">
<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab"
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="http://www.apple.com/quicktime/download" QTSRC="http://localhost/flv-avi-mpg-mov-mkv-mp4-player/b.flv"
WIDTH="500" HEIGHT="300" AUTOPLAY="true" CONTROLLER="true">
</EMBED>
</OBJECT>
Now instead of this path
http://localhost/flv-avi-mpg-mov-mkv-mp4-player/b.flv
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 05:28 PM

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

SernOne 05-25-2013 07:00 PM

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

bloodstreetboy 05-26-2013 06:31 AM

Have you flash installed in all your browsers?

Read these threads.
http://stackoverflow.com/questions/1...luding-firefox
http://stackoverflow.com/questions/7...s-all-browsers

SernOne 05-26-2013 11:22 PM

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 12: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.)
Quote:

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
http://stackoverflow.com/questions/6...ot-from-server
http://stackoverflow.com/questions/1...eo-not-playing
http://stackoverflow.com/questions/6...145629#6145629


All times are GMT -5. The time now is 07:29 AM.