Menu

ffmpeg http live streaming support -- how to use the api in segment.c

derekzhuo
2015-06-15
2015-06-17
  • derekzhuo

    derekzhuo - 2015-06-15

    Guys, I am working on a hls segmenter on android which doesn't contain the tool, so i have to finish one by myself, i tried m3u8-segmenter of johnf on github, but it does not work fine, and then i saw there is a segment.c in ffmpeg project, but it does not contain something like segment.h, i just do not know how to kick off, could some one tell me how to use the APIs in file segment.c.

    Thanks.

     
  • Obucina

    Obucina - 2015-06-15

    FFmpeg contains HLS muxer, it may be easily used from command line. It will cut Your file into segments of the specified length, and make M3U8 playlists for VOD or live streaming (e.g. from live source, like camera). For muxer names and available options check the source code avformat/hlsenc.*

     
    • derekzhuo

      derekzhuo - 2015-06-16

      thanks, i notice that the cmd line tool could used to segment stream, but i need to implement one as a .so by myself, which could be invoked by application in java. so i need to figure out how exactly the muxer is initilized and get invoked.

       
      • Obucina

        Obucina - 2015-06-16

        it works as any other muxer, you just need to look into possible
        options (number of segments per list, and segment duration). in case
        you have mp4 video, you need to apply annex b filter.

        2015-06-16 4:05 GMT+02:00 derekzhuo derekzhuo@users.sf.net:

        thanks, i notice that the cmd line tool could used to segment stream, but i
        need to implement one as a .so by myself, which could be invoked by
        application in java. so i need to figure out how exactly the muxer is
        initilized and get invoked.


        ffmpeg http live streaming support -- how to use the api in segment.c


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/ffmpeg4android/discussion/general/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

         
        • derekzhuo

          derekzhuo - 2015-06-17

          yes, i get it work now, but here is another problem, in the latest version of ffmpeg4android, the support for hls are limited, i can only see 4 options:
          static const AVOption options[] = {
          {"start_number", "set first number in the sequence", OFFSET(sequence),AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, E},
          {"hls_time", "set segment length in seconds", OFFSET(time), AV_OPT_TYPE_FLOAT, {.dbl = 2}, 0, FLT_MAX, E},
          {"hls_list_size", "set maximum number of playlist entries", OFFSET(size), AV_OPT_TYPE_INT, {.i64 = 5}, 0, INT_MAX, E},
          {"hls_wrap", "set number after which the index wraps", OFFSET(wrap), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E},
          { NULL },
          };

          which means i can not delete old ts file.

          do you have any higher version of ffmpeg4android?

          thanks!

           

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.