Skip to main content
Participant
July 17, 2013
Question

Recording/Streaming h264 in AMS 5.01 tries to save flv

  • July 17, 2013
  • 1 reply
  • 1236 views

I'm trying to record a live stream to the livepkgr application using the following code:

var cam:Camera;

var mic:Microphone;

var video:Video;

var nc:NetConnection;

var ns:NetStream;

var h264Settings:H264VideoStreamSettings;

cam = Camera.getCamera();

mic = Microphone.getMicrophone();

cam.setMode(320, 240, 30, true);

cam.setQuality(90000,90);

cam.setMotionLevel(100,200);

cam.setKeyFrameInterval(keyframe);

mic.setLoopBack(false);

mic.rate = 44;

video = new Video(vidWidth,vidHeight);

video.attachCamera(cam);

nc=new NetConnection();

nc.addEventListener(NetStatusEvent.NET_STATUS, netStatus);

nc.connect("rtmp://localhost/livepkgr");

function netStatus(event:NetStatusEvent):void

{

          var info:Object = event.info;

          if (info.code == "NetConnection.Connect.Success")

          {

                    ns = new NetStream(nc);

                    ns.attachAudio(mic);

                    ns.attachCamera(cam);

                              h264Settings = new H264VideoStreamSettings();

                              h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_3_1);

                              h264Settings.setMode(320,240,30);

                              h264Settings.setQuality(90000, 90);

                              ns.videoStreamSettings = h264Settings;

                              ns.publish('mystream1','record');

 

                              var metaData:Object = new Object();

                              metaData.codec = ns.videoStreamSettings.codec;

                              metaData.profile =  h264Settings.profile;

                              metaData.level = h264Settings.level;

                              metaData.fps = cam.fps;

                              metaData.height = cam.height;

                              metaData.width = cam.width;

                              metaData.keyFrameInterval = cam.keyFrameInterval;

 

                              ns.send("@setDataFrame", "onMetaData", metaData);

          }

}

I get this error in the server core.00.log

[root logs]# tail -n1000 -f core.00.log

#Version: 1.0

#Start-Date: 2013-07-17 00:18:51

#Software: Adobe Media Server 5.0.1 r1076 x64

2013-07-17          00:19:41          6724          (w)2581173          /opt/adobe/ams/applications/livepkgr/events/_definst_/mystream1/Event.xml does not exist or is invalid.          -

2013-07-17          00:19:43          6724          (w)2611179          Warning from libf4f.so: [Utils] [mystream1] Discarded all Media Messages till first Video Key Frame. Total duration of discarded Messages - 0 ms

.          -

2013-07-17          00:19:47          6724          (w)2611179          Warning from libflv.so: Recording H264 to FLV is unsupported, tried in FLV : /opt/adobe/ams/applications/livepkgr/streams/_definst_/mystream1.flv.          -

If I try to publish like this:

ns.publish('mp4:mystream1.f4v','record');

then I get this error in my flash player:

NetStream.Record.NoAccess

and the following in the server core.00.log

2013-07-1700:25:196724(w)2581173/opt/adobe/ams/applications/livepkgr/events/_definst_/mystream1.f4v/Event.xml does not exist or is invalid.-
2013-07-1700:25:256724(e)2611082Failed to record mystream1.f4v.-

Can anyone help in this regards?

This topic has been closed for replies.

1 reply

Inspiring
October 15, 2015

Hello,

I have the same problem. If I try to add H264 settings to my netStream, it does not goes, but If don't, the record is correct.

Have you solved it? Could someone help me?

Best regards