[mythtv-users] MythWeb serves up "File Not Found Error' to Webbrowsers

jameskel at comcast.net jameskel at comcast.net
Mon Aug 12 18:25:47 UTC 2013


MythBox
=======
MythTV v0.26.0
ubuntu 12.0.4.2 LTS
Opera/9.80 (X11; Linux x86_64) Presto/2.12.388 Version/12.16 (I use Opera's Dragonfly option to view network traffic)
    Shockwave Flash 11.2 r202
    VLC web plugin v2.0.8 Twoflower

FireFox 23.0 - Ubuntu Canonical 1.0 (I use FF addon: "HTTP Live Headers" to record/capture network traffic)
    Shockwave Flash 11.2 r202
    VLC web plugin v2.0.8 Twoflower

Chromium	28.0.1500.71 (Developer Build 28.0.1500.71-0ubuntu1.12.04.1) Ubuntu 12.04
    OS	Linux 
    Blink	537.36 (trunk at 149738)
    JavaScript	V8 3.18.5.9
    Flash	11.2 r202
    VLC web plugin v2.0.8 Twoflower



PROBLEM: 
Regardless of which computer I use , Mythbox (localhost) or Win7 PC (on home based LAN), no movie plays.


DESCRIPTION:
I'm trying to stream video/movies to my webbrowser (ie:Firefox, Chrome, Opera, IE). I've created these movies using Handbrake 0.9.9 rev0 and have "web optimized" m4v files. These movies play fine using MythTV's UPNP (media server), and via MythBox's Samba server (Network Shares), but I can't get them to play/stream using a webbrowser.

When I access Mythweb via the webbrowser, it appears normal. I see the webpages served up and the video list appears with all of the coverart visible. I should also note that for the purposes of testing, I've disabled the login authentication code that appears in /etc/apache2/sites-available/mythweb.conf.
In addition for testing purposes, I selected a movie that is an .mp4 format rather than .m4v only b/c I noticed that the php script /usr/share/mythtv/mythweb/modules/video/stream.php explicitly supports mp4 and not m4v.

So when I use the Mythbox's Webbrowsers (a.k.a localhost) to click on a movie, here are the headers recorded....

GET /mythweb/video/stream?Id=1 HTTP/1.1
Host: localhost
User-Agent: Opera/9.80 (X11; Linux x86_64) Presto/2.12.388 Version/12.16
Accept: text/html, application/xml;q=0.9, application/xhtml xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Accept-Language: en
Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1
Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0
Connection: Keep-Alive, TE
TE: deflate, gzip, chunked, identity, trailers

RESPONSE:
HTTP/1.0 500 Internal Server Error
Date: Sun, 11 Aug 2013 01:21:35 GMT
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.3.10-1ubuntu3.7
Set-Cookie: mythweb_id=a2onv38vlnnptsni4t57buukq7; expires=Mon, 11-Aug-2014 01:21:35 GMT; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Disposition: filename="JS2012.mp4"
Connection: close
Content-Type: applicatoin/octet-stream



The first thing I noticed is that the "Content-Type:" is misspelled. So I edited the php script /usr/share/mythtv/mythweb/modules/video/stream.php so that this typo was fixed. But after I fixed the typo, I noticed that the header response was still wrong. It is wrong, b/c the code with the script should have identitied the mp4 file type and served up the Content-Type: video/mp4 and not Content-Type: application/octet-stream. Again, the code within the script specifies this but the output did not match.

After another review of the code within the php script /usr/share/mythtv/mythweb/modules/video/stream.php I changed one line:
FROM:     switch (substr($fname, strrpos($fname, '.'))) {
TO:     switch (substr($fname, strrpos($fname, '.')+1)) {

After restarting the apache server (/etc/init.d/apache2 restart), now the header for mp4 file types was correct:
Content-Type: video/mp4 and not the original mispelled header Content-Type: applicatoin/octet-stream.

But now after these changes to the php script, the webbrowsers are producing "File Not Found" errors. For some reason the URL served up by Mythweb http://localhost/mythweb/video/stream?Id=1 can't be read and the browsers hang or produce an error message.


Does anyone know how to proceed so that I can get a movie to stream?
Why isn't Mythweb sending the movie to the webbrowser? 
What link is missing between URL (http://localhost/mythweb/video/stream?Id=1) and actual movie full pathname?



More information about the mythtv-users mailing list