Adobe Media Server 5 : Error when requesting hls-live stream
1. We used flash program to publish our live stream. The actionscript code is like the following (it's better to focus to the publishStream method) :
private function setCamAndMicConfig():void
{
...
...
// --- Cam settings : where Confs is our own configuration parameters collection
_camera.setQuality(Confs.CAM_BANDWIDTH, Confs.CAM_MIN_QUALITY);
_camera.setMode(Confs.CAM_RES_W, Confs.CAM_RES_H, Confs.CAM_FPS, true);
_camera.setKeyFrameInterval( Confs.CAM_KEY_FRAME_INTERVAL );
_camera.addEventListener( StatusEvent.STATUS, cameraStatusHandler );
// --- Mic settings
_mic = Microphone.getEnhancedMicrophone();
_mic.encodeQuality = Confs.MIC_QUALITY; //10
_mic.rate = 22;
_mic.gain = 50;
_mic.setSilenceLevel( Confs.MIC_SILENCE_LVL );//default Netapsys
_mic.setUseEchoSuppression( Confs.MIC_ECHO_SPRSS );
...
...
}
public function publishStream( name:String ):void
{
...
...
_stream = new NetStream( _connection );
_stream.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
_stream.client = this;
_stream.useHardwareDecoder = true;
if (_camera != null)
{
_camera.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
_stream.attachCamera(_camera);
var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings();
h264Settings.setProfileLevel( H264Profile.MAIN, H264Level.LEVEL_3_1 );//bon paramètres
_stream.videoStreamSettings = h264Settings;
}
if (_mic != null)
{
_mic.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
_stream.attachAudio(_mic);
}
if (_camera != null || _mic != null)
{
metaData.copyright = "My Company, 2015";
metaData.codec = _stream.videoStreamSettings.codec;
metaData.profile = h264Settings.profile;
metaData.level = h264Settings.level;
metaData.fps = _camera.fps;
metaData.bandwith = _camera.bandwidth;
metaData.height = _camera.height;
metaData.width = _camera.width;
metaData.keyFrameInterval = _camera.keyFrameInterval;
_stream.publish(name + '?adbe-live-event=ourownliveevent', 'live'); // bon paramètres
} else {
trace('Please check your camera and microphone');
}
...
...
}
After publishing the stream, we have in the logs/_defaultVHost_/livepkgr/_definst_/application.00.log
...
...
2015-06-18 17:04:33 14048 (s)2641173 onPublish : teststream -
2015-06-18 17:04:33 14048 (s)2641173 Stream name is: teststream and live event is: ourownliveevent -
2015-06-18 17:04:33 14048 (i)2611173 Event level recording configuration: General[flags: 3, keyframe interval: 60000, max size: -1, max length: -1, io buffer size: 0], Fragment[frag duration: 4000, seg duration: 400000, duration precision: 0, allowed drift: 1000, frame rate: 0,000000, frames per interval: 0, intervals per frag: 1, frame precision: 1, disk management duration: 3,000000], ContentProtection[enabled=false(overridable)] -
2015-06-18 17:04:33 14048 (s)2641173 f4f:teststream - NetStream.Data.Start -
2015-06-18 17:04:33 14048 (s)2641173 f4f:teststream - NetStream.Publish.Start -
2015-06-18 17:04:33 14048 (s)2641173 f4f:teststream - NetStream.Play.Reset -
2015-06-18 17:04:33 14048 (s)2641173 f4f:teststream - NetStream.Record.Start -
...
...
Then, we requested the HLS-LIVE stream by : http://<ourserver_address>/hls-live/livepkgr/_definst_/ourownlivevent/teststream.m3u8
Inside de apache error_log, we have the following entries :
...
...
[Thu Jun 18 17:05:31 2015] [debug] requesthandler.cpp(243): Reading application wide configs.
[Thu Jun 18 17:05:31 2015] [debug] requesthandler.cpp(243): Using event specific configs.
[Thu Jun 18 17:05:31 2015] [debug] requesthandler.cpp(243): generating prog index for event:livepkgr/events/_definst_/ourownliveevent stream name:teststream
[Thu Jun 18 17:05:31 2015] [debug] requesthandler.cpp(243): generating m3u8 for start time:3672814, max end time:3720814
[Thu Jun 18 17:05:31 2015] [debug] requesthandler.cpp(243): playlist entries generated till time:3720000
[Thu Jun 18 17:05:31 2015] [debug] requesthandler.cpp(243): Reading application wide configs.
[Thu Jun 18 17:05:31 2015] [debug] requesthandler.cpp(243): Using event specific configs.
[Thu Jun 18 17:05:31 2015] [debug] requesthandler.cpp(243): h264 info arrived
[Thu Jun 18 17:05:31 2015] [error] mod_hlshttp [500]: Packaging error 1 (The media contains unsupported audio codec) when processing /hls-live/streams/livepkgr/events/_definst_/ourownliveevent/teststreamNum461.ts
...
...
Actually, the stream is unreadable.
If in the publisher we either deactivated or commented the block which attaches the microphone
...
_stream.attachAudio(_mic);
...
We wouldn't have this error with apache, and mobile devices would be able to read and play the stream.
Any help will be welcome !!!
Mamisoa.
