[Libav-user] url_open_buf, how to get the length of the used buffer ?
anubhav.nitt at gmail.com
Wed Jan 11 10:04:40 CET 2012
I wanted to use url_open_buf to write frames into it. I wrote a sample code
for this, which is working fine with url_fopen . But i want to write into a
file from buffer at the end of processing and in between of the processing
use only buffer.
uint8_t * buf = malloc(sizeof(uint8_t)*2048000);
if (url_open_buf(&output_context->pb, buf, 2048000, URL_WRONLY) < 0)
fprintf(stderr, "Segmenter error: Could not open '%s'\n",
... if (av_write_header(output_context))
fprintf(stderr, "Segmenter error: Could not write mpegts header to
first output file\n");
ret = av_interleaved_write_frame(output_context, &packet);
if (ret < 0)
fprintf(stderr, "Segmenter error: Could not write frame of stream:
if (segment_time - prev_segment_time >= config.segment_length)
FILE *fp = fopen("temp.ts", "w");
int si = url_close_buf(output_context->pb);
printf("content %d", si); //this is always 0
fwrite(buf, sizeof(uint8_t), 1000000, fp);
When i use url_fopen its working fine . but i want to use buffer as a
How can i get the length of the buffer to write into a file?
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user