Wowza Community

Record multiple videos from a live web cam stream

Hi,

I have to record a web cam stream (done from Flash). I know this can be done using the module provided to record the stream. But my requirement is to record multiple videos from this stream, which will start and stop at different times. I have also used LiveStreamRecord module some time ago, can I use that module ?

Thanks,

Gaurav

Yes, that will work for that.

Richard

hello

i’m doing the same thing and video merging is of course not working if you want to record a “full duplex” chat. only halfduplex would work. you need to provide a player that will play both videos (video syncing works with html5 also by the way http://html5demos.com/two-videos). i’m using this option when recording 2 ways half duplex session and then append recording or merge with ffmpeg

one solution even if its not the best but that would allow you to do what you want is to record the screen thought any screencapture app (there are some librairies in java to do this -> http://www.smaxe.com/juvclient.jsf, unfortunately the one i know is using screenvideo 1 codec, and you cannot do much with the resulting file, even flash media encorder. i havent tryed with wowza 3 thought, but with wowza2 it was impossible to do something else than playing the recorded screen streams).

and then you record the audio in a separate stream that will be played synced with the video that will show the selected part of screen during recording. this option is quite heavy for bandwidth and can be tricky to set up but it works

i have a different problem with multiple sources recording: i need to record several streams during a full duplex session. but all streams wont start and end at the same time. is there a way to store the start time in metadata or else and then use these datas to sync the video when playing back ? or should the start time be stored in a db when user gets live and start publishing/recording ?

thank you for your help

just a thought: time function from within flash client will return client time, so the metadata should be injected server side, right ?

i have a weird issue with recording. With wowza 3.0.2 b866: recording works fine when using my dev server locally, but on my production server, it creates a 1Ko flv file and that’s it. i don’t have error messages, here is a log snippet:

2011-12-22 01:47:03 CET connect-pending session INFO 100 122.155.37.11 - defaultVHost videorecording 1412 0.601 [any] 1935 rtmp://myserver.net:1935/videorecording/1412 122.155.37.11 rtmp http://www.mysite.com/visiohtml5/visio_HTML5.swf?pseudo=&adherent_id=&sponsor_id=1&roomID=1412&isAdmin=&audioMess=2&roomName=mysite WIN 11,1,102,55 1070943807 3541 3073 - - - - - - - - - - - - -rtmp://myserver.net:1935/videorecording/1412 -

2011-12-22 01:47:03 CET connect session INFO 200 122.155.37.11 - defaultVHost videorecording 1412 0.602 [any] 1935 rtmp://myserver.net:1935/videorecording/1412 122.155.37.11 rtmp http://www.mysite.com/visiohtml5/visio_HTML5.swf?pseudo=&adherent_id=&sponsor_id=1&roomID=1412&isAdmin=&audioMess=2&roomName=mysite WIN 11,1,102,55 1070943807 3541 3073 - - - - - - - - - - - - - rtmp://myserver.net:1935/videorecording/1412 -

2011-12-22 01:47:03 CET create stream INFO 200 - - defaultVHost videorecording 1412 0.001 [any] 1935 rtmp://myserver.net:1935/videorecording/1412 122.155.37.11 rtmp http://www.mysite.com/visiohtml5/visio_HTML5.swf?pseudo=&adherent_id=&sponsor_id=1&roomID=1412&isAdmin=&audioMess=2&roomName=mysite WIN 11,1,102,55 1070943807 3613 3413 1 - 0 0 - - - - 0 0.0 rtmp://myserver.net:1935/videorecording/1412 rtmp://myserver.net:1935/videorecording/1412 - rtmp://myserver.net:1935/videorecording/1412 -

2011-12-22 01:47:03 CET publish stream INFO 200 1070943807 - defaultVHost videorecording 1412 0.462 [any] 1935 rtmp://myserver.net:1935/videorecording/1412 122.155.37.11 rtmp http://www.mysite.com/visiohtml5/visio_HTML5.swf?pseudo=&adherent_id=&sponsor_id=1&roomID=1412&isAdmin=&audioMess=2&roomName=mysite WIN 11,1,102,55 1070943807 3730 3455 1 - 53 0 1070943807 - - - 0 0.0 rtmp://myserver.net:1935/videorecording/1412/1070943807 rtmp://myserver.net:1935/videorecording/1412/1070943807 - rtmp://myserver.net:1935/videorecording/1412 -

2011-12-22 01:47:04 CET comment server INFO 200 - ModuleStreamRecord.startRecording: stream:1070943807 format:flv append:true outputPath:/usr/local/apache/sites/mysite.com/htdocs/recordings/1/1066/1070943807.flv versionFile:true startOnKeyFrame:false recordData:true - - - 1653.077 - – - - - - - - - - - - - - - - - - - - - - - -

any clue ?

thanks !

Hi Richard and thanks for your reply

i had the same result with no path…i traced my netstream client side, and the buffer appears to be empty, thing which is not happening when testing locally. I believe the problem comes from here, but why would this buffer stay empty ?

thanks

i changed my mic/cam reference in my app and now the recording is ok in the default path, but still 1Ko file in a custom dir.

its quite weird, if i define a custom folder in the application.xml file, recordings are ok. default location, recording ok. custom location “on the fly” from flash client produces 1K files. i thought it was a permission matter and then changed to 777, same result, i believe this is a wowza issue, if somebody can confim

thank you

yes i confirm its working, but there is still a weird behavior: i’m creating folders on the fly thought php ftp functions before starting the recording. i’m sure that folders are created when recording start. these folders have got the same permissions, user/group that default folders for which i’m sure its working. the recorded files belongs to the same user (root). and still only 1k file in the “on the fly” folders". i think its strange as if it would be a permission matter, there would not even have this 1k file (when i performed tests with permission 755 folders, i had error message in wowza logs. i dont have these errors since i changed the way to create the folders, but it’s stil not working. if somebody has an idea or encoutered the same problem please let me know

thank !

Hi Randall thanks for your reply

same result: i created the folders, then restarted wowza then started the recording, and still this 1K file…super weird :smiley:

i downloaded the 1k flv and saved it to txt, here is the file content:

FLV   	      O        
onMetaData     duration          creationdate dim. déc. 25 11:24:10  	   Z

And Merry Christmas to you and All Wowza Team by the way

sure

so first what is working: i have a folder, lets say /usr/local/temp created thought my ftp client with permissions 777.

if i define this folder in the application.xml recording is ok. If i define this folder on the fly when recording from the swf client, it works too

now, the way i need it to work:

first my user sets his recording settings (name, blabla). this is saved to a db when user validate, and at the same time i create a new folder like this:

$dir1 = “mysite.com/htdocs/recordings/”.$adherent_id;

$dir2 = “mysite.com/htdocs/recordings/".$adherent_id."/”.$recordSessID; //this is the ID of the insert in the db. i want to save flv files in this folder so its not a mess on the server. Each session will have its own folder containing related flv’s

$ftpuser=“userftp”;

$ftppwd=“ftppassword”;

$ftpc = ftp_connect(“localhost”,21);

$cool = ftp_login($ftpc, $ftpuser, $ftppwd);

ftp_pasv($ftpc, true);

//i create userID folder if not exists

@ftp_mkdir($ftpc, $dir1);

//i created sessionID folder and sets permisions 777

ftp_mkdir($ftpc, $dir2);

ftp_chmod($ftpc, 0777, $dir2);

ftp_close($ftpc);

then the swf client gets back the session ID, and i defined the save path like this:

recordOptions.outputPath = “/mysite.com/htdocs/recordings/”+_adherentID+"/"+_recordingID+"/"+_recordID+".flv";

then i start recording. no errors in wowza logs:

2011-12-25 11:24:08 CET create stream INFO 200 - - defaultVHost videorecording 1412 0.015 [any] 1935 rtmp://myserverIP:1935/videorecording/1412 122.155.37.45 rtmp http://www.mysite.com/visiohtml5/visio_HTML5.swf?pseudo=&adherent_id=&sponsor_id=1&roomID=1412&isAdmin=&audioMess=2&roomName=mysite WIN 11,1,102,55 886594029 3595 3413 1 - 0 0 - - - - 0 0.0 rtmp://myserverIP:1935/videorecording/1412 rtmp://myserverIP:1935/videorecording/1412 - rtmp://myserverIP:1935/videorecording/1412 -

2011-12-25 11:24:09 CET publish stream INFO 200 886594029 - defaultVHost videorecording 1412 0.518 [any] 1935 rtmp://myserverIP:1935/videorecording/1412 122.155.37.45 rtmp http://www.mysite.com/visiohtml5/visio_HTML5.swf?pseudo=&adherent_id=&sponsor_id=1&roomID=1412&isAdmin=&audioMess=2&roomName=mysite WIN 11,1,102,55 886594029 3703 3455 1 - 56 0 886594029 - - - 0 0.0 rtmp://myserverIP:1935/videorecording/1412/886594029 rtmp://myserverIP:1935/videorecording/1412/886594029 - rtmp://myserverIP:1935/videorecording/1412 -

2011-12-25 11:24:10 CET comment server INFO 200 - ModuleStreamRecord.startRecording: stream:886594029 format:flv append:true outputPath:/usr/local/apache/sites/mysite.com/htdocs/recordings/1/1139/886594029.flv versionFile:true startOnKeyFrame:true recordData:true - - - 14.98 - - – - - - - - - - - - - - - - - - - - - - - -

when stopping recording:

2011-12-25 11:24:33 CET unpublish stream INFO 200 886594029 - defaultVHost videorecording 1412 24.4 [any] 1935 rtmp://myserverIP:1935/videorecording/1412 122.155.37.45 rtmp http://www.mysite.com/visiohtml5/visio_HTML5.swf?pseudo=&adherent_id=&sponsor_id=1&roomID=1412&isAdmin=&audioMess=2&roomName=mysite WIN 11,1,102,55 886594029 293749 3614 1 - 288749 0 886594029 - - - 0 0.0 rtmp://myserverIP:1935/videorecording/1412/886594029 rtmp://myserverIP:1935/videorecording/1412/886594029 - rtmp://myserverIP:1935/videorecording/1412 -

2011-12-25 11:24:33 CET destroy stream INFO 200 886594029 - defaultVHost videorecording 1412 24.401 [any] 1935 rtmp://myserverIP:1935/videorecording/1412 122.155.37.45 rtmp http://www.mysite.com/visiohtml5/visio_HTML5.swf?pseudo=&adherent_id=&sponsor_id=1&roomID=1412&isAdmin=&audioMess=2&roomName=mysite WIN 11,1,102,55 886594029 293749 3614 1 - 288749 0 886594029 - - - 0 0.0 rtmp://myserverIP:1935/videorecording/1412/886594029 rtmp://myserverIP:1935/videorecording/1412/886594029 - rtmp://myserverIP:1935/videorecording/1412 -

2011-12-25 11:24:33 CET disconnect session INFO 200 886594029 - defaultVHost videorecording 1412 25.728 [any] 1935 rtmp://myserverIP:1935/videorecording/1412 122.155.37.45 rtmp http://www.mysite.com/visiohtml5/visio_HTML5.swf?pseudo=&adherent_id=&sponsor_id=1&roomID=1412&isAdmin=&audioMess=2&roomName=mysite WIN 11,1,102,55 886594029 293749 3614 - - - - - - - - - - - - -rtmp://myserverIP:1935/videorecording/1412 -

2011-12-25 11:25:33 CET app-stop application INFO 200 1412 videorecording/1412 - - - 98.101 - - - – - - - - - - - - - - - - - - - - - - - -

2011-12-25 11:25:33 CET comment server INFO 200 - ModuleStreamRecord.onAppStop - - - 98.102 - - - - – - - - - - - - - - - - - - - - - - - -

2011-12-25 11:25:33 CET comment server INFO 200 - stopRecording: 886594029 - - - 98.119 - - - - – - - - - - - - - - - - - - - - - - - -

if i create the folders with php the same way but with 755 permissions, or if the folder doesnt exists, i have errors in wowzalogs

i confirm that manually created and on the fly folders have same permissions (777), belongs to same user/group, and are created with the same ftp user.

i am recording regular audio/video feed captured from flashplayer

thanks for your help

hi

i performed some more tests. if i define the recording path in the application.xml, it works even with folders created from php with 755 permissions. if i set the same path but in the swf, it’s not working

i mean:

this path /usr/local/apache/sites/mysite/htdocs/recordings/1/1040

works if i define it in the application.xml

won’t work if i define it on the fly in the swf

i dont have errors in the logs

so far it doesn’t seem to be a permission matter

i commented the destination path in application.xml and leave only the path set in the swf, same result, 1k file…

Hi randall

thank you, i try this asap and i’ll let you know

back again

same result with the example, it creates a 1k file…and if i leave default path, recording is ok…its madness :smiley:

i’m using Wowza Media Server 3 Monthly Edition 3.0.2 build866. i’m updating now, i’ll let you know asap

Thank you !

Gabriel

updated to Wowza Media Server 3 Monthly Edition 3.0.3.10 build995, same result :frowning:

i just made a complete re-install, and had the same result…i’m running ubuntu 11.10

yes i think i’m using standard example, with the module class version

whay i’m doing step by step

1: create the destination folder

2: retrieve destination infos (adherentID, recordingID);

3: start recording:

var recordOptions2:Object = new Object();

recordOptions2.format = “flv”;

recordOptions2.append = true;

recordOptions2.versionFile = true;

recordOptions2.startOnKeyFrame = true;

recordOptions2.outputPath = “/usr/local/apache/sites/mysite.com/htdocs/recordings/”+_adherentID+"/"+_recordingID+"/"+_recordID+".flv";

_netCon.call(“startRecording”, null, _recordID, recordOptions2);

hope this helps

thank you

hi richard thanks for your reply

i tryed this already, if i hard code the path in the application.xml its working, even in my on the fly folders. this is not a permission matters i’m 100% sure (anyway a permission matter would not allow even a 1K file).

also if it can helps, remember that i opened this 1k file as a txt file, and the content was made of the datas defined in the code. so it seems that only the data stream is written to disk, not video/audio datas. and i can confirm that hard coded path will save both. maybe it can help to narrow the cause.