Wowza Community

How to record using mp4

I see that 1.7 now allows for recording of webcams using .mp4 but how do you do it? Is there documentation somewhere?

Thanks!

CP

Are you trying to record webcam data that is being published by the Flash player using the Camera and Microphone objects? If so then this type of video/audio (Sorenson Spark, Nelly Moser ASAO and Speex) cannot be recorded in an MP4 container.

Charlie

Take a look at this article:

https://www.wowza.com/docs/how-to-encode-video-on-demand-content

Charlie

No, Wowza doesn’t do that.

Richard

You can probably record mp4 content from the webcam, but not with the encoder built-in to Flash plugin. Use Wirecast or Quicktime Broadcaster, or most of the encoding solutions on the Live Encoder forum will send h.264 to Wowza which you can record to mp4 container.

http://www.wowza.com/forums/forumdisplay.php?f=24

Richard

Try either of the first two in this post:

http://www.wowza.com/community/t/-/516#10

Richard

I don’t have any suggestions, just the other examples earlier in this thread:

http://www.wowza.com/community/t/-/516#10

But higher bitrates for IPhone delivery might be wasted on the small screen.

Richard

Updated ffmpeg commands. Changed " -g 90" to " -r 24 -g 48", so that keyframe frequency is 2 seconds for Silverlight and iOS MediaValidator compatibility.

Richard

We are using ffmpeg to convert webcam recordings to H.264/AAC quicktime files. The set of available options in ffmpeg is pretty massive, so I’d send you to the ffmpeg website in order to figure out a full set of transcoding parameters. We have it grab a snapshot png every few seconds, too, which it can do while it is transcoding.

are there any options to covert it to mpeg4 serverside? Wowza is on a windows box.

Do you know of other software that can? We are using a webcam to record using wowza but are missing out on every device that does not support flash. Do you know of any software that windows can (run command line, or service) to convert the .flv to .mp4 server side?

Great! Thanks for the information. Do you have flash trigger the ffmpeg app once the flv file is done recording?

I ended up going with using handbrakeCGI to do my post flash .h264 conversion and it works great. I am able to record the video full quality and then use handbrake to create the size that I want here is the code that I use.

[PHP]

<?php //convert default .flv file to .mp4 // Set our source file $srcFile = "/Users/*/Desktop/html5tester/default5-30-2010-15-39-24.flv"; $destFile = "/Users/*/Desktop/html5tester/default5-30-2010-15-39-24.mp4"; $handbrakePath = "/Users/*/Desktop/html5tester/HandBrakeCLI"; // Call our convert using exec() exec($handbrakePath . " -i " . $srcFile . " --preset='iPhone & iPod Touch' -o" . $destFile, $results); //print_r($results); if($results != NULL){ echo "Everything appears to have worked. The video " . $srcFile . " was trascribed into " . $destFile; unlink($srcFile); } else{ echo "There was a problem. The video " . $srcFile . " was not trascribed into " . $destFile; } //this will delete the original file after the conversion is done. Use with care... //unlink($srcFile); ?>

[/PHP]

I hope that this helps someone!:smiley:

I also had to modify the code to work on a pc. The above code works great on a mac.

The below code requires that you create a string for the execution code to follow.

[PHP]

<?php

//convert default .flv file to .mp4

// Set our source file

$srcFile = "c:\\wamp\\\handbrake\\vptest.flv";

$destFile = "c:\\wamp\\handbrake\\vptest-ipod.mp4";

$handbrakePath = "c:\\wamp\\handbrake\\HandBrakeCLI.exe";

// Call our convert using exec()

//establish a variable to contain the code to execute.

$codetoexecute = $handbrakePath . " -i " . $srcFile . ' --preset="iPhone & iPod Touch" -o ' . $destFile;

exec($codetoexecute, $results);

if($results != NULL){

//echo $codetoexecute . " was executed...\n";

$stringData = $codetoexecute . " was executed...\n";

}

else {

//echo "Encoding Failed... See apache logs...\n";

$stringData = "Encoding Failed... See apache logs...\n";

}

print_r($results);

?>

[/PHP]

Guys please help me.

I need to transcode a file through ffmpeg so it can be played on both PC and Iphone. I know that if it is playable on iphone then it can be played on pc for sure.

So, what is the exact ffmpeg profile to encode files so it can be played on the iphone?

please let me know soon.

thanks

I run apache on the same server as the wowza server and post record I use the handbrakeCGI instead of ffmpegg and it works flawlessly. The php code that I included above works great.

ffmpeg -i big_buck_bunny_1080p_stereo.avi -s 212x120 -y -strict experimental -acodec aac -ab 96k -ac 2 -ar 48000 -vcodec libx264 -vpre default -vpre ipod320 -g 90 -b 85000 -level 30 -threads 64 BigBuckBunny_175k.mov

I used this command to encode various samples for iphone. The bitrates 64, 128k, and 256k play well using cupertino streaming. We want to offer 512k for users on wifi and/or fast enough cellular networks but the playback starts to lag and skip. If we play the same file using direct http:// it plays perfectly. I tried using different frame rates and adjusted the “chunkDurationTarget” in HTTPStreamers.xml. Any suggestions?

Guys please help me.

I need to transcode a file through ffmpeg so it can be played on both PC and Iphone. I know that if it is playable on iphone then it can be played on pc for sure.

So, what is the exact ffmpeg profile to encode files so it can be played on the iphone?

please let me know soon.

thanks

@ideasculptor

&

@corriepotter

I’m trying to get ffmpeg to transcode my flash-webcam-records, too. but out of the several encode-options I’ve found and tried, not a single one worked out for me. whenever the conversion itself was “working” then there was no sound in the resulting mp4-files and they didn’t play on the iPhone, only in Safari.

I already noticed that aac-support in ffmpeg kinda sucks and added -strict experimental to get it to “work” (as described), but I don’t come any further from here.

Would you be so kind and give me a hint on which combination of options works for you? Which versions of ffmpeg and x264 do you use?

I’d be extremely thankful for any help*or suggestions!

charlie, at first: thx a lot! though that’s kind of saddening to hear because MS Expression encoder won’t make it onto a Debian machine, right? in the end I’d need multi-bitrate delivery as well but for now I’d be please to have it working with a single conversion.

Your commands helped me very much! They are working fine - as far as one can get with ffmpeg as it seems. The converted files have sound now, but it isn’t in sync with the video. Now that’s a more common problem I already stumbled across in many previous posts and I have a feeling I can find a solution from here.

If you have any idea about this problem, I’d be hungry to hear, of course. But I definitely got your point and will stress the ffmpeg-forums from here. I’ll post my solution here, nevertheless, as soon as I can find one.

Thanks again and cheers from Germany.

I’ve changed the options to

-acodec libfaac 

and added

-async 1

And: IT WORKS NOW! Sound in sync and it’s playing back on the iPhone. I’ve tested sooo many option-strings before and yours finally worked for me. Thanks so much, charlie!