Author |
Message |
tzoom84
|
Posted: Sat Jul 07, 2007 9:03 pm |
|
Joined: Sat May 26, 2007 9:51 pm
Posts: 130
|
I also had this working with no mods needed in KnoppMyth R5F1.
However, when using the default settings (128 bit / FLV output), it seems to be verrrrry laggy in the video. Audio is clean, but just the video only refreshes like 2 times a second making it difficult to watch.
This was over the internet using a cable connection on both ends.
Any ideas on how I can optimize MythWebFlash?
|
|
Top |
|
 |
cyates
|
Posted: Sun Jul 08, 2007 10:44 pm |
|
Joined: Sun Mar 12, 2006 7:41 pm
Posts: 13
|
Edit the /etc/ffserver.conf file.
Look for the #Flash section.
There is a line that says "VideoFrameRate 2"
Change it to 25 for 25 frames per second.
|
|
Top |
|
 |
tzoom84
|
Posted: Thu Jul 12, 2007 3:04 pm |
|
Joined: Sat May 26, 2007 9:51 pm
Posts: 130
|
Thanks! Got it working immediately after and now fiddling with settings.
Two new issues arose:
1. The same as Spud911 above:
Quote: My only problem is that my videos freeze after 10 minutes or so of playing. I played with the bit rate and as I raise it the time it plays is shorter so I am guessing its a problem with the cached directory or something. Unfortunately I have no clue where that might be.
Any one have any tips on why it dies after 10 mins? After that time, it seems like the ffmpeg process ended because the stat.html no longer is active.
2. I tried to add full screen capabilities using the allowFullScreen tag that is mentioned in the Adobe tutorial here. Before I post chunks of code, is this feature available when using with ffmpeg? And would a navigation bar be available with ffmpeg by changing the settings? (I saw some talk on this a few posts back but no updates since).
Thanks
|
|
Top |
|
 |
