V2 #13

Open
wants to merge 5 commits into
from

Projects

None yet

3 participants

Nice Work Carson

I have 2 different servers that I send my files to. I modified the code to support this feature.

I also put defines around the C code where references to the older FFMPEG include files were used. It seems several other branches have done this by simply replacing, which does not scale well. Hopefully this will help unify the developer base.

I just learned Ruby last night!

timhaak commented Oct 30, 2011

Hi

I made the following changed to make it compile on ubuntu 10.04 with latest ffmpeg not sure where to send the diffs.

diff --git a/live_segmenter.c b/live_segmenter.c
index d08e42d..5ff7d88 100644
--- a/live_segmenter.c
+++ b/live_segmenter.c
@@ -22,6 +22,8 @@
#include <unistd.h>

#include "libavformat/avformat.h"
+#include "libavcodec/avcodec.h"
+#include "libswscale/swscale.h"

struct config_info
{
@@ -67,7 +69,7 @@ static AVStream *add_output_stream(AVFormatContext *output_format_context, AVStr

switch (input_codec_context->codec_type)
{

  • case CODEC_TYPE_AUDIO:

  • case AVMEDIA_TYPE_AUDIO:
    output_codec_context->channel_layout = input_codec_context->channel_layout;
    output_codec_context->sample_rate = input_codec_context->sample_rate;
    output_codec_context->channels = input_codec_context->channels;
    @@ -81,7 +83,7 @@ static AVStream *add_output_stream(AVFormatContext *output_format_context, AVStr
    output_codec_context->block_align = input_codec_context->block_align;
    }
    break;

  • case CODEC_TYPE_VIDEO:

  • case AVMEDIA_TYPE_VIDEO:
    output_codec_context->pix_fmt = input_codec_context->pix_fmt;
    output_codec_context->width = input_codec_context->width;
    output_codec_context->height = input_codec_context->height;
    @@ -192,12 +194,12 @@ int main(int argc, char **argv)
    for (i = 0; i < input_context->nb_streams && (video_index < 0 || audio_index < 0); i++)
    {
    switch (input_context->streams[i]->codec->codec_type) {

  •  case CODEC_TYPE_VIDEO:
    
  •  case AVMEDIA_TYPE_VIDEO:
     video_index = i;
     input_context->streams[i]->discard = AVDISCARD_NONE;
     video_stream = add_output_stream(output_context, input_context->streams[i]);
     break;
    
  •  case CODEC_TYPE_AUDIO:
    
  •  case AVMEDIA_TYPE_AUDIO:
     audio_index = i;
     input_context->streams[i]->discard = AVDISCARD_NONE;
     audio_stream = add_output_stream(output_context, input_context->streams[i]);
    

    @@ -355,3 +357,9 @@ int main(int argc, char **argv)

    return 0;
    }
    +void av_free_packet(AVPacket *pkt) {

  •   if (pkt) {
    
  •           if (pkt->destruct) pkt->destruct(pkt);
    
  •           pkt->data = NULL; pkt->size = 0;
    
  •   }
    

    +}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment