ports/contrib (3.2): transcode: fix for ffmpeg
commit ee57e5b418c97cbdfc68cddf09e16a3fb0220f3c Author: Danny Rawlins <monster.romster@gmail.com> Date: Sun Jun 26 16:55:55 2016 +1000 transcode: fix for ffmpeg diff --git a/transcode/.footprint b/transcode/.footprint index e43d936..02c0ff1 100644 --- a/transcode/.footprint +++ b/transcode/.footprint @@ -244,25 +244,26 @@ lrwxrwxrwx root/root usr/lib/transcode/export_xvid.so -> export_xvid4.so -rwxr-xr-x root/root usr/lib/transcode/import_yuv4mpeg.so -rwxr-xr-x root/root usr/lib/transcode/parse_csv.awk -rw-r--r-- root/root usr/lib/transcode/xvid4.cfg -drwxr-xr-x root/root usr/man/ -drwxr-xr-x root/root usr/man/man1/ --rw-r--r-- root/root usr/man/man1/avifix.1.gz --rw-r--r-- root/root usr/man/man1/aviindex.1.gz --rw-r--r-- root/root usr/man/man1/avimerge.1.gz --rw-r--r-- root/root usr/man/man1/avisplit.1.gz --rw-r--r-- root/root usr/man/man1/avisync.1.gz --rw-r--r-- root/root usr/man/man1/tccat.1.gz --rw-r--r-- root/root usr/man/man1/tcdecode.1.gz --rw-r--r-- root/root usr/man/man1/tcdemux.1.gz --rw-r--r-- root/root usr/man/man1/tcexport.1.gz --rw-r--r-- root/root usr/man/man1/tcextract.1.gz --rw-r--r-- root/root usr/man/man1/tcmodchain.1.gz --rw-r--r-- root/root usr/man/man1/tcmodinfo.1.gz --rw-r--r-- root/root usr/man/man1/tcprobe.1.gz --rw-r--r-- root/root usr/man/man1/tcpvmexportd.1.gz --rw-r--r-- root/root usr/man/man1/tcscan.1.gz --rw-r--r-- root/root usr/man/man1/tcxmlcheck.1.gz --rw-r--r-- root/root usr/man/man1/transcode.1.gz --rw-r--r-- root/root usr/man/man1/transcode_export.1.gz --rw-r--r-- root/root usr/man/man1/transcode_filter.1.gz --rw-r--r-- root/root usr/man/man1/transcode_import.1.gz +drwxr-xr-x root/root usr/share/ +drwxr-xr-x root/root usr/share/man/ +drwxr-xr-x root/root usr/share/man/man1/ +-rw-r--r-- root/root usr/share/man/man1/avifix.1.gz +-rw-r--r-- root/root usr/share/man/man1/aviindex.1.gz +-rw-r--r-- root/root usr/share/man/man1/avimerge.1.gz +-rw-r--r-- root/root usr/share/man/man1/avisplit.1.gz +-rw-r--r-- root/root usr/share/man/man1/avisync.1.gz +-rw-r--r-- root/root usr/share/man/man1/tccat.1.gz +-rw-r--r-- root/root usr/share/man/man1/tcdecode.1.gz +-rw-r--r-- root/root usr/share/man/man1/tcdemux.1.gz +-rw-r--r-- root/root usr/share/man/man1/tcexport.1.gz +-rw-r--r-- root/root usr/share/man/man1/tcextract.1.gz +-rw-r--r-- root/root usr/share/man/man1/tcmodchain.1.gz +-rw-r--r-- root/root usr/share/man/man1/tcmodinfo.1.gz +-rw-r--r-- root/root usr/share/man/man1/tcprobe.1.gz +-rw-r--r-- root/root usr/share/man/man1/tcpvmexportd.1.gz +-rw-r--r-- root/root usr/share/man/man1/tcscan.1.gz +-rw-r--r-- root/root usr/share/man/man1/tcxmlcheck.1.gz +-rw-r--r-- root/root usr/share/man/man1/transcode.1.gz +-rw-r--r-- root/root usr/share/man/man1/transcode_export.1.gz +-rw-r--r-- root/root usr/share/man/man1/transcode_filter.1.gz +-rw-r--r-- root/root usr/share/man/man1/transcode_import.1.gz diff --git a/transcode/.md5sum b/transcode/.md5sum index 22162d7..b0fa602 100644 --- a/transcode/.md5sum +++ b/transcode/.md5sum @@ -3,9 +3,12 @@ a8d4d78e3311f576c7da27f2657358fd subtitleripper-0.3.4-linkingorder.patch f9b367044568d0ef4612770969c93e14 subtitleripper-0.3.4-respect-ldflags.patch 3cf2826df9a1a238c255a8525a63b435 transcode-1.1.7-ffmpeg-0.10.patch e78dfec264287e3ef09fae07e3477e5c transcode-1.1.7-ffmpeg-0.11.patch +28da283b40109aa9add9f58d41472ed3 transcode-1.1.7-ffmpeg-2.4.patch 69f3db45ae31213ea94a5dc0dda677bd transcode-1.1.7-ffmpeg.patch 951bff4b2dda3c8a5caf24e63c70c1aa transcode-1.1.7-ffmpeg2.patch -c764ee001be39d9af05ff3306389522f transcode-1.1.7-libav-9.patch +b5472b3f0d2536bcd75efa777262dc72 transcode-1.1.7-ffmpeg29.patch +8bf570239d9aad287f3254d350e1f98a transcode-1.1.7-libav-9.patch db152c456e768b06fec47f0b4b7a60ff transcode-1.1.7-preset-force.patch 5fd43f03549c97651dcc38a6f504de1e transcode-1.1.7-preset-free.patch 9bb25a796a8591fb764de46ee87ce505 transcode-1.1.7.tar.bz2 +962d78f070d604931b6229f193c77c91 transcode-ffmpeg3.patch diff --git a/transcode/Pkgfile b/transcode/Pkgfile index 67bff1d..66e39c6 100644 --- a/transcode/Pkgfile +++ b/transcode/Pkgfile @@ -2,13 +2,15 @@ # URL: http://tcforge.berlios.de/ # Maintainer: Danny Rawlins, crux at romster dot me # Packager: Martin Opel, mo at obbl-net dot de -# Depends on: imagemagick liba52 libdvdread libmpeg2 lzo mjpegtools +# Depends on: imagemagick liba52 libdvdread libmpeg2 mjpegtools name=transcode version=1.1.7 -release=3 +release=4 source=(https://bitbucket.org/france/transcode-tcforge/downloads/$name-$version.tar.... http://downloads.sourceforge.net/project/subtitleripper/subtitleripper/subti... + subtitleripper-0.3.4-linkingorder.patch + subtitleripper-0.3.4-respect-ldflags.patch transcode-1.1.7-ffmpeg.patch transcode-1.1.7-ffmpeg-0.10.patch transcode-1.1.7-ffmpeg-0.11.patch @@ -16,11 +18,13 @@ source=(https://bitbucket.org/france/transcode-tcforge/downloads/$name-$version. transcode-1.1.7-libav-9.patch transcode-1.1.7-preset-force.patch transcode-1.1.7-ffmpeg2.patch - subtitleripper-0.3.4-linkingorder.patch - subtitleripper-0.3.4-respect-ldflags.patch) + transcode-1.1.7-ffmpeg-2.4.patch + transcode-1.1.7-ffmpeg29.patch + transcode-ffmpeg3.patch) build() { cd $name-$version + CFLAGS+=' -pthread' patch -p 0 -i $SRC/transcode-1.1.7-ffmpeg.patch @@ -30,12 +34,16 @@ build() { patch -p 0 -i $SRC/transcode-1.1.7-libav-9.patch patch -p 1 -i $SRC/transcode-1.1.7-preset-force.patch patch -p 1 -i $SRC/transcode-1.1.7-ffmpeg2.patch - sed -i -e 's|freetype/ftglyph.h|freetype2/ftglyph.h|' filter/subtitler/load_font.c - libtoolize + patch -p 1 -i $SRC/transcode-1.1.7-ffmpeg-2.4.patch + patch -p 1 -i $SRC/transcode-1.1.7-ffmpeg29.patch + patch -p 1 -i $SRC/transcode-ffmpeg3.patch + + sed \ + -e 's|freetype/ftglyph.h|freetype2/freetype/ftglyph.h|' \ + -i filter/subtitler/load_font.c ./configure \ --prefix=/usr \ - --mandir=/usr/man \ --disable-dependency-tracking \ --enable-alsa \ --enable-a52 \ @@ -60,7 +68,8 @@ build() { make make DESTDIR=$PKG install - rm -r $PKG/usr/share + + rm -r $PKG/usr/share/doc # Subtitle support cd ../subtitleripper @@ -74,5 +83,7 @@ build() { -i Makefile make - install -m 0755 -D pgm2txt srttool subtitle2pgm subtitle2vobsub vobsub2pgm $PKG/usr/bin + install -m 0755 -t $PKG/usr/bin \ + pgm2txt srttool subtitle2pgm \ + subtitle2vobsub vobsub2pgm } diff --git a/transcode/transcode-1.1.7-ffmpeg-2.4.patch b/transcode/transcode-1.1.7-ffmpeg-2.4.patch new file mode 100644 index 0000000..da178c2 --- /dev/null +++ b/transcode/transcode-1.1.7-ffmpeg-2.4.patch @@ -0,0 +1,13 @@ +diff --git a/import/probe_ffmpeg.c b/import/probe_ffmpeg.c +index 96d3d49..8e61c51 100644 +--- a/import/probe_ffmpeg.c ++++ b/import/probe_ffmpeg.c +@@ -120,7 +120,7 @@ void probe_ffmpeg(info_t *ipipe) + + translate_info(lavf_dmx_context, ipipe->probe_info); + +- av_close_input_file(lavf_dmx_context); ++ avformat_close_input(&lavf_dmx_context); + return; + } + diff --git a/transcode/transcode-1.1.7-ffmpeg29.patch b/transcode/transcode-1.1.7-ffmpeg29.patch new file mode 100644 index 0000000..7901fc3 --- /dev/null +++ b/transcode/transcode-1.1.7-ffmpeg29.patch @@ -0,0 +1,352 @@ +Index: transcode-1.1.7/encode/encode_lavc.c +=================================================================== +--- transcode-1.1.7.orig/encode/encode_lavc.c ++++ transcode-1.1.7/encode/encode_lavc.c +@@ -233,7 +233,7 @@ static void pre_encode_video_yuv420p(TCL + vframe_list_t *vframe) + { + avpicture_fill((AVPicture *)&pd->ff_venc_frame, vframe->video_buf, +- PIX_FMT_YUV420P, ++ AV_PIX_FMT_YUV420P, + pd->ff_vcontext.width, pd->ff_vcontext.height); + } + +@@ -247,7 +247,7 @@ static void pre_encode_video_yuv420p_huf + IMG_YUV_DEFAULT, + pd->ff_vcontext.width, pd->ff_vcontext.height); + avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf, +- PIX_FMT_YUV422P, ++ AV_PIX_FMT_YUV422P, + pd->ff_vcontext.width, pd->ff_vcontext.height); + ac_imgconvert(src, IMG_YUV_DEFAULT, + pd->ff_venc_frame.data, IMG_YUV422P, +@@ -263,7 +263,7 @@ static void pre_encode_video_yuv422p(TCL + IMG_YUV422P, + pd->ff_vcontext.width, pd->ff_vcontext.height); + avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf, +- PIX_FMT_YUV420P, ++ AV_PIX_FMT_YUV420P, + pd->ff_vcontext.width, pd->ff_vcontext.height); + ac_imgconvert(src, IMG_YUV422P, + pd->ff_venc_frame.data, IMG_YUV420P, +@@ -275,7 +275,7 @@ static void pre_encode_video_yuv422p_huf + vframe_list_t *vframe) + { + avpicture_fill((AVPicture *)&pd->ff_venc_frame, vframe->video_buf, +- PIX_FMT_YUV422P, ++ AV_PIX_FMT_YUV422P, + pd->ff_vcontext.width, pd->ff_vcontext.height); + + } +@@ -285,7 +285,7 @@ static void pre_encode_video_rgb24(TCLav + vframe_list_t *vframe) + { + avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf, +- PIX_FMT_YUV420P, ++ AV_PIX_FMT_YUV420P, + pd->ff_vcontext.width, pd->ff_vcontext.height); + ac_imgconvert(&vframe->video_buf, IMG_RGB_DEFAULT, + pd->ff_venc_frame.data, IMG_YUV420P, +@@ -610,21 +610,21 @@ static int tc_lavc_set_pix_fmt(TCLavcPri + case CODEC_YUV: + if (TC_VCODEC_ID(pd) == TC_CODEC_HUFFYUV) { + pd->tc_pix_fmt = TC_CODEC_YUV422P; +- pd->ff_vcontext.pix_fmt = PIX_FMT_YUV422P; ++ pd->ff_vcontext.pix_fmt = AV_PIX_FMT_YUV422P; + pd->pre_encode_video = pre_encode_video_yuv420p_huffyuv; + } else { + pd->tc_pix_fmt = TC_CODEC_YUV420P; + pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG) +- ? PIX_FMT_YUVJ420P +- : PIX_FMT_YUV420P; ++ ? AV_PIX_FMT_YUVJ420P ++ : AV_PIX_FMT_YUV420P; + pd->pre_encode_video = pre_encode_video_yuv420p; + } + break; + case CODEC_YUV422: + pd->tc_pix_fmt = TC_CODEC_YUV422P; + pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG) +- ? PIX_FMT_YUVJ422P +- : PIX_FMT_YUV422P; ++ ? AV_PIX_FMT_YUVJ422P ++ : AV_PIX_FMT_YUV422P; + if (TC_VCODEC_ID(pd) == TC_CODEC_HUFFYUV) { + pd->pre_encode_video = pre_encode_video_yuv422p_huffyuv; + } else { +@@ -634,10 +634,10 @@ static int tc_lavc_set_pix_fmt(TCLavcPri + case CODEC_RGB: + pd->tc_pix_fmt = TC_CODEC_RGB; + pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_HUFFYUV) +- ? PIX_FMT_YUV422P ++ ? AV_PIX_FMT_YUV422P + : (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG) +- ? PIX_FMT_YUVJ420P +- : PIX_FMT_YUV420P; ++ ? AV_PIX_FMT_YUVJ420P ++ : AV_PIX_FMT_YUV420P; + pd->pre_encode_video = pre_encode_video_rgb24; + break; + default: +@@ -1390,7 +1390,7 @@ static int tc_lavc_configure(TCModuleIns + /* FIXME: move into core? */ + TC_INIT_LIBAVCODEC; + +- avcodec_get_frame_defaults(&pd->ff_venc_frame); ++ av_frame_unref(&pd->ff_venc_frame); + /* + * auxiliary config data needs to be blanked too + * before any other operation +@@ -1523,6 +1523,8 @@ static int tc_lavc_encode_video(TCModule + vframe_list_t *outframe) + { + TCLavcPrivateData *pd = NULL; ++ AVPacket pkt; ++ int ret, got_packet = 0; + + TC_MODULE_SELF_CHECK(self, "encode_video"); + +@@ -1537,12 +1539,15 @@ static int tc_lavc_encode_video(TCModule + + pd->pre_encode_video(pd, inframe); + ++ av_init_packet(&pkt); ++ pkt.data = outframe->video_buf; ++ pkt.size = inframe->video_size; ++ + TC_LOCK_LIBAVCODEC; +- outframe->video_len = avcodec_encode_video(&pd->ff_vcontext, +- outframe->video_buf, +- inframe->video_size, +- &pd->ff_venc_frame); ++ ret = avcodec_encode_video2(&pd->ff_vcontext, &pkt, ++ &pd->ff_venc_frame, &got_packet); + TC_UNLOCK_LIBAVCODEC; ++ outframe->video_len = ret ? ret : pkt.size; + + if (outframe->video_len < 0) { + tc_log_warn(MOD_NAME, "encoder error: size (%i)", +Index: transcode-1.1.7/export/export_ffmpeg.c +=================================================================== +--- transcode-1.1.7.orig/export/export_ffmpeg.c ++++ transcode-1.1.7/export/export_ffmpeg.c +@@ -250,9 +250,9 @@ int opt_default(const char *opt, const c + for(type=0; type<AVMEDIA_TYPE_NB && ret>= 0; type++){ + /* GLUE: +if */ + if (type == AVMEDIA_TYPE_VIDEO) { +- const AVOption *o2 = av_find_opt(avcodec_opts[0], opt, NULL, opt_types[type], opt_types[type]); +- if(o2) +- ret = av_set_string3(avcodec_opts[type], opt, arg, 1, &o); ++ o = av_opt_find(avcodec_opts[0], opt, NULL, opt_types[type], opt_types[type]); ++ if(o) ++ ret = av_opt_set(avcodec_opts[type], opt, arg, 0); + /* GLUE: +if */ + } + } +@@ -267,7 +267,10 @@ int opt_default(const char *opt, const c + if(opt[0] == 'a') + ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_AUDIO], opt+1, arg, 1, &o); + else */ if(opt[0] == 'v') +- ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_VIDEO], opt+1, arg, 1, &o); ++ { ++ o = av_opt_find(avcodec_opts[AVMEDIA_TYPE_VIDEO], opt+1, NULL, 0, 0); ++ ret = av_opt_set(avcodec_opts[AVMEDIA_TYPE_VIDEO], opt+1, arg, 0); ++ } + /* GLUE: disabling + else if(opt[0] == 's') + ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], opt+1, arg, 1, &o); +@@ -487,10 +490,10 @@ MOD_init + } + + lavc_venc_context = avcodec_alloc_context3(lavc_venc_codec); +- lavc_venc_frame = avcodec_alloc_frame(); ++ lavc_venc_frame = av_frame_alloc(); + +- lavc_convert_frame= avcodec_alloc_frame(); +- size = avpicture_get_size(PIX_FMT_RGB24, vob->ex_v_width, vob->ex_v_height); ++ lavc_convert_frame= av_frame_alloc(); ++ size = avpicture_get_size(AV_PIX_FMT_RGB24, vob->ex_v_width, vob->ex_v_height); + enc_buffer = tc_malloc(size); + + if (lavc_venc_context == NULL || !enc_buffer || !lavc_convert_frame) { +@@ -1114,7 +1117,7 @@ MOD_init + lavc_venc_context->prediction_method = lavc_param_prediction_method; + + if(is_huffyuv) +- lavc_venc_context->pix_fmt = PIX_FMT_YUV422P; ++ lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV422P; + else + { + switch(pix_fmt) +@@ -1123,18 +1126,18 @@ MOD_init + case CODEC_RGB: + { + if(is_mjpeg) +- lavc_venc_context->pix_fmt = PIX_FMT_YUVJ420P; ++ lavc_venc_context->pix_fmt = AV_PIX_FMT_YUVJ420P; + else +- lavc_venc_context->pix_fmt = PIX_FMT_YUV420P; ++ lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV420P; + break; + } + + case CODEC_YUV422: + { + if(is_mjpeg) +- lavc_venc_context->pix_fmt = PIX_FMT_YUVJ422P; ++ lavc_venc_context->pix_fmt = AV_PIX_FMT_YUVJ422P; + else +- lavc_venc_context->pix_fmt = PIX_FMT_YUV422P; ++ lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV422P; + break; + } + +@@ -1596,6 +1599,8 @@ MOD_encode + + int out_size; + const char pict_type_char[5]= {'?', 'I', 'P', 'B', 'S'}; ++ AVPacket pkt; ++ int ret, got_packet = 0; + + if (param->flag == TC_VIDEO) { + +@@ -1620,7 +1625,7 @@ MOD_encode + YUV_INIT_PLANES(src, param->buffer, IMG_YUV_DEFAULT, + lavc_venc_context->width, lavc_venc_context->height); + avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer, +- PIX_FMT_YUV422P, lavc_venc_context->width, ++ AV_PIX_FMT_YUV422P, lavc_venc_context->width, + lavc_venc_context->height); + /* FIXME: can't use tcv_convert (see decode_lavc.c) */ + ac_imgconvert(src, IMG_YUV_DEFAULT, +@@ -1650,7 +1655,7 @@ MOD_encode + lavc_venc_context->width, + lavc_venc_context->height); + avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer, +- PIX_FMT_YUV420P, lavc_venc_context->width, ++ AV_PIX_FMT_YUV420P, lavc_venc_context->width, + lavc_venc_context->height); + ac_imgconvert(src, IMG_YUV422P, + lavc_venc_frame->data, IMG_YUV420P, +@@ -1661,7 +1666,7 @@ MOD_encode + + case CODEC_RGB: + avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer, +- PIX_FMT_YUV420P, lavc_venc_context->width, ++ AV_PIX_FMT_YUV420P, lavc_venc_context->width, + lavc_venc_context->height); + ac_imgconvert(¶m->buffer, IMG_RGB_DEFAULT, + lavc_venc_frame->data, IMG_YUV420P, +@@ -1674,13 +1679,17 @@ MOD_encode + return TC_EXPORT_ERROR; + } + ++ av_init_packet(&pkt); ++ pkt.data = enc_buffer; ++ pkt.size = size; + + TC_LOCK_LIBAVCODEC; +- out_size = avcodec_encode_video(lavc_venc_context, +- enc_buffer, size, +- lavc_venc_frame); ++ ret = avcodec_encode_video2(lavc_venc_context, &pkt, ++ lavc_venc_frame, &got_packet); + TC_UNLOCK_LIBAVCODEC; + ++ out_size = ret ? ret : pkt.size; ++ + if (out_size < 0) { + tc_log_warn(MOD_NAME, "encoder error: size (%d)", out_size); + return TC_EXPORT_ERROR; +Index: transcode-1.1.7/import/decode_lavc.c +=================================================================== +--- transcode-1.1.7.orig/import/decode_lavc.c ++++ transcode-1.1.7/import/decode_lavc.c +@@ -327,8 +327,8 @@ void decode_lavc(decode_t *decode) + + // Convert avcodec image to the requested YUV or RGB format + switch (lavc_dec_context->pix_fmt) { +- case PIX_FMT_YUVJ420P: +- case PIX_FMT_YUV420P: ++ case AV_PIX_FMT_YUVJ420P: ++ case AV_PIX_FMT_YUV420P: + // Remove "dead space" at right edge of planes, if any + if (picture.linesize[0] != lavc_dec_context->width) { + int y; +@@ -352,7 +352,7 @@ void decode_lavc(decode_t *decode) + pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT, + lavc_dec_context->width, lavc_dec_context->height); + break; +- case PIX_FMT_YUV411P: ++ case AV_PIX_FMT_YUV411P: + if (picture.linesize[0] != lavc_dec_context->width) { + int y; + for (y = 0; y < lavc_dec_context->height; y++) { +@@ -371,8 +371,8 @@ void decode_lavc(decode_t *decode) + pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT, + lavc_dec_context->width, lavc_dec_context->height); + break; +- case PIX_FMT_YUVJ422P: +- case PIX_FMT_YUV422P: ++ case AV_PIX_FMT_YUVJ422P: ++ case AV_PIX_FMT_YUV422P: + if (picture.linesize[0] != lavc_dec_context->width) { + int y; + for (y = 0; y < lavc_dec_context->height; y++) { +@@ -391,8 +391,8 @@ void decode_lavc(decode_t *decode) + pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT, + lavc_dec_context->width, lavc_dec_context->height); + break; +- case PIX_FMT_YUVJ444P: +- case PIX_FMT_YUV444P: ++ case AV_PIX_FMT_YUVJ444P: ++ case AV_PIX_FMT_YUV444P: + if (picture.linesize[0] != lavc_dec_context->width) { + int y; + for (y = 0; y < lavc_dec_context->height; y++) { +Index: transcode-1.1.7/import/import_ffmpeg.c +=================================================================== +--- transcode-1.1.7.orig/import/import_ffmpeg.c ++++ transcode-1.1.7/import/import_ffmpeg.c +@@ -661,8 +661,8 @@ retry: + + // Convert avcodec image to our internal YUV or RGB format + switch (lavc_dec_context->pix_fmt) { +- case PIX_FMT_YUVJ420P: +- case PIX_FMT_YUV420P: ++ case AV_PIX_FMT_YUVJ420P: ++ case AV_PIX_FMT_YUV420P: + src_fmt = IMG_YUV420P; + YUV_INIT_PLANES(src_planes, frame, src_fmt, + lavc_dec_context->width, lavc_dec_context->height); +@@ -693,7 +693,7 @@ retry: + } + break; + +- case PIX_FMT_YUV411P: ++ case AV_PIX_FMT_YUV411P: + src_fmt = IMG_YUV411P; + YUV_INIT_PLANES(src_planes, frame, src_fmt, + lavc_dec_context->width, lavc_dec_context->height); +@@ -721,8 +721,8 @@ retry: + } + break; + +- case PIX_FMT_YUVJ422P: +- case PIX_FMT_YUV422P: ++ case AV_PIX_FMT_YUVJ422P: ++ case AV_PIX_FMT_YUV422P: + src_fmt = IMG_YUV422P; + YUV_INIT_PLANES(src_planes, frame, src_fmt, + lavc_dec_context->width, lavc_dec_context->height); +@@ -750,8 +750,8 @@ retry: + } + break; + +- case PIX_FMT_YUVJ444P: +- case PIX_FMT_YUV444P: ++ case AV_PIX_FMT_YUVJ444P: ++ case AV_PIX_FMT_YUV444P: + src_fmt = IMG_YUV444P; + YUV_INIT_PLANES(src_planes, frame, src_fmt, + lavc_dec_context->width, lavc_dec_context->height); diff --git a/transcode/transcode-1.1.7-libav-9.patch b/transcode/transcode-1.1.7-libav-9.patch index 9f2d235..3989d3d 100644 --- a/transcode/transcode-1.1.7-libav-9.patch +++ b/transcode/transcode-1.1.7-libav-9.patch @@ -1,5 +1,5 @@ ---- ./import/probe_ffmpeg.c.original 2013-04-22 20:04:51.058081388 +0200 -+++ ./import/probe_ffmpeg.c 2013-04-22 20:05:25.744081897 +0200 +--- import/probe_ffmpeg.c.original 2013-04-22 20:04:51.058081388 +0200 ++++ import/probe_ffmpeg.c 2013-04-22 20:05:25.744081897 +0200 @@ -109,7 +109,7 @@ void probe_ffmpeg(info_t *ipipe) return; } @@ -9,8 +9,8 @@ if (ret < 0) { tc_log_error(__FILE__, "unable to fetch informations from '%s'" " (libavformat failure)", ---- ./import/decode_lavc.c.original 2013-04-22 20:06:17.260082652 +0200 -+++ ./import/decode_lavc.c 2013-04-22 20:07:47.564083975 +0200 +--- import/decode_lavc.c.original 2013-04-22 20:06:17.260082652 +0200 ++++ import/decode_lavc.c 2013-04-22 20:07:47.564083975 +0200 @@ -170,7 +170,7 @@ void decode_lavc(decode_t *decode) // Set these to the expected values so that ffmpeg's decoder can diff --git a/transcode/transcode-ffmpeg3.patch b/transcode/transcode-ffmpeg3.patch new file mode 100644 index 0000000..efc928f --- /dev/null +++ b/transcode/transcode-ffmpeg3.patch @@ -0,0 +1,213 @@ +--- transcode-1.1.7/export/aud_aux.c.orig 2016-02-16 23:38:40.162690789 +0000 ++++ transcode-1.1.7/export/aud_aux.c 2016-02-16 23:40:50.335488439 +0000 +@@ -326,10 +326,10 @@ + + switch (o_codec) { + case 0x50: +- codeid = CODEC_ID_MP2; ++ codeid = AV_CODEC_ID_MP2; + break; + case 0x2000: +- codeid = CODEC_ID_AC3; ++ codeid = AV_CODEC_ID_AC3; + break; + default: + tc_warn("cannot init ffmpeg with %x", o_codec); +@@ -363,7 +363,7 @@ + TC_UNLOCK_LIBAVCODEC; + if (ret < 0) { + tc_warn("tc_audio_init_ffmpeg: could not open %s codec !", +- (codeid == CODEC_ID_MP2) ?"mpa" :"ac3"); ++ (codeid == AV_CODEC_ID_MP2) ?"mpa" :"ac3"); + return(TC_EXPORT_ERROR); + } + +--- transcode-1.1.7/import/import_ffmpeg.c.orig 2016-02-16 23:52:36.192589648 +0000 ++++ transcode-1.1.7/import/import_ffmpeg.c 2016-02-16 23:54:38.728757498 +0000 +@@ -59,51 +59,51 @@ + + // fourCC to ID mapping taken from MPlayer's codecs.conf + static struct ffmpeg_codec ffmpeg_codecs[] = { +- {CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41", ++ {AV_CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41", + {"MP41", "DIV1", ""}}, +- {CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42", ++ {AV_CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42", + {"MP42", "DIV2", ""}}, +- {CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4", ++ {AV_CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4", + {"DIV3", "DIV5", "AP41", "MPG3", "MP43", ""}}, +- {CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4", ++ {AV_CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4", + {"DIVX", "XVID", "MP4S", "M4S2", "MP4V", "UMP4", "DX50", ""}}, +- {CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg", ++ {AV_CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg", + {"MJPG", "AVRN", "AVDJ", "JPEG", "MJPA", "JFIF", ""}}, +- {CODEC_ID_MPEG1VIDEO, TC_CODEC_MPG1, "mpeg1video", ++ {AV_CODEC_ID_MPEG1VIDEO, TC_CODEC_MPG1, "mpeg1video", + {"MPG1", ""}}, +- {CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo", ++ {AV_CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo", + {"DVSD", ""}}, +- {CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1", ++ {AV_CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1", + {"WMV1", ""}}, +- {CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2", ++ {AV_CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2", + {"WMV2", ""}}, +- {CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu", ++ {AV_CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu", + {"HFYU", ""}}, +- {CODEC_ID_H263I, TC_CODEC_H263I, "h263i", ++ {AV_CODEC_ID_H263I, TC_CODEC_H263I, "h263i", + {"I263", ""}}, +- {CODEC_ID_H263P, TC_CODEC_H263P, "h263p", ++ {AV_CODEC_ID_H263P, TC_CODEC_H263P, "h263p", + {"H263", "U263", "VIV1", ""}}, +- {CODEC_ID_H264, TC_CODEC_H264, "h264", ++ {AV_CODEC_ID_H264, TC_CODEC_H264, "h264", + {"H264", "h264", "X264", "x264", "avc1", ""}}, +- {CODEC_ID_RV10, TC_CODEC_RV10, "rv10", ++ {AV_CODEC_ID_RV10, TC_CODEC_RV10, "rv10", + {"RV10", "RV13", ""}}, +- {CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1", ++ {AV_CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1", + {"SVQ1", ""}}, +- {CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3", ++ {AV_CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3", + {"SVQ3", ""}}, +- {CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video", ++ {AV_CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video", + {"MPG2", ""}}, +- {CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG, "mpeg2video", ++ {AV_CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG, "mpeg2video", + {"MPG2", ""}}, +- {CODEC_ID_ASV1, TC_CODEC_ASV1, "asv1", ++ {AV_CODEC_ID_ASV1, TC_CODEC_ASV1, "asv1", + {"ASV1", ""}}, +- {CODEC_ID_ASV2, TC_CODEC_ASV2, "asv2", ++ {AV_CODEC_ID_ASV2, TC_CODEC_ASV2, "asv2", + {"ASV2", ""}}, +- {CODEC_ID_FFV1, TC_CODEC_FFV1, "ffv1", ++ {AV_CODEC_ID_FFV1, TC_CODEC_FFV1, "ffv1", + {"FFV1", ""}}, +- {CODEC_ID_RAWVIDEO, TC_CODEC_YUV420P, "raw", ++ {AV_CODEC_ID_RAWVIDEO, TC_CODEC_YUV420P, "raw", + {"I420", "IYUV", ""}}, +- {CODEC_ID_RAWVIDEO, TC_CODEC_YUV422P, "raw", ++ {AV_CODEC_ID_RAWVIDEO, TC_CODEC_YUV422P, "raw", + {"Y42B", ""}}, + {0, TC_CODEC_UNKNOWN, NULL, {""}}}; + +@@ -324,13 +324,13 @@ + // XXX: some codecs need extra data + switch (codec->id) + { +- case CODEC_ID_MJPEG: extra_data_size = 28; break; +- case CODEC_ID_LJPEG: extra_data_size = 28; break; +- case CODEC_ID_HUFFYUV: extra_data_size = 1000; break; +- case CODEC_ID_ASV1: extra_data_size = 8; break; +- case CODEC_ID_ASV2: extra_data_size = 8; break; +- case CODEC_ID_WMV1: extra_data_size = 4; break; +- case CODEC_ID_WMV2: extra_data_size = 4; break; ++ case AV_CODEC_ID_MJPEG: extra_data_size = 28; break; ++ case AV_CODEC_ID_LJPEG: extra_data_size = 28; break; ++ case AV_CODEC_ID_HUFFYUV: extra_data_size = 1000; break; ++ case AV_CODEC_ID_ASV1: extra_data_size = 8; break; ++ case AV_CODEC_ID_ASV2: extra_data_size = 8; break; ++ case AV_CODEC_ID_WMV1: extra_data_size = 4; break; ++ case AV_CODEC_ID_WMV2: extra_data_size = 4; break; + default: extra_data_size = 0; break; + } + +@@ -360,7 +360,7 @@ + frame_size = x_dim*y_dim + 2*UV_PLANE_SIZE(IMG_YUV_DEFAULT,x_dim,y_dim); + + // we adapt the color space +- if(codec->id == CODEC_ID_MJPEG) { ++ if(codec->id == AV_CODEC_ID_MJPEG) { + enable_levels_filter(); + } + break; +@@ -434,7 +434,7 @@ + } + + // we adapt the color space +- if(codec->id == CODEC_ID_MJPEG) { ++ if(codec->id == AV_CODEC_ID_MJPEG) { + enable_levels_filter(); + } + +@@ -504,13 +504,13 @@ + int bkey = 0; + + // check for keyframes +- if (codec->id == CODEC_ID_MSMPEG4V3) { ++ if (codec->id == AV_CODEC_ID_MSMPEG4V3) { + if (divx3_is_key(buffer)) bkey = 1; + } +- else if (codec->id == CODEC_ID_MPEG4) { ++ else if (codec->id == AV_CODEC_ID_MPEG4) { + if (mpeg4_is_key(buffer, bytes_read)) bkey = 1; + } +- else if (codec->id == CODEC_ID_MJPEG) { ++ else if (codec->id == AV_CODEC_ID_MJPEG) { + bkey = 1; + } + +--- transcode-1.1.7/import/decode_lavc.c.orig 2016-02-16 23:56:35.488282034 +0000 ++++ transcode-1.1.7/import/decode_lavc.c 2016-02-16 23:56:55.201535074 +0000 +@@ -58,37 +58,37 @@ + + // fourCC to ID mapping taken from MPlayer's codecs.conf + static struct ffmpeg_codec ffmpeg_codecs[] = { +- {CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41", ++ {AV_CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41", + {"MP41", "DIV1", ""}}, +- {CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42", ++ {AV_CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42", + {"MP42", "DIV2", ""}}, +- {CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4", ++ {AV_CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4", + {"DIV3", "DIV5", "AP41", "MPG3", "MP43", ""}}, +- {CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4", ++ {AV_CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4", + {"DIVX", "XVID", "MP4S", "M4S2", "MP4V", "UMP4", "DX50", ""}}, +- {CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg", ++ {AV_CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg", + {"MJPG", "AVRN", "AVDJ", "JPEG", "MJPA", "JFIF", ""}}, +- {CODEC_ID_MPEG1VIDEO, TC_CODEC_MPEG1VIDEO, "mpeg1video", ++ {AV_CODEC_ID_MPEG1VIDEO, TC_CODEC_MPEG1VIDEO, "mpeg1video", + {"MPG1", ""}}, +- {CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo", ++ {AV_CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo", + {"DVSD", ""}}, +- {CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1", ++ {AV_CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1", + {"WMV1", ""}}, +- {CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2", ++ {AV_CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2", + {"WMV2", ""}}, +- {CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu", ++ {AV_CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu", + {"HFYU", ""}}, +- {CODEC_ID_H263I, TC_CODEC_H263I, "h263i", ++ {AV_CODEC_ID_H263I, TC_CODEC_H263I, "h263i", + {"I263", ""}}, +- {CODEC_ID_H263P, TC_CODEC_H263P, "h263p", ++ {AV_CODEC_ID_H263P, TC_CODEC_H263P, "h263p", + {"H263", "U263", "VIV1", ""}}, +- {CODEC_ID_RV10, TC_CODEC_RV10, "rv10", ++ {AV_CODEC_ID_RV10, TC_CODEC_RV10, "rv10", + {"RV10", "RV13", ""}}, +- {CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1", ++ {AV_CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1", + {"SVQ1", ""}}, +- {CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3", ++ {AV_CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3", + {"SVQ3", ""}}, +- {CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video", ++ {AV_CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video", + {"MPG2", ""}}, + {0, TC_CODEC_UNKNOWN, NULL, {""}}}; +
participants (1)
-
crux@crux.nu