elgordo123
|
Posted: Fri Jul 13, 2007 1:52 pm |
|
Joined: Thu Feb 12, 2004 2:54 pm
Posts: 392
Location:
Beaumont, CA
|
BigB. Great work! I got it working just a slight modification.
My mythbox is behind a firewall, apache listening on port 8080, and using a dyndns address. At first I would just get a white box and no stream. Looking at the the page source created by firefox, it had the url to the stream as http:/my.dyndns.url:8080:8090/.....
I edited /var/www/mythweb/modules/tv/tmpl/default/streamrecording.php and commented out lines 77 and 82 (changed to //echo getenv('HTTP_HOST'); and just below each entry I added echo ('my.dyndnsurl.org');
To boost my quality (DSL at both ends) I commented out line 194 to 204 of /etc/ffserver.conf (the flash_128.swf section) and uncommented the flash_256.swf section.
I too am having the problem with it stopping in about 5 minutes, but this is a great start. I'm open to helping you test anything out. I see that the latest versions of vlc support flash streaming, I haven't had time to play with that yet though. Do you think it might be more stable than ffserver?
_________________ ASUS A7N266 Micro-ATX Motherboard
Athlon 2200 processor
512K Kingston PC2100 Memory
MicroAtx Case
2 PVR250's w/remote
eVGA e-GeForce mx4000 (64 Ram with Tv/Out (Svideo))
Lite-on DVD cd-rw combo
120 GB Western Digital
|
|
Top |
|
 |
bigB
|
Posted: Sun Jul 15, 2007 6:04 pm |
|
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location:
Brisbane, Australia
|
Hi elgordo123,
Good to hear you have had some success with the flash streaming. I'm not sure what the problem is with the recordings stopping part way through. I do have this problem as well. Streaming from a webcam works fine for me, so i am suspecting it is something to do with the files and ffmpeg not liking them.
VLC may be a bit better, but another idea would be to pipe the files through mythtranscode to ffmpeg, this may help clean them up and will allow NUV files to work as well. Please feel free to try this, but if i have time, i'll post my results.
NOTE: A flash player is being implemented in 0.21 of mythtv.
Enjoy.
|
|
Top |
|
 |
bigB
|
Posted: Wed Jul 25, 2007 7:15 am |
|
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location:
Brisbane, Australia
|
Hi All,
I have updated the MythwebFlash code to hopefully fix the issue with the 5 minute stream time. I have also added an a choice of 3 different baud rates. Also fixed is the ability to stream from NUV files.
http://www.knoppmythwiki.org/index.php?page=MythWebFlash
Although this works on my PC, I have not been able to confirm the code i have copied and pasted to the wiki. If someone is daring enough to confirm this code for everyone else, i would be greatly preciative.
Kind Regards;
BigB.
|
|
Top |
|
 |
tzoom84
|
Posted: Wed Jul 25, 2007 8:07 am |
|
Joined: Sat May 26, 2007 9:51 pm
Posts: 130
|
Great to hear bigB!
I'll test out the code after work tonight. I'll basically follow the wiki verbatim from a R5F1 perspective and report results tonight.
Any tips on how to get fullscreen flash option working as well? According to Adobe (post above) it is as simple as adding a field in the stream definition. But I couldn't get it to work.
|
|
Top |
|
 |
bigB
|
Posted: Wed Jul 25, 2007 5:13 pm |
|
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location:
Brisbane, Australia
|
Hi Tzoom,
That would be great. I hope it doesn't break your set-up
I should be able to get a full screen mode going fairly easily. I'll see what i can do, the changes will be minimal, so you should be able to proceed with the update in the meantime.
BigB.
|
|
Top |
|
 |
tzoom84
|
Posted: Wed Jul 25, 2007 7:30 pm |
|
Joined: Sat May 26, 2007 9:51 pm
Posts: 130
|
So I got a chance to test and got some interesting results...
My flash status prior to update was that flash was running, but dying in 2-3 mins.
Status after update:
Copied and pasted all files from the wiki verbatim. When loading the stream thru mythweb, I get only a white box.
I checked http://localhost:8090/stat.html and the server runs for ~30 seconds until I presume it recognizes there are no connections and dies off.
So I checked to see what command was being sent from mythweb to my system by echo'ing the bash commend, resulting command was:
Code: bash -c "exec nohup setsid /var/www/mythweb/data/serverecording 1040_20070720210000.mpg 128 1> /dev/null 2> /dev/null &" ...Seemed normal. So I moved on to creating a log where the good stuff happens, /var/www/mythweb/data/serverecording. Here I just echo'ed a bunch of variables as the script ran to see what is going on and where it dies. But heres the #1 interesting outcome, after I load a flash file on mythweb, I check to see if ffserver.conf is created by serverecording, as it should almost at the beginning of the script. No file was created. So it seemed that the mythweb command (above) didn't seem to get processed since it didn't seem serverecording ever started. So, I decided to manually start it using: Code: # /var/www/mythweb/data/serverecording 20070720210000.mpg 128 Finally only now did I get ffserver.conf generated and a log that I put together. When I refreshed the "Stream Recording" mythweb page, the video started, but it was very choppy and strange looking. So it most likely is missing all that pre-serverecording-processing. So the main issues for me seem to be: 1) serverecording isn't starting from mythweb. Any ideas on how to better test this? 2) Funny video output, most likely due to not going thru mythweb to start. And for the curious, here is my log from running serverecording standalone. It should be relatively easy to follow for those familiar with the serverecording script (bigB). Code: ---------------------------------------------------------------------
Starting log Wed Jul 25 21:26:24 EDT 2007 Using file: 1040_20070720210000.mpg and bitrate: 123
ffserver.conf created. Results:
- START OF FFSERVER.CONF -
Port 8090 BindAddress 0.0.0.0 MaxClients 1000 MaxBandwidth 1500 CustomLog -
<Feed feed1.ffm> File /var/www/mythweb/data/feed1.ffm FileMaxSize 0 </Feed>
<Stream flash.swf> Feed feed1.ffm Format swf AudioBitRate 16 AudioChannels 1 AudioSampleRate 11025 AudioCodec mp3 VideoBitRate 300 VideoFrameRate 10 VideoSize 288x160 VideoGopSize 20 VideoCodec flv </Stream>
<Stream stat.html> Format status #ACL allow localhost #ACL allow 192.168.0.0 192.168.255.255 </Stream>
<Redirect index.html> URL http://www.ffmpeg.org/ </Redirect>
- END OF FFSERVER.CONF -
framewidth = 480 - frameheight = 480 - PID_FFSERVER = 5751 - PID_TRANSCODE = 5752 Command run: nice -n 10 /usr/bin/ffmpeg -y -f s16le -ar 48000 -ac 2 -i /var/www/mythweb/data/audout -f rawvideo -r 25 -aspect 16:9 -s "480"x"480" -i /var/www$ Starting while loop. Idle count = 20 Idle count decremented to 19 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count NOT decremented, but set as 2 Idle count decremented to 1 Idle count decremented to 0 Calling 2 kill 9 commands Removing audout and vidout Killing ffserver ... COMPLETE ---------------------------------------------
|
|
Top |
|
 |
