|
发表于 2015-6-18 13:26:35
|
显示全部楼层
大师兄,请问一下你第一个传进去的是什么类型的参数啊,我设置了不生效。
// av_opt_set(output_fmtctx->priv_data, "hls_time", 5, 0);
av_dump_format(output_fmtctx, NULL, index_filename, 1);
if (avio_open2(&output_fmtctx->pb, index_filename, AVIO_FLAG_WRITE, &output_fmtctx->interrupt_callback, NULL) < 0) {
av_log(NULL, AV_LOG_ERROR, "cannot open the output file '%s'\n", index_filename);
return -ENOENT;
}
av_opt_set(output_fmtctx, "hls_time", 5, 0);
av_opt_set(output_fmtctx, "hls_base_url", "http://192.168.1.5/", 0);
if ((ret = avformat_write_header(output_fmtctx, NULL)) < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot write the header for the file '%s' ret = %d\n", output_filename, ret);
return -ENOENT;
}
while (1) {
AVStream *in_stream = NULL;
AVStream *out_stream = NULL; |
|