X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;ds=inline;f=cinelerra-5.1%2Fcinelerra%2Fffmpeg.C;h=a18ae88cae0e356847edad989b3935752b008b79;hb=3a6c2c4d94e7b24eb50d8ecd3ec0b3c8d8539743;hp=2ac09f730a9612126925dcc7fd5df14bb4517946;hpb=114b45040c8027671cbe50e7d6cecb28bf73b35f;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C index 2ac09f73..a18ae88c 100644 --- a/cinelerra-5.1/cinelerra/ffmpeg.C +++ b/cinelerra-5.1/cinelerra/ffmpeg.C @@ -33,6 +33,12 @@ #include "mwindow.h" #include "vframe.h" +#ifdef FFMPEG3 +#define url filename +#else +#define av_register_all(s) +#define avfilter_register_all(s) +#endif #define VIDEO_INBUF_SIZE 0x10000 #define AUDIO_INBUF_SIZE 0x10000 @@ -1108,6 +1114,7 @@ int FFVideoConvert::convert_picture_vframe(VFrame *frame, AVFrame *ip, AVFrame * case BC_YUV422P: usz /= 2; case BC_YUV444P: + case BC_GBRP: // override av_image_fill_arrays() for planar types ipic->data[0] = frame->get_y(); ipic->linesize[0] = ysz; ipic->data[1] = frame->get_u(); ipic->linesize[1] = usz; @@ -1208,6 +1215,7 @@ int FFVideoConvert::convert_vframe_picture(VFrame *frame, AVFrame *op, AVFrame * case BC_YUV422P: usz /= 2; case BC_YUV444P: + case BC_GBRP: // override av_image_fill_arrays() for planar types opic->data[0] = frame->get_y(); opic->linesize[0] = ysz; opic->data[1] = frame->get_u(); opic->linesize[1] = usz; @@ -1925,6 +1933,7 @@ int FFMPEG::info(char *text, int len) int FFMPEG::init_decoder(const char *filename) { ff_lock("FFMPEG::init_decoder"); + av_register_all(); char file_opts[BCTEXTLEN]; char *bp = strrchr(strcpy(file_opts, filename), '/'); char *sp = strrchr(!bp ? file_opts : bp, '.'); @@ -2070,6 +2079,7 @@ int FFMPEG::init_encoder(const char *filename) return 1; } ff_lock("FFMPEG::init_encoder"); + av_register_all(); char format[BCSTRLEN]; if( get_format(format, "format", file_format) ) strcpy(format, file_format); @@ -2103,7 +2113,9 @@ int FFMPEG::open_encoder(const char *type, const char *spec) return 1; } +#ifdef HAVE_DV if( !strcmp(codec_name, CODEC_TAG_DVSD) ) strcpy(codec_name, "dv"); +#endif else if( !strcmp(codec_name, CODEC_TAG_MJPEG) ) strcpy(codec_name, "mjpeg"); else if( !strcmp(codec_name, CODEC_TAG_JPEG) ) strcpy(codec_name, "jpeg"); @@ -2856,6 +2868,7 @@ int FFMPEG::ff_cpus() int FFVideoStream::create_filter(const char *filter_spec, AVCodecParameters *avpar) { + avfilter_register_all(); const char *sp = filter_spec; char filter_name[BCSTRLEN], *np = filter_name; int i = sizeof(filter_name); @@ -2896,6 +2909,7 @@ int FFVideoStream::create_filter(const char *filter_spec, AVCodecParameters *avp int FFAudioStream::create_filter(const char *filter_spec, AVCodecParameters *avpar) { + avfilter_register_all(); const char *sp = filter_spec; char filter_name[BCSTRLEN], *np = filter_name; int i = sizeof(filter_name); @@ -2980,6 +2994,7 @@ int FFMPEG::scan(IndexState *index_state, int64_t *scan_position, int *canceled) if( !frame ) { fprintf(stderr,"FFMPEG::scan: "); fprintf(stderr,_("av_frame_alloc failed\n")); + fprintf(stderr,"FFMPEG::scan:file=%s\n", file_base->asset->path); return -1; } @@ -3025,6 +3040,7 @@ int FFMPEG::scan(IndexState *index_state, int64_t *scan_position, int *canceled) } fprintf(stderr,"FFMPEG::scan: "); fprintf(stderr,_("codec open failed\n")); + fprintf(stderr,"FFMPEG::scan:file=%s\n", file_base->asset->path); avcodec_free_context(&avctx); }