bigB
|
Posted: Wed Jul 25, 2007 7:49 pm |
|
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location:
Brisbane, Australia
|
Hi Tzoom84,
Awesome work on checking the update. At this stage, all i can think of is a permissions issue on the serverecording script (or some other file). Can you try running the script manually again under the apache user (www-data on my pc).
Can you describe the "funny video". If it is just bad quality, that can be changed using the 2nd parameter. Default is 128, 256, and 384 are also supported.
BigB.
|
|
Top |
|
 |
bigB
|
Posted: Wed Jul 25, 2007 7:57 pm |
|
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location:
Brisbane, Australia
|
Hi Tzoom84,
Do you still get the "Video loading, click here if refresh fails after 10 seconds" message in the new window before the white window appears? If you don't then something is wrong with the 2 stage loading of the page. The serverecording script in run on the first pass, then the video is displayed on the second.
BigB
|
|
Top |
|
 |
prosonik
|
Posted: Sun Jul 29, 2007 11:15 am |
|
Joined: Sat Nov 13, 2004 2:24 pm
Posts: 59
|
It is Stage 2, i think. oddly enough, i did some investegation. It looks like the script had dramtically changed since the last time i looked at it... However
i changed /dev/null to /whatever.stdout and stderr in /var/www/mythweb/data/serverecording
so for mythtranscode.stout.. I have this:
2007-07-29 10:18:13.717 Using runtime prefix = /usr
2007-07-29 10:18:13.718 Unable to read configuration file mysql.txt
2007-07-29 10:18:13.719 Trying to create a basic mysql.txt file
2007-07-29 10:18:13.719 Could not create //.mythtv
2007-07-29 10:18:13.719 Failed to init MythContext, exiting.
I'm not sure if i'm barking out the right tree. I haven't played with.. Before upgrading, I was using the stock version from the latest release...
If you give me any hints on debugging, I'll trace it through.
prosonik
|
|
Top |
|
 |
bigB
|
Posted: Sun Jul 29, 2007 4:18 pm |
|
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location:
Brisbane, Australia
|
Hi Prosonik,
try this...
ln -s /home/mythtv/.mythtv/mysql.txt /var/www/mythweb/data/mysql.txt
BigB
|
|
Top |
|
 |
