updated for recent changes
This commit is contained in:
22
README.md
Normal file
22
README.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
httpsegmenter
|
||||||
|
=============
|
||||||
|
|
||||||
|
I grabbed this off of Google Code a few years ago; it was useful at the time
|
||||||
|
for streaming live audio to my iPhone (back when I was using an iPhone). I
|
||||||
|
came up with a workflow that I documented in [this StackOverflow post](https://stackoverflow.com/a/36227445),
|
||||||
|
and I put it to work in a live-stream timeshifter that converts radio
|
||||||
|
stations' streams into podcasts.
|
||||||
|
|
||||||
|
I just tried building it again, though, and the compile failed with some
|
||||||
|
undeclared variables or something. A bit of digging indicated that (1)
|
||||||
|
something had changed in libavcodec that broke httpsegmenter and (2) ffmpeg
|
||||||
|
has gained the ability to create the files for HTTP live streaming all by
|
||||||
|
itself.
|
||||||
|
|
||||||
|
I made a few tweaks to the source of this program to get it to build again.
|
||||||
|
They're in the latest commit, but are untested as of yet. A better idea at
|
||||||
|
this point might be to use ffmpeg's built-in segmenter. I got a stream
|
||||||
|
working pretty quickly with [this Medium post](https://medium.com/androvideo/convert-rtsp-to-hls-using-ffmpeg-2fe2cdf3a0de),
|
||||||
|
and got it dialed in further (mainly to keep it from filling the disk) with
|
||||||
|
[this bit of ffmpeg documentation](https://www.ffmpeg.org/ffmpeg-formats.html#segment).
|
||||||
|
|
||||||
@@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
#include "libavformat/avformat.h"
|
#include "libavformat/avformat.h"
|
||||||
#include "libavutil/opt.h"
|
#include "libavutil/opt.h"
|
||||||
|
#include "libavcodec/avcodec.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
@@ -119,7 +120,7 @@ static AVStream *add_output_stream(AVFormatContext *output_format_context, AVStr
|
|||||||
output_codec_context->sample_rate = input_codec_context->sample_rate;
|
output_codec_context->sample_rate = input_codec_context->sample_rate;
|
||||||
output_codec_context->channels = input_codec_context->channels;
|
output_codec_context->channels = input_codec_context->channels;
|
||||||
output_codec_context->frame_size = input_codec_context->frame_size;
|
output_codec_context->frame_size = input_codec_context->frame_size;
|
||||||
if ((input_codec_context->block_align == 1 && input_codec_context->codec_id == CODEC_ID_MP3) || input_codec_context->codec_id == CODEC_ID_AC3) {
|
if ((input_codec_context->block_align == 1 && input_codec_context->codec_id == AV_CODEC_ID_MP3) || input_codec_context->codec_id == AV_CODEC_ID_AC3) {
|
||||||
output_codec_context->block_align = 0;
|
output_codec_context->block_align = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -133,7 +134,7 @@ static AVStream *add_output_stream(AVFormatContext *output_format_context, AVStr
|
|||||||
output_codec_context->has_b_frames = input_codec_context->has_b_frames;
|
output_codec_context->has_b_frames = input_codec_context->has_b_frames;
|
||||||
|
|
||||||
if (output_format_context->oformat->flags & AVFMT_GLOBALHEADER) {
|
if (output_format_context->oformat->flags & AVFMT_GLOBALHEADER) {
|
||||||
output_codec_context->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
output_codec_context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user