diff options
author | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-04-14 23:48:32 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-04-15 07:50:43 +0700 |
commit | e245c8cc67c789567bc2f37c9e438703f785d7aa (patch) | |
tree | 0d71cf965ac5ac03ccd03fae3f4cdaf4d25d53ff /multimedia/cinelerra | |
parent | c12a3dcc11a93bd4a8852c4889c371a83cd1cb5d (diff) |
multimedia/cinelerra: Remove external ffmpeg support.
We are still waiting for fully ffmpeg 3 support.
Until then, we will go with internal ffmpeg only.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'multimedia/cinelerra')
-rw-r--r-- | multimedia/cinelerra/README | 8 | ||||
-rw-r--r-- | multimedia/cinelerra/cinelerra.SlackBuild | 36 | ||||
-rw-r--r-- | multimedia/cinelerra/cinelerra.info | 2 | ||||
-rw-r--r-- | multimedia/cinelerra/patches/cinelerra-cv-ffmpeg2.0.patch | 98 | ||||
-rw-r--r-- | multimedia/cinelerra/patches/cinelerra-cv-ffmpeg_api2.2.patch | 200 |
5 files changed, 9 insertions, 335 deletions
diff --git a/multimedia/cinelerra/README b/multimedia/cinelerra/README index f1f7982528ac..3ddd60f57e9a 100644 --- a/multimedia/cinelerra/README +++ b/multimedia/cinelerra/README @@ -3,11 +3,3 @@ cinelerra (GNU/Linux Video/Audio Studio) Cinelerra CV is the most advanced non-linear video editor and compositor for Linux. It does primarily 3 main things: capturing, compositing, and editing audio and video with sample level accuracy. - -NOTE: Patches for ffmpeg-2.x from the official website are included in -this SlackBuild. These patches work for the most part, but in various -cases (like loading multiple DNxHD files) they make the program very -unstable. - -If you still want to build with ffmpeg-2.x, pass "EXTERNALFFMPEG=yes" -on the command line. diff --git a/multimedia/cinelerra/cinelerra.SlackBuild b/multimedia/cinelerra/cinelerra.SlackBuild index de42bbd6b51a..dfc6c9308cda 100644 --- a/multimedia/cinelerra/cinelerra.SlackBuild +++ b/multimedia/cinelerra/cinelerra.SlackBuild @@ -23,13 +23,14 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=cinelerra -VERSION=${VERSION:-cv_2.3} +SRCNAM=CinelerraCV +VERSION=${VERSION:-2.3} BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) ARCH=i486 ;; + i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac @@ -40,8 +41,8 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" @@ -60,27 +61,14 @@ else mmx="--enable-mmx" fi -# Patches for ffmpeg-2.x exist on the official website. -# While testing, the patches work for the most part, but -# in various cases (like loading multiple DNxHD files) -# they make the program very unstable. -# Defaulting to internal ffmpeg because of this. -EXTERNALFFMPEG=${EXTERNALFFMPEG:-no} - -if [ "$EXTERNALFFMPEG" = "no" ]; then - externalffmpeg="" -elif [ "$EXTERNALFFMPEG" = "yes" ]; then - externalffmpeg="--with-external-ffmpeg" -fi - set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf CinelerraCV-2.3 -tar xvf $CWD/CinelerraCV-2.3.tar.xz -cd CinelerraCV-2.3 +rm -rf $SRCNAM-$VERSION +tar xvf $CWD/$SRCNAM-$VERSION.tar.xz +cd $SRCNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -88,14 +76,7 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -if [ "$EXTERNALFFMPEG" = "yes" ]; then -# Patches (from the official website) for compatibility with ffmpeg-2.x -patch -p1 < $CWD/patches/cinelerra-cv-ffmpeg_api2.2.patch -patch -p1 < $CWD/patches/cinelerra-cv-ffmpeg2.0.patch -fi - ./autogen.sh - LDFLAGS="-ldl" \ CFLAGS="$SLKCFLAGS -D__STDC_CONSTANT_MACROS" \ CXXFLAGS="$SLKCFLAGS -D__STDC_CONSTANT_MACROS" \ @@ -111,7 +92,6 @@ CXXFLAGS="$SLKCFLAGS -D__STDC_CONSTANT_MACROS" \ --with-x \ --enable-opengl \ --build=$ARCH-slackware-linux \ - $externalffmpeg \ $mmx make diff --git a/multimedia/cinelerra/cinelerra.info b/multimedia/cinelerra/cinelerra.info index a825f18eb5c5..5e014f267714 100644 --- a/multimedia/cinelerra/cinelerra.info +++ b/multimedia/cinelerra/cinelerra.info @@ -1,5 +1,5 @@ PRGNAM="cinelerra" -VERSION="cv_2.3" +VERSION="2.3" HOMEPAGE="http://cinelerra-cv.org/" DOWNLOAD="http://www.cinelerra-cv.org/releases/CinelerraCV-2.3.tar.xz" MD5SUM="a1e7bfaf9827f74900d58d25955bdf3f" diff --git a/multimedia/cinelerra/patches/cinelerra-cv-ffmpeg2.0.patch b/multimedia/cinelerra/patches/cinelerra-cv-ffmpeg2.0.patch deleted file mode 100644 index b1e0324ba3a1..000000000000 --- a/multimedia/cinelerra/patches/cinelerra-cv-ffmpeg2.0.patch +++ /dev/null @@ -1,98 +0,0 @@ -diff --git a/cinelerra/ffmpeg.C b/cinelerra/ffmpeg.C -index b762d46..53ad7a1 100644 ---- a/cinelerra/ffmpeg.C -+++ b/cinelerra/ffmpeg.C -@@ -32,9 +32,9 @@ int FFMPEG::init(char *codec_string) { - return 1; - } - -- context = avcodec_alloc_context(); -+ context = avcodec_alloc_context3(codec); - -- if (avcodec_open(context, codec)) { -+ if (avcodec_open2(context, codec,NULL)) { - printf("FFMPEG::init avcodec_open() failed\n"); - } - -diff --git a/cinelerra/fileac3.C b/cinelerra/fileac3.C -index e56705f..119c2d5 100644 ---- a/cinelerra/fileac3.C -+++ b/cinelerra/fileac3.C -@@ -91,11 +91,11 @@ int FileAC3::open_file(int rd, int wr) - eprintf("codec not found.\n"); - return 1; - } -- codec_context = avcodec_alloc_context(); -+ codec_context = avcodec_alloc_context3(codec); - codec_context->bit_rate = asset->ac3_bitrate * 1000; - codec_context->sample_rate = asset->sample_rate; - codec_context->channels = asset->channels; -- if(avcodec_open(codec_context, codec)) -+ if(avcodec_open2(codec_context, codec,NULL)) - { - eprintf("failed to open codec.\n"); - return 1; -diff --git a/quicktime/mpeg4.c b/quicktime/mpeg4.c -index 67bcab8..d78055e 100644 ---- a/quicktime/mpeg4.c -+++ b/quicktime/mpeg4.c -@@ -640,7 +640,7 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track) - return 1; - } - -- codec->encoder_context[current_field] = avcodec_alloc_context(); -+ codec->encoder_context[current_field] = avcodec_alloc_context3(codec->encoder[current_field]); - AVCodecContext *context = codec->encoder_context[current_field]; - - context->width = width_i; -@@ -736,7 +736,7 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track) - * codec->fix_bitrate, - * codec->quantizer); - */ -- avcodec_open(context, codec->encoder[current_field]); -+ avcodec_open2(context, codec->encoder[current_field],NULL); - - avcodec_get_frame_defaults(&codec->picture[current_field]); - -diff --git a/quicktime/qtffmpeg.c b/quicktime/qtffmpeg.c -index c808da7..522d23c 100644 ---- a/quicktime/qtffmpeg.c -+++ b/quicktime/qtffmpeg.c -@@ -67,7 +67,9 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg(int cpus, - return 0; - } - -- AVCodecContext *context = ptr->decoder_context[i] = avcodec_alloc_context(); -+ //AVCodecContext *context = ptr->decoder_context[i] = avcodec_alloc_context(); -+ AVCodecContext *context = avcodec_alloc_context3(ptr->decoder[i]); -+ ptr->decoder_context[i] = context; - static char fake_data[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; - context->width = ptr->width_i; - context->height = ptr->height_i; -@@ -93,8 +95,7 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg(int cpus, - { - context->thread_count = cpus; - } -- if(avcodec_open(context, -- ptr->decoder[i]) < 0) -+ if(avcodec_open2(context, ptr->decoder[i], NULL) < 0) - { - printf("quicktime_new_ffmpeg: avcodec_open failed.\n"); - quicktime_delete_ffmpeg(ptr); -diff --git a/quicktime/wma.c b/quicktime/wma.c -index f38bdce..4be0274 100644 ---- a/quicktime/wma.c -+++ b/quicktime/wma.c -@@ -76,10 +76,10 @@ static int init_decode(quicktime_audio_map_t *track_map, - printf("init_decode: avcodec_find_decoder returned NULL.\n"); - return 1; - } -- codec->decoder_context = avcodec_alloc_context(); -+ codec->decoder_context = avcodec_alloc_context3(codec->decoder); - codec->decoder_context->sample_rate = trak->mdia.minf.stbl.stsd.table[0].sample_rate; - codec->decoder_context->channels = track_map->channels; -- if(avcodec_open(codec->decoder_context, codec->decoder) < 0) -+ if(avcodec_open2(codec->decoder_context, codec->decoder,NULL) < 0) - { - printf("init_decode: avcodec_open failed.\n"); - return 1; diff --git a/multimedia/cinelerra/patches/cinelerra-cv-ffmpeg_api2.2.patch b/multimedia/cinelerra/patches/cinelerra-cv-ffmpeg_api2.2.patch deleted file mode 100644 index 2def7089b2b1..000000000000 --- a/multimedia/cinelerra/patches/cinelerra-cv-ffmpeg_api2.2.patch +++ /dev/null @@ -1,200 +0,0 @@ -diff --git a/cinelerra/ffmpeg.C b/cinelerra/ffmpeg.C -index 6ab6047..b762d46 100644 ---- a/cinelerra/ffmpeg.C -+++ b/cinelerra/ffmpeg.C -@@ -2,7 +2,7 @@ - - #ifdef HAVE_SWSCALER - extern "C" { --#include <swscale.h> -+#include <libswscale/swscale.h> - } - #endif - -@@ -23,10 +23,9 @@ FFMPEG::FFMPEG(Asset *asset) { - - int FFMPEG::init(char *codec_string) { - -- avcodec_init(); - avcodec_register_all(); - -- CodecID id = codec_id(codec_string); -+ AVCodecID id = codec_id(codec_string); - codec = avcodec_find_decoder(id); - if (codec == NULL) { - printf("FFMPEG::init no decoder for '%s'", codec_string); -@@ -52,7 +51,7 @@ FFMPEG::~FFMPEG() { - } - - --CodecID FFMPEG::codec_id(char *codec_string) { -+AVCodecID FFMPEG::codec_id(char *codec_string) { - #define CODEC_IS(x) (! strncmp(codec_string, x, 4)) - - if (CODEC_IS(QUICKTIME_DV) || -@@ -364,12 +363,15 @@ int FFMPEG::decode(uint8_t *data, long data_size, VFrame *frame_out) { - - // NOTE: frame must already have data space allocated - -+ AVPacket pkt; - got_picture = 0; -- int length = avcodec_decode_video(context, -+ av_init_packet( &pkt ); -+ pkt.data = data; -+ pkt.size = data_size; -+ int length = avcodec_decode_video2(context, - picture, - &got_picture, -- data, -- data_size); -+ &pkt); - - if (length < 0) { - printf("FFMPEG::decode error decoding frame\n"); -diff --git a/cinelerra/ffmpeg.h b/cinelerra/ffmpeg.h -index 69c9956..dc7174e 100644 ---- a/cinelerra/ffmpeg.h -+++ b/cinelerra/ffmpeg.h -@@ -26,7 +26,7 @@ class FFMPEG - static int convert_cmodel_transfer(VFrame *frame_in,VFrame *frame_out); - static int init_picture_from_frame(AVPicture *picture, VFrame *frame); - -- static CodecID codec_id(char *codec_string); -+ static AVCodecID codec_id(char *codec_string); - - private: - static PixelFormat color_model_to_pix_fmt(int color_model); -diff --git a/cinelerra/fileac3.C b/cinelerra/fileac3.C -index a1ef61e..e56705f 100644 ---- a/cinelerra/fileac3.C -+++ b/cinelerra/fileac3.C -@@ -84,7 +84,6 @@ int FileAC3::open_file(int rd, int wr) - - if(wr) - { -- avcodec_init(); - avcodec_register_all(); - codec = avcodec_find_encoder(CODEC_ID_AC3); - if(!codec) -diff --git a/quicktime/mpeg4.c b/quicktime/mpeg4.c -index 81cb72b..67bcab8 100644 ---- a/quicktime/mpeg4.c -+++ b/quicktime/mpeg4.c -@@ -629,7 +629,6 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track) - if(!ffmpeg_initialized) - { - ffmpeg_initialized = 1; -- avcodec_init(); - avcodec_register_all(); - } - -@@ -674,7 +673,7 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track) - #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) - context->error_resilience = FF_ER_CAREFUL; - #else -- context->error_recognition = FF_ER_CAREFUL; -+ context->err_recognition = AV_EF_CRCCHECK; - #endif - context->error_concealment = 3; - context->frame_skip_cmp = FF_CMP_DCTMAX; -@@ -699,7 +698,6 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track) - context->profile= FF_PROFILE_UNKNOWN; - context->rc_buffer_aggressivity = 1.0; - context->level= FF_LEVEL_UNKNOWN; -- context->flags |= CODEC_FLAG_H263P_UMV; - context->flags |= CODEC_FLAG_AC_PRED; - - // All the forbidden settings can be extracted from libavcodec/mpegvideo.c of ffmpeg... -@@ -717,10 +715,8 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track) - (codec->ffmpeg_id == CODEC_ID_MPEG4 || - codec->ffmpeg_id == CODEC_ID_MPEG1VIDEO || - codec->ffmpeg_id == CODEC_ID_MPEG2VIDEO || -- codec->ffmpeg_id == CODEC_ID_H263P || -- codec->ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT)) -+ codec->ffmpeg_id == CODEC_ID_H263P)) - { -- avcodec_thread_init(context, file->cpus); - context->thread_count = file->cpus; - } - -diff --git a/quicktime/qtffmpeg.c b/quicktime/qtffmpeg.c -index b384a83..c808da7 100644 ---- a/quicktime/qtffmpeg.c -+++ b/quicktime/qtffmpeg.c -@@ -54,7 +54,6 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg(int cpus, - if(!ffmpeg_initialized) - { - ffmpeg_initialized = 1; -- avcodec_init(); - avcodec_register_all(); - } - -@@ -90,10 +89,8 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg(int cpus, - (ffmpeg_id == CODEC_ID_MPEG4 || - ffmpeg_id == CODEC_ID_MPEG1VIDEO || - ffmpeg_id == CODEC_ID_MPEG2VIDEO || -- ffmpeg_id == CODEC_ID_H263P || -- ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT)) -+ ffmpeg_id == CODEC_ID_H263P)) - { -- avcodec_thread_init(context, cpus); - context->thread_count = cpus; - } - if(avcodec_open(context, -@@ -183,6 +180,7 @@ static int decode_wrapper(quicktime_t *file, - - if(!result) - { -+ AVPacket pkt; - - - // No way to determine if there was an error based on nonzero status. -@@ -191,11 +189,13 @@ static int decode_wrapper(quicktime_t *file, - ffmpeg->decoder_context[current_field]->skip_frame = AVDISCARD_NONREF /* AVDISCARD_BIDIR */; - else - ffmpeg->decoder_context[current_field]->skip_frame = AVDISCARD_DEFAULT; -- result = avcodec_decode_video(ffmpeg->decoder_context[current_field], -+ av_init_packet( &pkt ); -+ pkt.data = ffmpeg->work_buffer; -+ pkt.size = bytes + header_bytes; -+ result = avcodec_decode_video2(ffmpeg->decoder_context[current_field], - &ffmpeg->picture[current_field], - &got_picture, -- ffmpeg->work_buffer, -- bytes + header_bytes); -+ &pkt); - - - -diff --git a/quicktime/wma.c b/quicktime/wma.c -index c045741..f38bdce 100644 ---- a/quicktime/wma.c -+++ b/quicktime/wma.c -@@ -67,7 +67,6 @@ static int init_decode(quicktime_audio_map_t *track_map, - if(!ffmpeg_initialized) - { - ffmpeg_initialized = 1; -- avcodec_init(); - avcodec_register_all(); - } - -@@ -194,12 +193,16 @@ printf("decode 2 %x %llx %llx\n", chunk_size, chunk_offset, chunk_offset + chunk - codec->packet_buffer, - chunk_size); - #else -+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 - bytes_decoded = AVCODEC_MAX_AUDIO_FRAME_SIZE; -- result = avcodec_decode_audio2(codec->decoder_context, -+ AVPacket pkt; -+ av_init_packet( &pkt ); -+ pkt.data = codec->packet_buffer; -+ pkt.size = chunk_size; -+ result = avcodec_decode_audio3(codec->decoder_context, - (int16_t*)(codec->work_buffer + codec->output_size * sample_size), - &bytes_decoded, -- codec->packet_buffer, -- chunk_size); -+ &pkt); - #endif - - pthread_mutex_unlock(&ffmpeg_lock); |