Article 6JCWM Report on MEGAsync-4.9.1.0 package against FFmpeg-6.1.1

Report on MEGAsync-4.9.1.0 package against FFmpeg-6.1.1

by
J_W
from LinuxQuestions.org on (#6JCWM)
Hi, all

This is just an information for MEDAsync desktop application user in Slackware community.
I'll report that I've had successfully compiled MEGAsync-4.9.1.0_Linux under FFmpeg-6.1.1 environment and confirmed it works fine on slackware64-current env..

My SlackBuild and necessary patches I used are below.

sources:
MEGAsync-4.9.1.0_Linux.tar.gz
sdk-4.16.0c.tar.gz
megasync-4.5.0.0_pdfium.patch (same as MEGAsync-4.5.3.0_Linux's SBo)
megasync-4.9.1.0_ffmpeg6.patch

Diff of SlackBuild:
Code:--- MEGAsync.SlackBuild 2022-03-11 14:34:39.000000000 +0900
+++ MEGAsync.SlackBuild.new 2024-02-05 21:46:00.262557812 +0900
@@ -26,8 +26,8 @@
cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=MEGAsync
-VERSION=${VERSION:-4.5.3.0}
-SDK=${SDK:-3.8.2c}
+VERSION=${VERSION:-4.9.1.0}
+SDK=${SDK:-4.16.0c}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -83,7 +83,7 @@
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

-patch -p1 < $CWD/megasync-4.5.0.0_ffmpeg.patch
+patch -p1 < $CWD/megasync-4.9.1.0_ffmpeg6.patch
cd src/MEGASync/mega
patch -p1 < $CWD/megasync-4.5.0.0_pdfium.patchDiff of MEGAsync.info:
Code:--- MEGAsync.info 2022-03-11 14:34:39.000000000 +0900
+++ MEGAsync.info.new 2024-02-05 21:45:35.869499892 +0900
@@ -1,12 +1,12 @@
PRGNAM="MEGAsync"
-VERSION="4.5.3.0"
+VERSION="4.9.1.0"
HOMEPAGE="https://github.com/meganz/MEGAsync/"
-DOWNLOAD="https://github.com/meganz/MEGAsync/archive/v4.5.3.0_Linux/MEGAsync-4.5.3.0_Linux.tar.gz \
- https://github.com/meganz/sdk/archive/v3.8.2c/sdk-3.8.2c.tar.gz"
-MD5SUM="be0f1e070b6990c19d766990758ef997 \
- ded79c86d1ddbe2572f0562fa1dc15fc"
+DOWNLOAD="https://github.com/meganz/MEGAsync/archive/v4.9.1.0_Linux/MEGAsync-4.9.1.0_Linux.tar.gz \
+ https://github.com/meganz/sdk/archive/v4.16.0c/sdk-4.16.0c.tar.gz"
+MD5SUM="be9fca6eee9bad9de2f8999bec51ccbb \
+ b8c50f486602b2a8af4866d098cae303"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="FreeImage libmediainfo"
-MAINTAINER="Felipe Bugno"
-EMAIL="capent@yahoo.com"
+MAINTAINER=""
+EMAIL=""megasync-4.9.1.0_ffmpeg6.patch:
Code:--- a/src/MEGASync/mega/src/gfx/freeimage.cpp 2024-02-05 12:31:08.907475460 +0900
+++ b/src/MEGASync/mega/src/gfx/freeimage.cpp 2024-02-05 13:38:52.356174823 +0900
@@ -209,11 +209,13 @@

#ifdef HAVE_FFMPEG

+#if LIBAVCODEC_VERSION_MAJOR < 60
#ifdef AV_CODEC_CAP_TRUNCATED
#define CAP_TRUNCATED AV_CODEC_CAP_TRUNCATED
#else
#define CAP_TRUNCATED CODEC_CAP_TRUNCATED
#endif
+#endif

const char *GfxProviderFreeImage::supportedformatsFfmpeg()
{
@@ -313,7 +315,7 @@

// Find decoder for video stream
AVCodecID codecId = codecParm->codec_id;
- AVCodec* decoder = avcodec_find_decoder(codecId);
+ auto decoder = avcodec_find_decoder(codecId);
if (!decoder)
{
LOG_warn << "Codec not found: " << codecId;
@@ -330,11 +332,13 @@

// Force seeking to key frames
formatContext->seek2any = false;
- videoStream->skip_to_keyframe = true;
+ //videoStream->skip_to_keyframe = true;
+ #if LIBAVCODEC_VERSION_MAJOR < 60
if (decoder->capabilities & CAP_TRUNCATED)
{
codecContext->flags |= CAP_TRUNCATED;
}
+ #endif

AVPixelFormat sourcePixelFormat = static_cast<AVPixelFormat>(codecParm->format);
AVPixelFormat targetPixelFormat = AV_PIX_FMT_BGR24; //raw data expected by freeimage is in this format[reminder]
The target of this patch is "freeimage.cpp" file which is included sdk-4.16.0c.tar.gz.
So, if user wants to use other version of sdk, this patch might not be applied correctly in most case.

Hope, this would help for someone.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments