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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.*
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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
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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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.*
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.
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:
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!