elgordo123
|
Posted: Tue Jul 31, 2007 1:15 pm |
|
Joined: Thu Feb 12, 2004 2:54 pm
Posts: 392
Location:
Beaumont, CA
|
I am getting just a whitebox too. I think it is a permission problem. I tried to run the serverecording script manually as user mythtv and got this:
mythtv@mythtv:~$ /var/www/mythweb/data/serverecording 1002_20070706210000.mpg 128
/var/www/mythweb/data/serverecording: line 109: /var/www/mythweb/data/ffserver.pid: Permission denied
/var/www/mythweb/data/serverecording: line 113: /var/www/mythweb/data/transcode.pid: Permission denied
/var/www/mythweb/data/serverecording: line 118: /var/www/mythweb/data/ffmpeg.pid: Permission denied
/var/www/mythweb/data/serverecording: line 130: kill: (9984) - Operation not permitted
/var/www/mythweb/data/serverecording: line 131: kill: (9978) - Operation not permitted
ffserver(9980): Operation not permitted
ffserver: no process killed
I tried running the process as root and no initial errors so I tried to connect with mplayer and it buffered about 5% and then gave "Stream not seekable" over and over but no video. Server then gave me this:
/var/www/mythweb/data/serverecording 1002_20070706210000.mpg 128
/var/www/mythweb/data/serverecording: line 130: kill: (10167) - No such process
/var/www/mythweb/data/serverecording: line 132: 10164 Killed nice -n 10 /usr/bin/mythtranscode -p autodetect -i $DIRECTORY/$file -f /var/www/mythweb/data/ >/dev/null 2>/dev/null
ls -All of /var/www/mythweb/data gives this:
-rw-rw-rw- 1 root root 180 Dec 2 2006 .htaccess
drwxrwxrwx 6 root root 4096 Dec 2 2006 .svn
lrwxrwxrwx 1 root root 17 Jun 14 21:59 cache -> /myth/image_cache
-rw-r--r-- 1 www-data www-data 2084864 Jul 31 11:55 feed1.ffm
-rw-r--r-- 1 www-data www-data 6 Jul 31 11:55 ffmpeg.pid
-rw-r--r-- 1 root root 527 Jul 31 11:55 ffserver.conf
-rw-r--r-- 1 www-data www-data 6 Jul 31 11:55 ffserver.pid
lrwxrwxrwx 1 root root 11 Jun 14 21:59 music -> /myth/music
lrwxrwxrwx 1 root root 30 Jul 31 11:07 mysql.txt -> /home/mythtv/.mythtv/mysql.txt
lrwxrwxrwx 1 root root 8 Jun 14 21:59 recordings -> /myth/tv
-rwxrwxrwx 1 root root 3020 Jul 31 11:09 serverecording
-rwxrwxrwx 1 root root 943 Jan 27 2007 serverecording-orig
-rw-r--r-- 1 www-data www-data 6 Jul 31 11:55 transcode.pid
lrwxrwxrwx 1 root root 17 Jun 14 21:59 tv_icons -> /myth/image_cache
lrwxrwxrwx 1 root root 11 Jun 14 21:59 video -> /myth/video
lrwxrwxrwx 1 root root 18 Jun 14 21:59 video_covers -> /myth/video_covers
Copied over feed1.ffm to my main box and it played my video that I was trying to stream fine via mplayer. So I assume it is a permission problem.
_________________ ASUS A7N266 Micro-ATX Motherboard
Athlon 2200 processor
512K Kingston PC2100 Memory
MicroAtx Case
2 PVR250's w/remote
eVGA e-GeForce mx4000 (64 Ram with Tv/Out (Svideo))
Lite-on DVD cd-rw combo
120 GB Western Digital
|
|
Top |
|
 |
bigB
|
Posted: Tue Jul 31, 2007 5:04 pm |
|
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location:
Brisbane, Australia
|
Ok,
This is mine.
drwxr-xr-x 2 www-data www-data 8192 Jul 30 08:18 cache
-rw-r--r-- 1 www-data www-data 3710976 Jul 30 08:19 feed1.ffm
-rw-r--r-- 1 www-data www-data 10279 Jul 30 08:19 ffmpeg.log
-rw-r--r-- 1 www-data www-data 6 Jul 30 08:18 ffmpeg.pid
-rw-r--r-- 1 www-data www-data 1 Jul 18 22:16 ffmpeg1.log
-rw-r--r-- 1 www-data www-data 6 Dec 6 2006 ffserve.pid
-rw-r--r-- 1 www-data www-data 528 Jul 30 08:18 ffserver.conf
-rw-r--r-- 1 www-data www-data 6 Jul 30 08:18 ffserver.pid
-rw-r--r-- 1 root root 0 Nov 29 2006 log
lrwxrwxrwx 1 www-data www-data 12 Nov 28 2006 music -> /myth/music/
-rw-r--r-- 1 mythtv mythtv 965 Jul 18 20:59 mysql.txt
lrwxrwxrwx 1 www-data www-data 8 Nov 28 2006 recordings -> /myth/tv
-rwxr-xr-x 1 root root 3439 Jul 18 22:48 serverecording
lrwxrwxrwx 1 root root 12 Nov 28 2006 stream -> /myth/stream
-rw-r--r-- 1 www-data www-data 524 Jul 30 08:19 transcode.log
-rw-r--r-- 1 www-data www-data 6 Jul 30 08:18 transcode.pid
drwxr-xr-x 2 www-data www-data 4096 Nov 28 2006 tv_icons
lrwxrwxrwx 1 www-data www-data 11 Nov 28 2006 video -> /myth/video
lrwxrwxrwx 1 www-data www-data 19 Nov 28 2006 video_covers -> /myth/video/.covers
As you can see, most of the files should be owned by www-data.
I have also noticed that i have a copy of mysql.txt in /var/www/mythweb. A symbolic link to work here:
ln -s /home/mythtv/.mythtv/mysql.txt /var/www/mythweb/mysql.txt
Hope this helps
|
|
Top |
|
 |