pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/multimedia/transcode transcode: use ffmpeg4



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d8a53ca81ba2
branches:  trunk
changeset: 346148:d8a53ca81ba2
user:      markd <markd%pkgsrc.org@localhost>
date:      Sun Dec 29 10:23:53 2019 +0000

description:
transcode: use ffmpeg4

diffstat:

 multimedia/transcode/Makefile                                |    6 +-
 multimedia/transcode/distinfo                                |   17 +-
 multimedia/transcode/patches/patch-encode_encode_lavc.c      |  369 +++++++++-
 multimedia/transcode/patches/patch-export_aud__aux.c         |   86 ++-
 multimedia/transcode/patches/patch-export_export_ffmpeg.c    |  265 +++++++-
 multimedia/transcode/patches/patch-export_ffmpeg_cfg.c       |   80 ++-
 multimedia/transcode/patches/patch-filter_filter__resample.c |   23 +
 multimedia/transcode/patches/patch-import_import_ffmpeg.c    |  184 +++++-
 multimedia/transcode/patches/patch-import_probe_ffmpeg.c     |   22 +-
 9 files changed, 964 insertions(+), 88 deletions(-)

diffs (truncated from 1475 to 300 lines):

diff -r 3f00de5d8162 -r d8a53ca81ba2 multimedia/transcode/Makefile
--- a/multimedia/transcode/Makefile     Sun Dec 29 10:15:04 2019 +0000
+++ b/multimedia/transcode/Makefile     Sun Dec 29 10:23:53 2019 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.118 2019/07/21 22:25:28 wiz Exp $
+# $NetBSD: Makefile,v 1.119 2019/12/29 10:23:53 markd Exp $
 
 DISTNAME=      transcode-1.1.7
-PKGREVISION=   36
+PKGREVISION=   37
 CATEGORIES=    multimedia
 MASTER_SITES=  http://bitbucket.org/france/transcode-tcforge/downloads/
 EXTRACT_SUFX=  .tar.bz2
@@ -55,7 +55,7 @@
 .include "../../graphics/freetype2/buildlink3.mk"
 .include "../../graphics/liblqr/buildlink3.mk"
 .include "../../graphics/png/buildlink3.mk"
-.include "../../multimedia/ffmpeg2/buildlink3.mk"
+.include "../../multimedia/ffmpeg4/buildlink3.mk"
 .include "../../multimedia/libdvdread/buildlink3.mk"
 .include "../../multimedia/libmpeg2/buildlink3.mk"
 .include "../../multimedia/libogg/buildlink3.mk"
diff -r 3f00de5d8162 -r d8a53ca81ba2 multimedia/transcode/distinfo
--- a/multimedia/transcode/distinfo     Sun Dec 29 10:15:04 2019 +0000
+++ b/multimedia/transcode/distinfo     Sun Dec 29 10:23:53 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.26 2016/05/16 19:41:17 adam Exp $
+$NetBSD: distinfo,v 1.27 2019/12/29 10:23:53 markd Exp $
 
 SHA1 (transcode-1.1.7.tar.bz2) = e35df68b960eb56ef0a59a4cdbed1491be56aee6
 RMD160 (transcode-1.1.7.tar.bz2) = faa854acbbfd52faaa216505176f94d756d77841
@@ -6,22 +6,23 @@
 Size (transcode-1.1.7.tar.bz2) = 2183627 bytes
 SHA1 (patch-avilib_avidump.c) = 640aac6fc274a685b1847b48870b37b2c2ab1e88
 SHA1 (patch-configure) = 38418cd91750f55828124b5895d42d3af5c2d56a
-SHA1 (patch-encode_encode_lavc.c) = c33f40dab212b601e5d808d972d132db4eee2d2e
-SHA1 (patch-export_aud__aux.c) = 84b774d13e363721db692b1edc53589e165b094e
+SHA1 (patch-encode_encode_lavc.c) = 5ce01220933d58ab09a58c37146da290a3d91164
+SHA1 (patch-export_aud__aux.c) = 437ffde84123eccfe496c478a9db0066208fe256
 SHA1 (patch-export_export__im.c) = 3a4f08d548cdebdfa618aeff2df398bd61002120
