[FFmpeg-trac] #6522(avformat:new): Hardcoded publish type of rtmp publishing

FFmpeg trac at avcodec.org
Tue Jul 11 21:22:29 EEST 2017


#6522: Hardcoded publish type of rtmp publishing
-------------------------------------+-------------------------------------
             Reporter:               |                     Type:
  blackshadow4279                    |  enhancement
               Status:  new          |                 Priority:  normal
            Component:  avformat     |                  Version:  git-
             Keywords:  rtmp,        |  master
  streaming, publish type            |               Blocked By:
             Blocking:               |  Reproduced by developer:  1
Analyzed by developer:  1            |
-------------------------------------+-------------------------------------
 Type of publishing in
 [https://www.adobe.com/content/dam/Adobe/en/devnet/rtmp/pdf/rtmp_specification_1.0.pdf
 RTMP] spec:
 "live", "record", or "append".
 '''record''': The stream is published and the data is recorded to a new
 file.The file is stored on the server in a subdirectory within the
 directory that contains the server application. If the file already
 exists, it is overwritten.
 '''append''': The stream is published and the data is appended to a file.
 If no file is found, it is created.
 '''live''': Live data is published without
 recording it in a file.

 In
 [https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/rtmpproto.c#L857]
 we have hardcoded type "live":

 {{{
 static int gen_publish(URLContext *s, RTMPContext *rt)
 {
     RTMPPacket pkt;
     uint8_t *p;
     int ret;

     av_log(s, AV_LOG_DEBUG, "Sending publish command for '%s'\n",
 rt->playpath);

     if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SOURCE_CHANNEL,
 RTMP_PT_INVOKE,
                                      0, 30 + strlen(rt->playpath))) < 0)
         return ret;

     pkt.extra = rt->stream_id;

     p = pkt.data;
     ff_amf_write_string(&p, "publish");
     ff_amf_write_number(&p, ++rt->nb_invokes);
     ff_amf_write_null(&p);
     ff_amf_write_string(&p, rt->playpath);
     ff_amf_write_string(&p, "live");

     return rtmp_send_packet(rt, &pkt, 1);
 }
 }}}

 For myself, of course, I will recompile, but I hope that it will be useful
 to someone.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6522>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list