Skip to main content
Known Participant
July 23, 2012
Question

record to mp4

  • July 23, 2012
  • 2 replies
  • 3855 views

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?

This topic has been closed for replies.

2 replies

Adobe Employee
July 24, 2012

Sir,

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/WSd391de4d9c7bd609-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/WS36639d9e8574ac3f4741126212dea232fa8-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.

lsiunsuexAuthor
Known Participant
July 24, 2012

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?

Adobe Employee
July 24, 2012

"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.

Thanks

Known Participant
July 23, 2012

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)

{

          p_stream.record(false);

          trace("onUnpublish: record complete for ["+p_stream.name+"]");

  // do something 

}