Skip navigation
lsiunsuex
Currently Being Moderated

record to mp4

Jul 23, 2012 8:43 AM

Tags: #ios #fms_4.5.1

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?

 
Replies
  • Currently Being Moderated
    Jul 23, 2012 9:02 AM   in reply to lsiunsuex

    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 

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2012 12:35 AM   in reply to lsiunsuex

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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2012 4:11 AM   in reply to lsiunsuex

    "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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2012 4:14 AM   in reply to Nitin Goel

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2012 8:00 AM   in reply to lsiunsuex

    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.

     

    Thanks

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2012 10:13 PM   in reply to lsiunsuex

    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

     

    onPublish(clientId, stream)

    {

    var s = Stream.get("f4v:abc");

    s.record();

    s.play(stream.name);

    }

     

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points