Recherche avancée

Médias (91)

Autres articles (111)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (11428)

  • Getting error "DLL load failed while importing rect : %1 is not a valid Win32 application" while importing package

    17 août 2020, par Sagar Donadkar

    I am using cython package to call Cpp API and in my cpp code i am using ffmpeg library and able to build my code successfully using bellow command

    


    python setup.py build_ext --inplace --compiler=msvc


    


    but when i try to import generated pyd file then i get error

    


    PS D:\SiVUE\Backend\Cython\demo> python&#xA;Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)] on win32&#xA;Type "help", "copyright", "credits" or "license" for more information.&#xA;>>> import rect&#xA;Traceback (most recent call last):&#xA;  File "<stdin>", line 1, in <module>&#xA;ImportError: DLL load failed while importing rect: %1 is not a valid Win32 application.&#xA;>>> &#xA;</module></stdin>

    &#xA;

    My entire code is provided bellow

    &#xA;

    header file&#xA;#ifndef RECTANGLE_H&#xA;#define RECTANGLE_H&#xA;#include <iostream>&#xA;&#xA;extern "C"&#xA;{&#xA;    #include "libavformat/avformat.h"&#xA;    #include "libavutil/dict.h"&#xA;}&#xA;&#xA;using namespace std;&#xA;&#xA;namespace shapes &#xA;{&#xA;    class Rectangle {&#xA;        public:&#xA;            int x0, y0, x1, y1;&#xA;            Rectangle();&#xA;            Rectangle(int x0, int y0, int x1, int y1);&#xA;            ~Rectangle();&#xA;            int getArea();&#xA;            int ffmpegFile();&#xA;            void getSize(int* width, int* height);&#xA;            void move(int dx, int dy);&#xA;    };&#xA;}&#xA;&#xA;#endif&#xA;</iostream>

    &#xA;

    Rectangle.Cpp file in ffmpegFile() i am calling mostly ffmpeg API

    &#xA;

    &#xA;#include <iostream>&#xA;#include "Rectangle.hpp"&#xA;&#xA;namespace shapes {&#xA;    &#xA;&#xA;    // Default constructor&#xA;    Rectangle::Rectangle () {}&#xA;&#xA;    // Overloaded constructor&#xA;    Rectangle::Rectangle (int x0, int y0, int x1, int y1) {&#xA;        this->x0 = x0;&#xA;        this->y0 = y0;&#xA;        this->x1 = x1;&#xA;        this->y1 = y1;&#xA;    }&#xA;&#xA;    // Destructor&#xA;    Rectangle::~Rectangle () {}&#xA;&#xA;    // Return the area of the rectangle&#xA;    int Rectangle::getArea () {&#xA;        return 10;&#xA;    }&#xA;&#xA;    // Get the size of the rectangle.&#xA;    // Put the size in the pointer args&#xA;    void Rectangle::getSize (int *width, int *height) {&#xA;        (*width) = x1 - x0;&#xA;        (*height) = y1 - y0;&#xA;    }&#xA;&#xA;    // Move the rectangle by dx dy&#xA;    void Rectangle::move (int dx, int dy) {&#xA;        this->x0 &#x2B;= dx;&#xA;        this->y0 &#x2B;= dy;&#xA;        this->x1 &#x2B;= dx;&#xA;        this->y1 &#x2B;= dy;&#xA;    }&#xA;    int Rectangle::ffmpegFile()&#xA;    {&#xA;        AVFormatContext *fmt_ctx = NULL;&#xA;        AVDictionaryEntry *tag = NULL;&#xA;        int ret = 0;&#xA;        char* filename = "D:\\Discovery.mp4";&#xA;&#xA;        if ((ret = avformat_open_input(&amp;fmt_ctx, filename, NULL, NULL)))&#xA;            return ret;&#xA;&#xA;        if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) &lt; 0) {&#xA;            av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n");&#xA;            return ret;&#xA;        }&#xA;&#xA;        while ((tag = av_dict_get(fmt_ctx->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))&#xA;            printf("%s=%s\n", tag->key, tag->value);&#xA;&#xA;        avformat_close_input(&amp;fmt_ctx);&#xA;        return ret;&#xA;    }&#xA;}&#xA;</iostream>

    &#xA;

    Rectangle.pxd file declaration for cpp file function and variable

    &#xA;

    cdef extern from "Rectangle.cpp":&#xA;    pass&#xA;cdef extern from "Rectangle.hpp" namespace "shapes":&#xA;    cdef cppclass Rectangle:&#xA;        Rectangle() except &#x2B;&#xA;        Rectangle(int, int, int, int) except &#x2B;&#xA;        int x0, y0, x1, y1&#xA;        int getArea()&#xA;        void getSize(int* width, int* height)&#xA;        void move(int, int)&#xA;        int ffmpegFile()&#xA;

    &#xA;

    rect.pyx file i am calling cpp API

    &#xA;

    # distutils: language = c&#x2B;&#x2B;&#xA;&#xA;from Rectangle cimport Rectangle&#xA;&#xA;cdef class PyRectangle:&#xA;    cdef Rectangle c_rect  # Hold a C&#x2B;&#x2B; instance which we&#x27;re wrapping&#xA;&#xA;    def __cinit__(self, int x0, int y0, int x1, int y1):&#xA;        self.c_rect = Rectangle(x0, y0, x1, y1)&#xA;&#xA;    def get_area(self):&#xA;        return self.c_rect.getArea()&#xA;&#xA;    def get_size(self):&#xA;        cdef int width, height&#xA;        self.c_rect.getSize(&amp;width, &amp;height)&#xA;        return width, height&#xA;&#xA;    def move(self):&#xA;        print(self.c_rect.ffmpegFile())&#xA;

    &#xA;

    setup.py&#xA;I provided pyx file and ffmpeg library path as well as include path

    &#xA;

    from distutils.core import setup&#xA;from setuptools import Extension&#xA;from Cython.Build import cythonize &#xA;&#xA;sfc_module = [Extension(&#x27;rect&#x27;, sources = [&#x27;rect.pyx&#x27;],&#xA;                       include_dirs = [&#x27;D:\\SiVUE\\Backend\\Cython\\demo\\ffmpeg\\include\\&#x27;],&#xA;                       library_dirs = [&#x27;D:\\SiVUE\\Backend\\Cython\\demo\\ffmpeg\\lib\\&#x27;],&#xA;                       libraries = [&#x27;avcodec&#x27;,&#x27;avdevice&#x27;,&#x27;avfilter&#x27;,&#x27;avformat&#x27;,&#x27;avutil&#x27;,&#x27;postproc&#x27;,&#x27;swresample&#x27;,&#x27;swscale&#x27;],&#xA;                       language=&#x27;c&#x2B;&#x2B;&#x27;)]&#xA;&#xA;setup(name = &#x27;superfastcode&#x27;, version = &#x27;1.0&#x27;,&#xA;    description = &#x27;Python Package with superfastcode C&#x2B;&#x2B; extension&#x27;,&#xA;    ext_modules = cythonize(sfc_module),&#xA;    include_dirs = [&#x27;D:\\SiVUE\\Backend\\Cython\\demo\\ffmpeg\\include\\&#x27;]&#xA;    )&#xA;

    &#xA;

    Thank You

    &#xA;

  • Trying to convert an RTSP stream to a HSL file, but get a "Failed to Open Segment" error

    1er juin 2021, par Alvydas Juodikis

    These are the linux commands I ran on ubuntu 20.04 to convert an rtsp stream to a HLS file. I was trying to then display it onto my html webserver to run a live video but I'm stuck at an error.

    &#xA;

    ffmpeg -fflags nobuffer \&#xA; -rtsp_transport tcp \&#xA; -i <my rtsp="rtsp" url="url"> \&#xA; -vsync 0 \&#xA; -copyts \&#xA; -vcodec copy \&#xA; -movflags frag_keyframe&#x2B;empty_moov \&#xA; -an \&#xA; -hls_flags delete_segments&#x2B;append_list \&#xA; -f segment \&#xA; -segment_list_flags live \&#xA; -segment_time 0.5 \&#xA; -segment_list_size 1 \&#xA; -segment_format mpegts \&#xA; -segment_list Home/Desktop/fmpegsolution/index.m3u8 \&#xA; -segment_list_type m3u8 \&#xA; -segment_list_entry_prefix Home/Desktop/fmpegsolution/ \&#xA; Home/Desktop/fmpegsolution/%3d.ts&#xA;</my>

    &#xA;

    I'm using an example from this link :&#xA;https://girishjoshi.io/post/ffmpeg-rtsp-to-hls/

    &#xA;

    I try to generate my file into a directory located in my desktop called fmpegsolution (hence the output path Home/Desktop/fmpegsolution)

    &#xA;

    The error :

    &#xA;

    When running this on terminal, the error comes out to :&#xA;[segment @ 0x558c82e11ec0] Opening &#x27;Home/Desktop/fmpegsolution/000.ts&#x27; for writing [segment @ 0x558c82e11ec0] Failed to open segment &#x27;Home/Desktop/fmpegsolution/000.ts&#x27; Could not write header for output file #0 (incorrect codec parameters ?): No such file or directory

    &#xA;

    My issue is related to the folder or directory but it definitely exists. I even tried creating a "%3d.ts" blank file (000.ts) but that had no effect. Could use some help. Thanks for your time.

    &#xA;

  • ffmpeg - spark - azure databricks - error writing trailer of "filename.mp3" : Operation not supported

    4 juillet 2021, par CRAFTY DBA

    I have been trying to figure out this tough problem.

    &#xA;

    I am trying to convert *.mp4 files to *.mp3 files.

    &#xA;

    I tried using MoviePy but I found out that is uses ffmpeg and was having the same issue.

    &#xA;

    I used these two articles to get the latest version of ffmpeg installed on the Azure Databricks Cluster during startup. I am using a single node cluster for this POC code.

    &#xA;

    Pyspark : Use ffmpeg on the driver and workers
    &#xA;https://ubuntuhandbook.org/index.php/2020/06/install-ffmpeg-4-3-via-ppa-ubuntu-18-04-16-04

    &#xA;

    The issue is that even the simplest command results in errors.

    &#xA;

    %%bash ffmpeg -i /dbfs/Craftydba/recording.mp4 /dbfs/Craftydba/recording.mp3

    &#xA;

    I even tried .wav as an output format and still the same issue.

    &#xA;

    I retested this command on a Data Science VM in Azure with Python and FFMPEG. It works fine on that OS/Build.

    &#xA;

    It has something to do with the version of the code on the spark cluster.

    &#xA;

    Any help is appreciated.

    &#xA;

    Sincerely

    &#xA;

    John Miner

    &#xA;

    PS : I am add a dump of the OS version as well as a ffmpeg error.

    &#xA;

    Os Version Dump

    &#xA;

    NAME="Ubuntu"&#xA;VERSION="18.04.5 LTS (Bionic Beaver)"&#xA;ID=ubuntu&#xA;ID_LIKE=debian&#xA;PRETTY_NAME="Ubuntu 18.04.5 LTS"&#xA;VERSION_ID="18.04"&#xA;HOME_URL="https://www.ubuntu.com/"&#xA;SUPPORT_URL="https://help.ubuntu.com/"&#xA;BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"&#xA;PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"&#xA;VERSION_CODENAME=bionic&#xA;UBUNTU_CODENAME=bionic

    &#xA;

    FFMPEG Dump

    &#xA;

    ffmpeg version 4.3.2-0york0~18.04 Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)&#xA;  configuration: --prefix=/usr --extra-version=&#x27;0york0~18.04&#x27; --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libzimg --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;  libpostproc    55.  7.100 / 55.  7.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;/dbfs/Craftydba/recording.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2&#xA;    creation_time   : 2021-06-18T19:07:17.000000Z&#xA;  Duration: 00:04:48.64, start: 0.000000, bitrate: 1065 kb/s&#xA;    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, 1000 kb/s, 7.96 fps, 8 tbr, 10k tbn, 20k tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2021-06-18T19:07:17.000000Z&#xA;    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 63 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2021-06-18T19:07:17.000000Z&#xA;Stream mapping:&#xA;  Stream #0:1 -> #0:0 (aac (native) -> mp3 (libmp3lame))&#xA;Press [q] to stop, [?] for help&#xA;Output #0, mp3, to &#x27;/dbfs/Craftydba/recording.mp3&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2&#xA;    TSSE            : Lavf58.45.100&#xA;    Stream #0:0(eng): Audio: mp3 (libmp3lame), 16000 Hz, mono, fltp (default)&#xA;    Metadata:&#xA;      creation_time   : 2021-06-18T19:07:17.000000Z&#xA;      encoder         : Lavc58.91.100 libmp3lame&#xA;Error writing trailer of /dbfs/Craftydba/recording.mp3: Operation not supported&#xA;size=     846kB time=00:04:48.65 bitrate=  24.0kbits/s speed=86.9x    &#xA;video:0kB audio:846kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.036945%&#xA;

    &#xA;