FMS 4.5 up and running; using an app, records to flv just fine; playback is just fine as an flv also.
Now, we want to play the flv file on an iOS device as an mp4
I modified the app to save the file as an mp4 ("mp4:" + filename + ".mp4", record)
and it creates the mp4 file
I've found out the .mp4 file is not playable by itself in Quicktime.
Found on Adobe's website a linux application called f4vpp - ran that on the .mp4 file and now it plays fine in Quicktime - but this is obviously a manual process
Is there a way to automate this conversion process? Should I be doing something else? Do I need to convert the file with f4vpp before its playable on an iOS device?
The file needs to be an mp4 an iOS can play (not just the name ), so some sort of conversion would be needed (you mentioned f4vpp, that looks to do the job). We use transocders (ffmpeg is an open source product) to create multiple renditions of the flv video (for different bandwidths) as mp4. To notify our system a record has completed we hook into the onUnpublish event in the main.asc for the application. We were unable to get it to execute shell script (if someone has an example please let me know!) so it now writes a control file that is searched for, but Im told you can get FMS to call into webservices...
application.onUnpublish = function(p_c, p_stream)
trace("onUnpublish: record complete for ["+p_stream.name+"]");
// do something
I would like to know your use case here:
1. Do you want to stream your live stream on iOS? - If yes, refer http://help.adobe.com/en_US/flashmediaserver/devguide/WSd391de4d9c7bd6 09-52e437a812a3725dfa0-8000.html
2. Do you want to stream your VOD files (probably FMS/non-FMS created mp4) to iOS device through FMS? if yes, refer http://help.adobe.com/en_US/flashmediaserver/devguide/WS36639d9e8574ac 3f4741126212dea232fa8-8000.html
3. You want to offline play FMS created mp4 files on iOS device (not streaming them from FMS)? - if yes, then this you need to invoke the f4vpp on the mp4 file from the script that is copying your content to the iOS device. FMS creates mp4 as per standard of mp4, but unfortunetly most of the offline players don't understand fragmented mp4s.. so FMS ships offline tool to flatten the fragmented mp4.
hope it helps.
The FMS app records live from the webcam and microphone, creating an FLV file - which is fine on the website, but obviously not on an iOS device.
So I'm not looking to stream the mp4 in the traditional sense that FMS would do it over rtmp - I just need to convert the file (or create it as an mp4 in the first place) to an mp4, store it somewhere on the server I can access it via apache / http and allow the iOS device to access it over http
I've moved on to using ffmpeg to do the conversion. From the command prompt, ffmpeg can convert the FLV to MP4 just fine but when I try to do a exec, shell_exec or system from php to execute ffmpeg i'm getting an access denied on the /opt/adobe/fms/applications/record/streams/_definst_/ when php tries to access the FLV to run ffmpeg against it.
I will look at the docs you linked to do more information.
Any ideas on what I just posted above?
"I just need to convert the file (or create it as an mp4 in the first place) to an mp4, store it somewhere on the server I can access it via apache / http and allow the iOS device to access it over http"
So that should be straight forward.
You change app to record to mp4 as you mentioned above.
Place the mp4 file in webroot/vod
Make sure apache is installed and running. In case, you have installed apache that comes with FMS, it will have all necessary configs
Now play your file from iOS device or MAC quicktime using URL http://server-name(ip)/hls-vod/yourmp4filename.mp4.m3u8 .. That's it.
You don't need anything more than that.
Anyways your flv to mp4 conversion won't be feasible as
FLV only records non-H264 content
and iOS only support H264 content on Http live streaming.
FMS created mp4 won't be as such playable on QuickTime, however if you will use FMS to stream them over HTTP on iOS, it will play fine. Read more abut how to host content for HLS delivery on FMS in the article http://help.adobe.com/en_US/flashmediaserver/devguide/WS36639d9e8574ac 3f4741126212dea232fa8-8000.html
I guess another problem I'm having in regards to that is that I'm not using the Apache that comes with FMS - I need to use my own as this server runs its own version of Apache to serve up the rest of the website.
I'm starting to think I should just spin up another cloud instance at Rackspace and keep the 2 separate. FMS on 1 server and the website on another. Then, FMS can run its own Apache and I can run mine on another server to deal with the rest of the website.
Not a big deal, just a pain.
Ok, i've separated FMS into its own centos server on rackspace; all the ports that should be open are open and the Apache that comes with FMS works fine
it records to FLV and plays just fine - i change the code to record as a mp4 and the file is created just fine and appears to have content
when i point quicktime to http://ipaddress/hls-record/filename.mp4.m3u8 i get url not found
I'm not using the vod application - i'm using a custom application made to record from webcam - can i just tack on the hls- to the record url?
do i need to configure anything else to play back mp4's ?
There are two things
1. You can change hls-vod to hls-record. Just make sure that you change the location tag in httpd.conf also. You must have your content at the content path specified under hls-vod(record) tag.
So, after recording have you placed your content in webroot/vod. Or have changed the content path location under hls-vod location tag in the httpd.conf
2. You said you recorded flv from FMS. I am quite sure that in that case video codec will not be H264. Such FLV you can convert to mp4, but won't playable on iOS device though HTTP streaming.
Read Apple's spec here http://developer.apple.com/library/ios/#documentation/networkingintern et/conceptual/streamingmediaguide/FrequentlyAskedQuestions/FrequentlyA skedQuestions.html to know which codecs are supported by Apple.
I found the location in httpd.conf and have been playing with that
I don't care how the video is recorded - FLV, mp4, whatever.
I need to record from webcam on the website and stream back on the website and on iOS
so to record on the website, i need to use flash to grab the webcam
wether it saves to flv, mp4, i don't care. i need to in turn stream via the website and iOS
When i record as mp4 my filename does not end in .m3u8 - should it? or am i just appending .m3u8 onto the filename when i stream via iOS
I copied the sample f4v file from the wwwroot/vod folder to my record folder and made the location changes to apache and got that to stream over http as .f4v.m3u8 just fine so that fixes that
still trying to figure out how to alter this application to record the f4v to the server
everything i read says Flash 11 and FMS can record from webcam to FMS 4.5 as a F4V file. is this true?
Though I am not sure which app you are using, but you will have to understand that for a stream to be recorded as f4v, you must have stream with the name f4v:streamname
So if you are getting stream "live" in onPublish
var s = Stream.get("f4v:abc");
Code above may have syntax issues, but it gives the idea how to record a f4v file. Or if you are publishing from client with record option, then make sure your stream name has "f4v:" in the start.
if it helps anyone in the future, this is what i settled on today
FMS on its own server
location entry in the apache config to access FLV files in /opt/adobe/fms/applications/record/streams...
installed php and ffmpeg on this server
php script checks mysql database for a new video with a process trigger of 1 (new video, recorded as flv, needing conversion to mp4)
php script sits in the record/streams/ folder - cron job calls php script every x minutes - script finds trigger of 1 - runs ffmpeg to convert the file to mp4 and copy it into webroot/mp4 - sets process trigger to 0 so it doesn't repeatedly get converted
as FMS is now on its own server and its version of apache is working fine and can serve files, pointing an iOS device at the server /mp4 folder produces the recorded file, converted and playable on iOS.
this solution is best in my opinion as mp4 may be fine for iOS but may not be fine for Android (for whenever i decide to tackle those devices) - ffmpeg can be run as many times as nessecary to produce as many versions of the file as needed.
this way also, puts no more load on the FMS server to read the mp4 for iOS devices than just reading in a larger file over http which works well (conversion happens once and processing happens on the device to play the video)
hope it helps someone.
Europe, Middle East and Africa