KCW + Webcam + Wowza media server not working

3 replies [Last post]
Joined: 12/15/2009
Points: 27

I am able to record on the webcam -- it shows the video preview, I even can back the recorded clip. I click through next to finish. The file shows up but it is 0 kb in size what gives???

Is it a permissions issue?
thanks

Joined: 12/15/2009
Points: 27

I see the following files in my /content/webcam directory:
460974 -rw-r--r-- 1 www-data www-data 0 Dec 17 09:00 00BB4D43-4725-A4B7-D6F0-9BDDAC8269BD_fixed.flv
460981 -rw-r--r-- 1 www-data www-data 0 Dec 17 10:07 039C63CC-DE73-2071-B90A-9C1B71CAFD44_fixed.flv
460993 -rw-r--r-- 1 www-data www-data 0 Dec 17 17:58 0891D886-279E-9BA4-BCF0-9DCA0866F9F8_fixed.flv
460994 -rw-r--r-- 1 www-data www-data 0 Dec 17 18:23 2698F0B3-2DFA-C1C0-163E-9DE10432C8CB_fixed.flv
460977 -rw-r--r-- 1 www-data www-data 0 Dec 17 09:45 48C5938A-FE92-47FA-BC16-9C067B06581A_fixed.flv
460995 -rw-r--r-- 1 www-data www-data 0 Dec 17 20:31 49C929D2-F80A-041E-13AC-9E56B81037CD_fixed.flv
460978 -rw-r--r-- 1 www-data www-data 0 Dec 17 09:47 5B1E71E3-69AE-604F-0692-9C08EF5FA63D_fixed.flv
460975 -rw-r--r-- 1 www-data www-data 0 Dec 17 09:20 5E13679D-D434-022B-D7DE-9BF053C4D6A6_fixed.flv
460988 -rw-r--r-- 1 www-data www-data 0 Dec 17 10:13 6968A611-8561-94A7-E5B8-9C20592481FD_fixed.flv
460976 -rw-r--r-- 1 www-data www-data 0 Dec 17 09:30 698F6203-8F16-362D-2F1D-9BF8D8F91EC4_fixed.flv
460968 -rw-r--r-- 1 www-data www-data 0 Dec 17 08:51 77407B1B-C269-662C-88F3-9BD5487FAD0D_fixed.flv
460967 -rw-r--r-- 1 www-data www-data 0 Dec 17 08:46 D646DCC8-0B75-2F01-17D9-9BD05201E052_fixed.flv
460996 -rw-r--r-- 1 www-data www-data 0 Dec 17 20:39 F7AC08AD-5178-1D58-CA68-9E5D98386CCC_fixed.flv

But all of these are 0 kb what gives?????

Joined: 12/15/2009
Points: 27

Wow... what a huge hassle.
Personally I think the symlink method is just too error prone -- I tried the SymLink in multiple ways and it just DID not work!!! I had no idea why I was getting these 0 kb files...

well I found the problem it had something to do with it not accessing the files properly (don't know why this would happen since I had the symlink in)

I ended up changing the php file by adding a $inputPath that points to my red5 server. My suggestion is to please just make this a configuration variable you can set somewhere in xml ... this is just so much easier than symlinking and less confusing / error prone.
File:
/var/www/kalturaCE/kaltura/alpha/apps/kaltura/lib/myInsertHelper.class.php

else if ($media_source == entry::ENTRY_MEDIA_SOURCE_WEBCAM)
                {
                        // set $entry_fileName to webcam output file and flag that conversion is not needed
                        $webcam_basePath = $content.'/content/webcam/'.($webcam_suffix ? $webcam_suffix : 'my_recorded_stream_'.$kuser_id);
                       
                        $entry_fullPath = $webcam_basePath.'.flv';
                        $inputPath =  "/usr/share/red5/dist/webapps/oflaDemo/streams/".($webcam_suffix ? $webcam_suffix : 'my_recorded_stream_'.$kuser_id);
                        $inputPath.='.flv';
                       
                        //echo "myInsertEtryHelper:: [$entry_fullPath]";
                       
                        // for webcams that might have problmes with the metada - run the clipping even if $entry_from_time and $entry_to_time are null

                        if ( $entry_to_time == 0 ) $entry_to_time = null; // this will cause the clipper to reach the end of the file
                       
                        // clip the webcam to some new file
                        $duration = myFlvStaticHandler::getLastTimestamp($inputPath);
                        $entry_fixedFullPath = $webcam_basePath.'_fixed3.flv';
                        myFlvStaticHandler::fixRed5WebcamFlv($inputPath, $entry_fixedFullPath);
                       
                        $entry_newFullPath = $webcam_basePath.'_clipped.flv';
                        myFlvStaticHandler::clipToNewFile( $entry_fixedFullPath, $entry_newFullPath, $entry_from_time, $entry_to_time );
                        $entry_fullPath = $entry_newFullPath ;
                       
                }

Joined: 11/05/2009
Points: 249

Foobar you are the man. This fix is legit. Anyone having issues with the dubious webcam symlink structure needs to check this post out quick.