FFmpeg streaming to Akamai like FMLE does

2.7k views Asked by At

I am trying to stream video from my webcam to AkamaiHD service using ffmpeg (like it is implemented in Flash Media Live Encoder)


    ffmpeg -f dshow -i video="Webcam C110" -s 640x360 -aspect 16:9 -profile:v baseline -    pix_fmt yuv420p -vcodec libx264 -f flv "rtmp://..."
...
   Input #0, dshow, from 'video=Webcam C110':
  Duration: N/A, start: 31296.194000, bitrate: N/A
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 30 tbr, 10000k tbn, 30 tbc
Output #0
  Metadata:
    encoder         : Lavf55.8.102
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 1k tbn, 30 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> libx264)
....

The video is sreamed, but when I try to view it at http://mediapm.edgesuite.net/edgeflash/public/zeri/debug/Main.html?url=myplayback_url/manifest.f4m it is not displayed.

I've found out that if the video is recorded using FMLE and restreamed to akamai, then HLS stream is played.


ffmpeg -re -i sample.f4v -c copy -f flv "rtmp://..."
....
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample.f4v':
  Metadata:
    major_brand     : f4v
    minor_version   : 0
    compatible_brands: isommp42m4v
    creation_time   : 2018-10-06 09:23:33
  Duration: 00:01:01.77, start: 0.460000, bitrate: 718 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 624 kb/s, 30 tbr, 1k tbn, 48 tbc
    Metadata:
      creation_time   : 2018-10-06 09:23:33
      handler_name    : MainConcept

Output #0
  Metadata:
    major_brand     : f4v
    minor_version   : 0
    compatible_brands: isommp42m4v
    encoder         : Lavf55.8.102
    Stream #0:0(eng): Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 624 kb/s, 1k tbn, 1k tbc
    Metadata:
      creation_time   : 2018-10-06 09:23:33
      handler_name    : MainConcept
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
....

It seems that the problem is with h.264 codec configuration, but I have found no solution yet.

Could you please advice, how can I implement streaming like FMLE using ffmpeg?

1

There are 1 answers

0
Andrew On

I think for Akamai you need authentication for the RTMP entrypoint which I don't believe is supported in the librtmp used by ffmpeg.

Have a look at this thread over at Wowza for more information.

If you think it is a codec issue then instead of copy the codec you could try encoding it using -c:v libx264 as the video codec and -c:a libfaac for audio