-SHA1 (patch-export_export_ffmpeg.c) = 4367d16ba83ccc5c868f0dc470dcd0b64770b185
-SHA1 (patch-export_ffmpeg_cfg.c) = 216f7970f3885a3f7fc8c229e4d1950cd6430cff
+SHA1 (patch-export_export_ffmpeg.c) = 2cc6100ab5e837b8d3fe66ec55c88962e6fbfb26
+SHA1 (patch-export_ffmpeg_cfg.c) = d1678b2b6bdd2a9353d1fb34d72c2cc2d1aa1fa4
 SHA1 (patch-export_ffmpeg_cfg.h) = 7cf230de948de004cc0500f0ae2511561081e952
 SHA1 (patch-filter_filter__compare.c) = b866aa3f36607bee87aad4eb7023b0e5087b1c25
 SHA1 (patch-filter_filter__logo.c) = 4cff9a4123797d3a25df17b22f3922260ed3a7d4
 SHA1 (patch-filter_filter__logoaway.c) = 252986a1e3ce9969e97bfeedd63bec6e3cf6273c
 SHA1 (patch-filter_filter__pp.c) = a7a3f9c49e65e87bed343dd2d045457341e42114
+SHA1 (patch-filter_filter__resample.c) = 9e8176070682984b4f7f0cc29d21437ff5ba4710
 SHA1 (patch-filter_subtitler_load_font.c) = 2c496c63f4fe27190761d170cc825633eb63c11f
-SHA1 (patch-import_decode_lavc.c) = adf9274c5085012adcfeeb2f2366600155f0994c
+SHA1 (patch-import_decode_lavc.c) = 37c172b40858028592ced6a35f19fdd2873a07c6
 SHA1 (patch-import_import__im.c) = 30fdb4ce905c0bdd959964b1455f31823b681e9e
 SHA1 (patch-import_import__imlist.c) = 677ffc2c4ed48ab1e9f4f3f4a28f53b368ae7651
-SHA1 (patch-import_import_ffmpeg.c) = bbbbdec6a1c20a9c02a1e2ef4cca10919eb2854c
+SHA1 (patch-import_import_ffmpeg.c) = 601ff0f67727c7dc3bdad8c5c43a8b8b4baae5ea
 SHA1 (patch-import_nuv_import__nuv.c) = e4a57c29b97b23aed068c06a2ed29dd9e29a9919
-SHA1 (patch-import_probe_ffmpeg.c) = 6bbf65b513e999ac770bafc6aa9b508bfdb5ae15
+SHA1 (patch-import_probe_ffmpeg.c) = eabbdbc2ffad5da51cb77547ac6a3f92c7bafcdb
 SHA1 (patch-import_probe_im.c) = 27bce069c78e5eee94c14d3f5f03cc14145f85ac
 SHA1 (patch-libtc_tcavcodec.h) = 6fcef1e338e53c974b295b1a10b2cb06e6fcfbd3
diff -r 3f00de5d8162 -r d8a53ca81ba2 multimedia/transcode/patches/patch-encode_encode_lavc.c
--- a/multimedia/transcode/patches/patch-encode_encode_lavc.c   Sun Dec 29 10:15:04 2019 +0000
+++ b/multimedia/transcode/patches/patch-encode_encode_lavc.c   Sun Dec 29 10:23:53 2019 +0000
@@ -1,20 +1,27 @@
-$NetBSD: patch-encode_encode_lavc.c,v 1.2 2015/11/21 17:14:26 adam Exp $
+$NetBSD: patch-encode_encode_lavc.c,v 1.3 2019/12/29 10:23:53 markd Exp $
 
-Fixes building against FFmpeg version >= 2.0.0 (gentoo patch).
+Fixes building against FFmpeg version >= 4.0.0 (gentoo patch).
 
 --- encode/encode_lavc.c.orig  2011-11-19 16:50:27.000000000 +0000
 +++ encode/encode_lavc.c
