Recherche avancée

Médias (91)

Autres articles (78)

  • Diogene : création de masques spécifiques de formulaires d’édition de contenus

    26 octobre 2010, par

    Diogene est un des plugins ? SPIP activé par défaut (extension) lors de l’initialisation de MediaSPIP.
    A quoi sert ce plugin
    Création de masques de formulaires
    Le plugin Diogène permet de créer des masques de formulaires spécifiques par secteur sur les trois objets spécifiques SPIP que sont : les articles ; les rubriques ; les sites
    Il permet ainsi de définir en fonction d’un secteur particulier, un masque de formulaire par objet, ajoutant ou enlevant ainsi des champs afin de rendre le formulaire (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Utilisation et configuration du script

    19 janvier 2011, par

    Informations spécifiques à la distribution Debian
    Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
    Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
    Récupération du script
    Le script d’installation peut être récupéré de deux manières différentes.
    Via svn en utilisant la commande pour récupérer le code source à jour :
    svn co (...)

Sur d’autres sites (5603)

  • Uploading video to Twitter sometimes doesn't work

    22 juillet 2021, par K-s S-k

    I have a very difficult situation. I've already spent 2 days and couldn't find a solution. Project on Laravel. I want to upload videos to Twitter using the Twitter API endpoints. But sometimes I am getting this error :

    


    


    file is currently unsupported

    


    


    I did everything as recommended in the official documentation Video specifications and recommendations. I get an error when I set an audio codec is aac in my video file, despite the fact that it is recommended in the official documentation, but when I set the audio codec to mp3, the video is uploaded, but the sound quality is very poor, and sometimes there is no sound at all. Please forgive me if this is awkward to read, but I want to provide all of my code. Because I don't know how to solve this anymore and I think it might help.

    


    <?php

namespace App\Jobs;

use App\Models\PublishedContent;
use Atymic\Twitter\Facades\Twitter;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Bus\Queueable;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\File;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Support\Str;


class PublishToTwitter implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * @var
     */
    protected $publishingData;

    /**
     * Create a new job instance.
     *
     * @param $publishingData
     */
    public function __construct($publishingData)
    {
        $this->publishingData = $publishingData;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $publishingData = $this->publishingData;

        if (is_array($publishingData)) {
            $publishingResult = $this->publishing(...array_values($publishingData));
            sendNotification($publishingResult['message'], $publishingResult['status'], 'Twitter', $publishingResult['link'], $publishingData['post_name'], $publishingData['user']);
        } else {
            $scheduledData = processingScheduledPost($publishingData);
            $postName = $scheduledData['scheduleData']['post_name'];
            $postContent = $scheduledData['scheduleData']['post_content'];
            $userToken = json_decode($publishingData->user_token,true);
            $requestToken = [
                'token'  => $userToken['oauth_token'],
                'secret' => $userToken['oauth_token_secret'],
            ];
            $publishingResult = $this->publishing($scheduledData['file'], $postName, $postContent, $requestToken);
            $publishingResult['status'] && PublishedContent::add($scheduledData['craft'], $scheduledData['file'], "twitter_share");
            sendResultToUser($publishingData, $scheduledData['user'], $publishingResult['message'], $postName, $publishingResult['link'], $publishingResult['publishing_status'], $scheduledData['social_media']);
            sendNotification($publishingResult['message'], $publishingResult['status'], 'Twitter', $publishingResult['link'], $postName, $scheduledData['user']);
        }
    }

    /**
     * @param $file
     * @param $postName
     * @param $postContent
     * @param $requestToken
     * @return array
     */
    private function publishing($file, $postName, $postContent, $requestToken): array
    {
        $result = [
            'status' => false,
            'link' => null,
            'message' => 'Your content can\'t successfully published on Twitter. This file is not supported for publishing.',
            'publishing_status' => 'error'
        ];

        if ((($file->refe_type !== 'text') || $file->refe_file_path) && !checkIfFileExist($file->refe_file_path)) {
            $result['message'] = 'Missing or invalid file.';
            return $result;
        }

        $filePath = $file->refe_file_path;
        $fileSize = $file->content_length;
        $tempFileName = 'temp-' . $file->refe_file_name;
        $ext = $file->file_type;
        $mediaCategory = 'tweet_' . $file->refe_type;
        $mediaType = $file->refe_type . '/' . $ext;
        $remoteFile = file_get_contents($filePath);
        $tempFolder = public_path('/storage/uploads/temp');

        if (!file_exists($tempFolder)) {
            mkdir($tempFolder, 0777, true);
        }

        $tempFile = public_path('/storage/uploads/temp/' . $tempFileName);
        File::put($tempFile, $remoteFile);
        $convertedFileName = 'converted-' . $file->refe_file_name;
        $convertedFile = public_path('/storage/uploads/temp/' . $convertedFileName);
        $command = 'ffmpeg -y -i '.$tempFile.' -b:v 5000k -b:a 380k -c:a aac -profile:a aac_low -threads 1 '.$convertedFile.'';
        exec($command);
        @File::delete($tempFile);

        try {
            $twitter = Twitter::usingCredentials($requestToken['token'], $requestToken['secret']);
            if ($file->refe_type === 'text') {
                $twitter->postTweet([
                    'status' => urldecode($postContent),
                    'format' => 'json',
                ]);

                $result['link'] = 'https://twitter.com/home';
                $result['status'] = true;
                $result['message'] = 'Your content successfully published on Twitter. You can visit to Twitter and check it.';
                $result['publishing_status'] = 'done';
            } else if ($file->refe_type === 'video' || $file->refe_type === 'image') {
                if ($file->refe_type === 'video') {
                    $duration = getVideoDuration($file->refe_file_path);

                    if ($duration > config('constant.sharing_configs.max_video_duration.twitter')) {
                        throw new \Exception('The duration of the video file must not exceed 140 seconds.');
                    }
                }

                $isFileTypeSupported = checkPublishedFileType('twitter', $file->refe_type, strtolower($ext));
                $isFileSizeSupported = checkPublishedFileSize('twitter', $file->refe_type, $fileSize, strtolower($ext));

                if (!$isFileTypeSupported) {
                    throw new \Exception('Your content can\'t successfully published on Twitter. This file type is not supported for publishing.');
                }

                if (!$isFileSizeSupported) {
                    throw new \Exception('Your content can\'t successfully published on Twitter. The file size is exceeded.');
                }

                if ($file->refe_type === 'video') $fileSize = filesize($convertedFile);

                if (strtolower($ext) === 'gif') {
                    $initMedia = $twitter->uploadMedia([
                        'command' => 'INIT',
                        'total_bytes' => (int)$fileSize
                    ]);
                } else {
                    $initMedia = $twitter->uploadMedia([
                        'command' => 'INIT',
                        'media_type' => $mediaType,
                        'media_category' => $mediaCategory,
                        'total_bytes' => (int)$fileSize
                    ]);
                }

                $mediaId = (int)$initMedia->media_id_string;

                $fp = fopen($convertedFile, 'r');
                $segmentId = 0;

                while (!feof($fp)) {
                    $chunk = fread($fp, 1048576);

                    $twitter->uploadMedia([
                        'media_data' => base64_encode($chunk),
                        'command' => 'APPEND',
                        'segment_index' => $segmentId,
                        'media_id' => $mediaId
                    ]);

                    $segmentId++;
                }

                fclose($fp);

                $twitter->uploadMedia([
                    'command' => 'FINALIZE',
                    'media_id' => $mediaId
                ]);

                if ($file->refe_type === 'video') {
                    $waits = 0;

                    while ($waits <= 4) {
                        // Authorizing header for Twitter API
                        $oauth = [
                            'command' => 'STATUS',
                            'media_id' => $mediaId,
                            'oauth_consumer_key' => config('twitter.consumer_key'),
                            'oauth_nonce' => Str::random(42),
                            'oauth_signature_method' => 'HMAC-SHA1',
                            'oauth_timestamp' => time(),
                            'oauth_token' => $requestToken['token'],
                            'oauth_version' => '1.0'
                        ];

                        // Generate an OAuth 1.0a HMAC-SHA1 signature for an HTTP request
                        $baseInfo = $this->buildBaseString('https://upload.twitter.com/1.1/media/upload.json', 'GET', $oauth);
                        // Getting a signing key
                        $compositeKey = rawurlencode(config('twitter.consumer_secret')) . '&' . rawurlencode($requestToken['secret']);
                        // Calculating the signature
                        $oauthSignature = base64_encode(hash_hmac('sha1', $baseInfo, $compositeKey, true));
                        $oauth['oauth_signature'] = $oauthSignature;
                        $headers['Authorization'] = $this->buildAuthorizationHeader($oauth);

                        try {
                            $guzzle = new GuzzleClient([
                                'headers' => $headers
                            ]);
                            $response = $guzzle->request( 'GET', 'https://upload.twitter.com/1.1/media/upload.json?command=STATUS&media_id=' . $mediaId);
                            $uploadStatus = json_decode($response->getBody()->getContents());
                        } catch (\Exception | GuzzleException $e) {
                            dd($e->getMessage(), $e->getLine(), $e->getFile());
                        }

                        if (isset($uploadStatus->processing_info->state)) {
                            switch ($uploadStatus->processing_info->state) {
                                case 'succeeded':
                                    $waits = 5; // break out of the while loop
                                    break;
                                case 'failed':
                                    File::delete($tempFile);
                                    Log::error('File processing failed: ' . $uploadStatus->processing_info->error->message);
                                    throw new \Exception('File processing failed: ' . $uploadStatus->processing_info->error->message);
                                default:
                                    sleep($uploadStatus->processing_info->check_after_secs);
                                    $waits++;
                            }
                        } else {
                            throw new \Exception('There was an unknown error uploading your file');
                        }
                    }
                }

                $twitter->postTweet(['status' => urldecode($postContent), 'media_ids' => $initMedia->media_id_string]);
                @File::delete($convertedFile);
                $result['link'] = 'https://twitter.com/home';
                $result['status'] = true;
                $result['message'] = 'Your content successfully published on Twitter. You can visit to Twitter and check it.';
                $result['publishing_status'] = 'done';
            }
        } catch (\Exception $e) {
            dd($e->getMessage());
            $result['message'] = $e->getMessage();
            return $result;
        }

        return $result;
    }

    /**
     * @param $baseURI
     * @param $method
     * @param $params
     * @return string
     *
     * Creating the signature base string
     */
    protected function buildBaseString($baseURI, $method, $params): string
    {
        $r = array();
        ksort($params);
        foreach($params as $key=>$value){
            $r[] = "$key=" . rawurlencode($value);
        }
        return $method . "&" . rawurlencode($baseURI) . '&' . rawurlencode(implode('&', $r));
    }

    /**
     * @param $oauth
     * @return string
     *
     * Collecting parameters
     */
    protected function buildAuthorizationHeader($oauth): string
    {
        $r = 'OAuth ';
        $values = array();
        foreach($oauth as $key=>$value)
            $values[] = "$key=\"" . rawurlencode($value) . "\"";
        $r .= implode(', ', $values);
        return $r;
    }
}



    


    I would be very grateful if someone would help me.

    


  • How to build FFMPEG lib with android ndk

    27 janvier 2017, par S. Le Galloudec

    I introduce my problem : I’m a student working on a project asked by a company to my school.
    My part is to develop an android application (i have to use c++) who can make an authentication, ask to an api wich camera the client can watch, then display in real time the stream of the IP camera (using RTSP protocol)

    To be honnest i’m pretty lost. I’ve found the library FFMPEG, wich looks like useful to my project. If i got it right, the library can display a stream from a camera. So i built the library for my project, and then i tried to include it in my program.

    I did it the same way i did to include the library curl that i already use.

    But when i try to run my program, i got this message :

    FAILURE : Build failed with an exception.

    • What went wrong :
      Execution failed for task ’:app:externalNativeBuildDebug’.
      Build command failed.
      Error while executing ’/local/Android/Sdk/cmake/3.6.3155560/bin/cmake’ with arguments —build /local/Bureau/Projet2/videosurveillance/Application_Android/App_Android/app/.externalNativeBuild/cmake/debug/x86 —target lecteur
      [1/1] Linking CXX shared library ../obj/x86/liblecteur.so
      FAILED : : && /local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -target i686-none-linux-android -gcc-toolchain /local/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64 —sysroot=/local/Android/Sdk/ndk-bundle/platforms/android-9/arch-x86 -fPIC -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,—noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -std=gnu++11 -O0 -fno-limit-debug-info -Wl,—build-id -Wl,—warn-shared-textrel -Wl,—fatal-warnings -Wl,—no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,liblecteur.so -o ../obj/x86/liblecteur.so CMakeFiles/lecteur.dir/src/main/cpp/lecteur.cpp.o ../../../../../distribution/ffmpeg/x86/lib/libswscale.a -lz /local/Android/Sdk/ndk-bundle/platforms/android-9/arch-x86/usr/lib/liblog.so -lm "/local/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_static.a" && :
      /local/Bureau/Projet2/videosurveillance/Application_Android/App_Android/app/src/main/cpp/lecteur.cpp:19 : error : undefined reference to ’avcodec_configuration’
      clang++ : error : linker command failed with exit code 1 (use -v to see invocation)
      ninja : build stopped : subcommand failed.

      Try :
      Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output.

    And i know that the problem comes from my cmakelist, or from my tree. But i don’t see the mistake, so if you could help me. Here is my cmakelist :

    cmake_minimum_required(VERSION 3.4.1)

    set(distribution_DIR ${CMAKE_SOURCE_DIR}/../distribution)


    add_library(lib-curl STATIC IMPORTED)

    add_library(ffmpeg SHARED IMPORTED)

    set_target_properties(lib-curl PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/curl/lib/${ANDROID_ABI}/libcurl.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavcodec.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavdevice.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavfilter.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavformat.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavutil.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libpostproc.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libswresample.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libswscale.a)




    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")


    add_library( # Sets the name of the library.
            downloader
            SHARED
            src/main/cpp/downloader.cpp
             #src/main/cpp/downloader.h
             )


    add_library( # Sets the name of the library.
            getrequest
            SHARED
            src/main/cpp/getrequest.cpp
             #src/main/cpp/getrequest.h
             )

    add_library( # Sets the name of the library.
            lecteur
            SHARED
            src/main/cpp/lecteur.cpp
             #src/main/cpp/lecteur.h
             )

    target_include_directories(downloader PRIVATE
                          ${distribution_DIR}/curl/include)

    target_include_directories(getrequest PRIVATE
                          ${distribution_DIR}/curl/include)

    target_include_directories(lecteur PRIVATE
                          ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/include)


    find_library( # Sets the name of the path variable.
             log-lib

             log )

    target_link_libraries( # Specifies the target library.
                      downloader
                      lib-curl
                      z
                      ${log-lib}
                      )

    target_link_libraries( # Specifies the target library.
                      getrequest
                      lib-curl
                      z
                      ${log-lib}
                      )

    target_link_libraries( # Specifies the target library.
                      lecteur
                      ffmpeg
                      z
                      ${log-lib}
                      )

    If you want to understand how i made my cmake, and what looks like my program you can check here : https://github.com/samylegalloudec/android-ndk-ffmepg

    Hope i was clear

    Best regards

    Edit n°1 :

    I think i’ve made a mistake in my cmakelist.txt so i fixed it (i guess) this way :

    cmake_minimum_required(VERSION 3.4.1)

    set(distribution_DIR ${CMAKE_SOURCE_DIR}/../distribution)


    add_library(lib-curl STATIC IMPORTED)



    set_target_properties(lib-curl PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/curl/lib/${ANDROID_ABI}/libcurl.a)

    add_library(ffmpeg-codec STATIC IMPORTED)
    set_target_properties(ffmpeg-codec PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavcodec.a)

    add_library(ffmpeg-device STATIC IMPORTED)
    set_target_properties(ffmpeg-device PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavdevice.a)

    add_library(ffmpeg-filter STATIC IMPORTED)
    set_target_properties(ffmpeg-filter PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavfilter.a)

    add_library(ffmpeg-format STATIC IMPORTED)
    set_target_properties(ffmpeg-format PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavformat.a)

    add_library(ffmpeg-util STATIC IMPORTED)
    set_target_properties(ffmpeg-util PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavutil.a)

    add_library(ffmpeg-postproc STATIC IMPORTED)
    set_target_properties(ffmpeg-postproc PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libpostproc.a)

    add_library(ffmpeg-sample STATIC IMPORTED)
    set_target_properties(ffmpeg-sample PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libswresample.a)

    add_library(ffmpeg-scale STATIC IMPORTED)
    set_target_properties(ffmpeg-scale PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libswscale.a)




    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")


    add_library( # Sets the name of the library.
            downloader
            SHARED
            src/main/cpp/downloader.cpp
             #src/main/cpp/downloader.h
             )


    add_library( # Sets the name of the library.
            getrequest
            SHARED
            src/main/cpp/getrequest.cpp
             #src/main/cpp/getrequest.h
             )

    add_library( # Sets the name of the library.
            lecteur
            SHARED
            src/main/cpp/lecteur.cpp
             #src/main/cpp/lecteur.h
             )

    target_include_directories(downloader PRIVATE
                          ${distribution_DIR}/curl/include)

    target_include_directories(getrequest PRIVATE
                          ${distribution_DIR}/curl/include)

    target_include_directories(lecteur PRIVATE
                          ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/include)


    find_library( # Sets the name of the path variable.
             log-lib

             log )

    target_link_libraries( # Specifies the target library.
                      downloader
                      lib-curl
                      z
                      ${log-lib}
                      )

    target_link_libraries( # Specifies the target library.
                      getrequest
                      lib-curl
                      z
                      ${log-lib}
                      )

    target_link_libraries( # Specifies the target library.
                      lecteur
                      ffmpeg-codec
                      ffmpeg-device
                      ffmpeg-filter
                      ffmpeg-format
                      ffmpeg-util
                      ffmpeg-postproc
                      ffmpeg-sample
                      ffmpeg-scale
                      z
                      ${log-lib}
                      )

    Now i have another message :

    FAILURE : Build failed with an exception.

    • What went wrong :
      Execution failed for task ’:app:externalNativeBuildDebug’.
      Build command failed.
      Error while executing ’/local/Android/Sdk/cmake/3.6.3155560/bin/cmake’ with arguments —build /local/Bureau/Projet2/videosurveillance/Application_Android/App_Android/app/.externalNativeBuild/cmake/debug/x86 —target lecteur
      [1/1] Linking CXX shared library ../obj/x86/liblecteur.so
      FAILED : : && /local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -target i686-none-linux-android -gcc-toolchain /local/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64 —sysroot=/local/Android/Sdk/ndk-bundle/platforms/android-9/arch-x86 -fPIC -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,—noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -std=gnu++11 -O0 -fno-limit-debug-info -Wl,—build-id -Wl,—warn-shared-textrel -Wl,—fatal-warnings -Wl,—no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,liblecteur.so -o ../obj/x86/liblecteur.so CMakeFiles/lecteur.dir/src/main/cpp/lecteur.cpp.o ../../../../../distribution/ffmpeg/x86/lib/libavcodec.a ../../../../../distribution/ffmpeg/x86/lib/libavdevice.a ../../../../../distribution/ffmpeg/x86/lib/libavfilter.a ../../../../../distribution/ffmpeg/x86/lib/libavformat.a ../../../../../distribution/ffmpeg/x86/lib/libavutil.a ../../../../../distribution/ffmpeg/x86/lib/libpostproc.a ../../../../../distribution/ffmpeg/x86/lib/libswresample.a ../../../../../distribution/ffmpeg/x86/lib/libswscale.a -lz /local/Android/Sdk/ndk-bundle/platforms/android-9/arch-x86/usr/lib/liblog.so -lm "/local/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_static.a" && :
      /local/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld : warning : shared library text segment is not shareable
      /local/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld : error : treating warnings as errors
      clang++ : error : linker command failed with exit code 1 (use -v to see invocation)
      ninja : build stopped : subcommand failed.

    • Try :
      Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output.

  • encoding with ffmpeg libx265 -pix_fmt gray gives unplayable vid

    9 juin 2017, par netjiro

    What am I missing ?
    I encode an old black and white film clip with ffmpeg libx265 passing -pix_fmt gray. The output is unplayable in both vlc and mplayer (linux), so I assume I’m missing something...

    encoding :

    ffmpeg -i clip.mkv \
       -c:v libx265 -preset slow -x265-params "crf=24" -pix_fmt gray \
       -c:a libopus -b:a 64k \
       -c:s copy \
       out.mkv

    vlc errors :

    [00007f8a3ddfe328] blend blend error: no matching alpha blending routine (chroma: RGBA -> GREY)
    [00007f8a3ddfe328] core blend error: blending RGBA to GREY failed
    ... repeated ...

    mplayer errors :

    Unexpected decoder output format Planar Y800
    ... repeated ...

    ffmpeg encoding output :

    ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 4.9.4 (Gentoo 4.9.4 p1.0, pie-0.6.4)
     configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/share/doc/ffmpeg-3.2.4/html --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-march=native -O2 -pipe' --disable-static --enable-avfilter --enable-avresample --disable-stripping --enable-nonfree --enable-version3 --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-version3 --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-gcrypt --disable-gnutls --disable-gmp --enable-gpl --enable-hardcoded-tables --enable-iconv --enable-lzma --enable-network --enable-openssl --enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl2 --enable-vaapi --enable-vdpau --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-zlib --enable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --enable-openal --enable-opengl --enable-libv4l2 --disable-libpulse --enable-libopencore-amrwb --enable-libopencore-amrnb --disable-libfdk-aac --enable-libopenjpeg --enable-libbluray --enable-libcelt --disable-libgme --disable-libgsm --disable-mmal --enable-libmodplug --enable-libopus --disable-libilbc --disable-librtmp --enable-libssh --enable-libschroedinger --enable-libspeex --enable-libvorbis --enable-libvpx --disable-libzvbi --disable-libbs2b --disable-chromaprint --disable-libebur128 --disable-libflite --disable-frei0r --disable-libfribidi --enable-fontconfig --disable-ladspa --disable-libass --enable-libfreetype --disable-librubberband --disable-libzimg --enable-libsoxr --enable-pthreads --enable-libvo-amrwbenc --enable-libmp3lame --disable-libkvazaar --disable-nvenc --disable-libopenh264 --enable-libsnappy --enable-libtheora --enable-libtwolame --enable-libwavpack --disable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --disable-amd3dnow --disable-amd3dnowext --disable-fma4 --disable-xop --cpu=host --disable-doc --disable-htmlpages --enable-manpages
     libavutil      55. 34.101 / 55. 34.101
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.101 / 57. 56.101
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libavresample   3.  1.  0 /  3.  1.  0
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    x265 [info]: HEVC encoder version 2.2
    x265 [info]: build info [Linux][GCC 4.9.4][64 bit] 8bit+10bit+12bit
    x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
    x265 [info]: Unknown profile, Level-3.1 (Main tier)
    x265 [warning]: No thread pool allocated, --wpp disabled
    x265 [warning]: No thread pool allocated, --lookahead-slices disabled
    x265 [info]: Slices                              : 1
    x265 [info]: frame threads / pool features       : 3 / none
    x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
    x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
    x265 [info]: ME / range / subpel / merge         : star / 57 / 3 / 3
    x265 [info]: Keyframe min / max / scenecut / bias: 23 / 250 / 40 / 5.00
    x265 [info]: Lookahead / bframes / badapt        : 25 / 4 / 2
    x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
    x265 [info]: References / ref-limit  cu / depth  : 4 / on / on
    x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
    x265 [info]: Rate Control / qCompress            : CRF-24.0 / 0.60
    x265 [info]: tools: rect limit-modes rd=4 psy-rd=2.00 rdoq=2 psy-rdoq=1.00
    x265 [info]: tools: rskip signhide tmvp strong-intra-smoothing deblock sao
    Output #0, matroska, to 'out.mkv':
     Metadata:
       encoder         : Lavf57.56.101
       Metadata:
       Stream #0:0(eng): Video: hevc (libx265), gray, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 1k tbn, 23.98 tbc (default)
       Metadata:
         encoder         : Lavc57.64.101 libx265
       Stream #0:1(eng): Audio: opus (libopus) ([255][255][255][255] / 0xFFFFFFFF), 48000 Hz, stereo, flt, 64 kb/s (default)
       Metadata:
         encoder         : Lavc57.64.101 libopus
       Stream #0:2(eng): Subtitle: subrip (default)
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
     Stream #0:1 -> #0:1 (eac3 (native) -> opus (libopus))
     Stream #0:3 -> #0:2 (copy)
    Press [q] to stop, [?] for help
    frame= 1439 fps=7.0 q=-0.0 Lsize=    5356kB time=00:01:00.01 bitrate= 731.1kbits/s speed=0.294x    
    video:4940kB audio:382kB subtitle:1kB other streams:0kB global headers:2kB muxing overhead: 0.629434%
    x265 [info]: frame I:      9, Avg QP:22.27  kb/s: 6064.82
    x265 [info]: frame P:    340, Avg QP:23.62  kb/s: 1950.21
    x265 [info]: frame B:   1090, Avg QP:29.65  kb/s: 230.75  
    x265 [info]: Weighted P-Frames: Y:0.9% UV:0.0%
    x265 [info]: consecutive B-frames: 2.9% 0.3% 1.4% 72.5% 22.9%