Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
/* Define to 1 if you have the <libavcodec/avcodec.h> header file. */ #undef HAVE_LIBAVCODEC_AVCODEC_H -/* Define to 1 if you have the `avcore' library (-lavcore). */ -#undef HAVE_LIBAVCORE - /* Define to 1 if you have the `avdevice' library (-lavdevice). */ #undef HAVE_LIBAVDEVICE AC_CHECK_LIB(x264,x264_predict_16x16_init) AC_CHECK_LIB(avutil,av_malloc,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming)) # Don't bother to warn about this one -AC_CHECK_LIB(avcore,av_image_copy,,) -AC_CHECK_LIB(avcodec,avcodec_init,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) -AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming)) +AC_CHECK_LIB(avutil,av_image_copy,,) +AC_CHECK_LIB(avcodec,avcodec_open2,,AC_MSG_WARN(libavcodec.a is required +for MPEG streaming)) +AC_CHECK_LIB(avformat,avformat_new_stream,,AC_MSG_WARN(libavformat.a is +required for MPEG streaming)) AC_CHECK_LIB(avdevice,avdevice_register_all,,AC_MSG_WARN(libavdevice.a may be required for MPEG streaming)) AC_CHECK_LIB(swscale,sws_scale,,,-lswscale) AC_CHECK_LIB(bz2,BZ2_bzCompress,,AC_MSG_WARN(zm requires libbz2.a for recent versions of ffmpeg)) Info( "Priming capture from %s", mPath.c_str() ); // Open the input, not necessarily a file - if ( av_open_input_file( &mFormatContext, mPath.c_str(), NULL, 0, NULL ) !=0 ) + if ( avformat_open_input( &mFormatContext, mPath.c_str(), NULL, NULL ) !=0 ) Fatal( "Unable to open input %s due to: %s", mPath.c_str(), strerror(errno) ); // Locate stream info from input - if ( av_find_stream_info( mFormatContext ) < 0 ) + if ( avformat_find_stream_info( mFormatContext, NULL ) < 0 ) Fatal( "Unable to find stream info from %s due to: %s", mPath.c_str(), strerror(errno) ); // Find first video stream present Fatal( "Can't find codec for video stream from %s", mPath.c_str() ); // Open the codec - if ( avcodec_open( mCodecContext, mCodec ) < 0 ) + if ( avcodec_open2( mCodecContext, mCodec, NULL ) < 0 ) Fatal( "Unable to open codec for video stream from %s", mPath.c_str() ); // Allocate space for the native video frame ost = NULL; if (of->video_codec != CODEC_ID_NONE) { - ost = av_new_stream(ofc, 0); + ost = avformat_new_stream(ofc, 0); if (!ost) { Panic( "Could not alloc stream" ); { /* set the output parameters (must be done even if no parameters). */ - if ( av_set_parameters(ofc, NULL) < 0 ) + /* + * Removed in last ffmpeg + * if ( av_set_parameters(ofc, NULL) < 0 ) { Panic( "Invalid output format parameters" ); - } + }*/ //dump_format(ofc, 0, filename, 1); } } /* open the codec */ - if ( avcodec_open(c, codec) < 0 ) + if ( avcodec_open2(c, codec, NULL ) < 0 ) { Panic( "Could not open codec" ); } if ( !(of->flags & AVFMT_NOFILE) ) { #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) - if ( avio_open(&ofc->pb, filename, URL_WRONLY) < 0 ) + if ( avio_open(&ofc->pb, filename, AVIO_FLAG_WRITE) < 0 ) #else if ( url_fopen(&ofc->pb, filename, URL_WRONLY) < 0 ) #endif } /* write the stream header, if any */ - av_write_header(ofc); + avformat_write_header(ofc, NULL); } VideoStream::VideoStream( const char *filename, const char *format, int bitrate, double frame_rate, int colours, int width, int height ) Panic( "Unable to locate codec %d decoder", codecContext->codec_id ); // Open codec - if ( avcodec_open( codecContext, codec ) < 0 ) + if ( avcodec_open2( codecContext, codec, NULL ) < 0 ) Panic( "Can't open codec" ); picture = avcodec_alloc_frame(); for ( int i = 0; i < mMediaList.size(); i++ ) { const MediaDescriptor *mediaDesc = mMediaList[i]; - AVStream *stream = av_new_stream( formatContext, i ); + AVStream *stream = avformat_new_stream( formatContext, NULL ); Debug( 1, "Looking for codec for %s payload type %d / %s", mediaDesc->getType().c_str(), mediaDesc->getPayloadType(), mediaDesc->getPayloadDesc().c_str() ); #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) |