-@@ -74,6 +74,9 @@ struct tclavcconfigdata_ {
+@@ -74,6 +74,16 @@ struct tclavcconfigdata_ {
      int lmin;
      int lmax;
      int me_method;
 +    int luma_elim_threshold;
 +    int chroma_elim_threshold;
 +    int quantizer_noise_shaping;
++    int inter_quant_bias;
++    int intra_quant_bias;
++    int scenechange_factor;
++    int rc_strategy;
++    float rc_initial_cplx;
++    float rc_qsquish;
++    float border_masking;
  
      /* same as above for flags */
      struct {
-@@ -114,6 +117,7 @@ struct tclavcprivatedata_ {
+@@ -114,6 +124,7 @@ struct tclavcprivatedata_ {
  
      AVFrame ff_venc_frame;
      AVCodecContext ff_vcontext;
@@ -22,7 +29,7 @@
  
      AVCodec *ff_vcodec;
  
-@@ -164,6 +168,7 @@ static const TCCodecID tc_lavc_codecs_ou
+@@ -164,6 +175,7 @@ static const TCCodecID tc_lavc_codecs_ou
      TC_CODEC_ERROR
  };
  
@@ -30,7 +37,7 @@
  static const enum CodecID tc_lavc_internal_codecs[] = {
      CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO, CODEC_ID_MPEG4,
      CODEC_ID_H263I, CODEC_ID_H263P,
-@@ -176,6 +181,20 @@ static const enum CodecID tc_lavc_intern
+@@ -176,6 +188,20 @@ static const enum CodecID tc_lavc_intern
      CODEC_ID_MSMPEG4V2, CODEC_ID_MSMPEG4V3,
      CODEC_ID_NONE
  };
@@ -51,7 +58,120 @@
  
  static const TCFormatID tc_lavc_formats[] = { TC_FORMAT_ERROR };
  
-@@ -937,7 +956,11 @@ static int tc_lavc_settings_from_vob(TCL
+@@ -214,7 +240,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);
+ }
+ 
+@@ -228,7 +254,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,
+@@ -244,7 +270,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,
+@@ -256,7 +282,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);
+ 
+ }
+@@ -266,7 +292,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,
+@@ -591,21 +617,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 {
+@@ -615,10 +641,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:
+@@ -665,7 +691,7 @@ static int tc_lavc_init_multipass(TCLavc
+     switch (vob->divxmultipass) {
+       case 1:
+         CAN_DO_MULTIPASS(multipass_flag);
+-        pd->ff_vcontext.flags |= CODEC_FLAG_PASS1;
++        pd->ff_vcontext.flags |= AV_CODEC_FLAG_PASS1;
+         pd->stats_file = fopen(vob->divxlogfile, "w");
+         if (pd->stats_file == NULL) {
+             tc_log_error(MOD_NAME, "could not create 2pass log file"
+@@ -675,7 +701,7 @@ static int tc_lavc_init_multipass(TCLavc
+         break;
+       case 2:
+         CAN_DO_MULTIPASS(multipass_flag);
+-        pd->ff_vcontext.flags |= CODEC_FLAG_PASS2;
++        pd->ff_vcontext.flags |= AV_CODEC_FLAG_PASS2;
+         pd->stats_file = fopen(vob->divxlogfile, "r");
+         if (pd->stats_file == NULL){
+             tc_log_error(MOD_NAME, "could not open 2pass log file \"%s\""
+@@ -704,7 +730,7 @@ static int tc_lavc_init_multipass(TCLavc
+         break;
+       case 3:
+         /* fixed qscale :p */
+-        pd->ff_vcontext.flags |= CODEC_FLAG_QSCALE;
++        pd->ff_vcontext.flags |= AV_CODEC_FLAG_QSCALE;
+         pd->ff_venc_frame.quality = vob->divxbitrate;
+         break;
+     }
+@@ -937,7 +963,11 @@ static int tc_lavc_settings_from_vob(TCL
  static void tc_lavc_config_defaults(TCLavcPrivateData *pd)
  {
      /* first of all reinitialize lavc data */
@@ -63,7 +183,16 @@
  
      pd->confdata.thread_count = 1;
  
-@@ -955,8 +978,6 @@ static void tc_lavc_config_defaults(TCLa
+@@ -947,7 +977,7 @@ static void tc_lavc_config_defaults(TCLa
+     pd->confdata.rc_buffer_size  = 0;
+     pd->confdata.lmin            = 2;
+     pd->confdata.lmax            = 31;
+-    pd->confdata.me_method       = ME_EPZS;
++    pd->confdata.me_method       = 0;
+ 
+     memset(&pd->confdata.flags, 0, sizeof(pd->confdata.flags));
+     pd->confdata.turbo_setup = 0;
+@@ -955,19 +985,17 @@ static void tc_lavc_config_defaults(TCLa
      /* 
       * context *transcode* (not libavcodec) defaults
       */
@@ -72,35 +201,80 @@
      pd->ff_vcontext.max_qdiff               = 3;
      pd->ff_vcontext.max_b_frames            = 0;
      pd->ff_vcontext.me_range                = 0;
-@@ -977,8 +998,8 @@ static void tc_lavc_config_defaults(TCLa
+     pd->ff_vcontext.mb_decision             = 0;
+     pd->ff_vcontext.scenechange_threshold   = 0;
+-    pd->ff_vcontext.scenechange_factor      = 1;
++    pd->confdata.scenechange_factor         = 1;
+     pd->ff_vcontext.b_frame_strategy        = 0;
+     pd->ff_vcontext.b_sensitivity           = 40;
+     pd->ff_vcontext.brd_scale               = 0;
+     pd->ff_vcontext.bidir_refine            = 0;
+-    pd->ff_vcontext.rc_strategy             = 2;
++    pd->confdata.rc_strategy                = 2;
+     pd->ff_vcontext.b_quant_factor          = 1.25;
+     pd->ff_vcontext.i_quant_factor          = 0.8;
+     pd->ff_vcontext.b_quant_offset          = 1.25;
+@@ -975,10 +1003,10 @@ static void tc_lavc_config_defaults(TCLa
+     pd->ff_vcontext.qblur                   = 0.5;
+     pd->ff_vcontext.qcompress               = 0.5;
      pd->ff_vcontext.mpeg_quant              = 0;
-     pd->ff_vcontext.rc_initial_cplx         = 0.0;
-     pd->ff_vcontext.rc_qsquish              = 1.0;
+-    pd->ff_vcontext.rc_initial_cplx         = 0.0;
+-    pd->ff_vcontext.rc_qsquish              = 1.0;
 -    pd->ff_vcontext.luma_elim_threshold     = 0;
 -    pd->ff_vcontext.chroma_elim_threshold   = 0;
++    pd->confdata.rc_initial_cplx            = 0.0;
++    pd->confdata.rc_qsquish              = 1.0;
 +    pd->confdata.luma_elim_threshold     = 0;
 +    pd->confdata.chroma_elim_threshold   = 0;
      pd->ff_vcontext.strict_std_compliance   = 0;
      pd->ff_vcontext.dct_algo                = FF_DCT_AUTO;
      pd->ff_vcontext.idct_algo               = FF_IDCT_AUTO;
-@@ -1002,7 +1023,7 @@ static void tc_lavc_config_defaults(TCLa
-     pd->ff_vcontext.intra_quant_bias        = FF_DEFAULT_QUANT_BIAS;
-     pd->ff_vcontext.inter_quant_bias        = FF_DEFAULT_QUANT_BIAS;
+@@ -987,7 +1015,7 @@ static void tc_lavc_config_defaults(TCLa
+     pd->ff_vcontext.temporal_cplx_masking   = 0.0;
+     pd->ff_vcontext.spatial_cplx_masking    = 0.0;
+     pd->ff_vcontext.p_masking               = 0.0;
+-    pd->ff_vcontext.border_masking          = 0.0;
++    pd->confdata.border_masking          = 0.0;
+     pd->ff_vcontext.me_pre_cmp              = 0;



Home | Main Index | Thread Index | Old Index