Recherche avancée

Médias (1)

Mot : - Tags -/net art

Autres articles (97)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

Sur d’autres sites (16704)

  • FFMPEG PNG sequence into mkv cause "inflate returned error -3" every 600-800 frames [closed]

    30 novembre 2023, par sergey9295

    I am new to ffmpeg. I try to use it for creating videos from png sequences. I have uncompressed pngs. All of them rgb24 format.

    


    But during encoding process I get inflate errors. I compared PNG and video frame by frame. And video have approximately 1 dupe frame every 600-800 frames instead of the ones that should be on that places. I tried another codecs, tried to clear png's EXIF(it made things even worse), made sure that memory was enough. Doesn't matter.

    


    The worst part is that this errors are pretty random. I encode one sequence 3 times and get 3 different sets of error-causing frames.

    


    FFMPEG was downloaded from official site.

    


    PS C:\Users\sergey9295\Desktop\Upscaler\bin> ./ffmpeg -framerate 24000/1001 -i 24o/frame%04d.png -c:v libx264 -qp 0 -r 24000/1001 -pix_fmt yuv420p BC108K.mkv
ffmpeg version N-112872-g67ce690bc6-20231128 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13.2.0 (crosstool-NG 1.25.0.232_c175b21)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libaribcaption --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20231128
  libavutil      58. 32.100 / 58. 32.100
  libavcodec     60. 35.100 / 60. 35.100
  libavformat    60. 18.100 / 60. 18.100
  libavdevice    60.  4.100 / 60.  4.100
  libavfilter     9. 13.100 /  9. 13.100
  libswscale      7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
  libpostproc    57.  4.100 / 57.  4.100
Input #0, image2, from '24o/frame%04d.png':
  Duration: 00:01:32.09, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: png, rgb24(pc, gbr/bt709/iec61966-2-1), 7680x4320, 23.98 fps, 23.98 tbr, 23.98 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 00000231363c6280] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000231363c6280] profile High 4:4:4 Predictive, level 6.0, 4:2:0, 8-bit
[libx264 @ 00000231363c6280] 64 - core 164 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=0 mixed_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=18 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=0
Output #0, matroska, to 'BC108K.mkv':
  Metadata:
    encoder         : Lavf60.18.100
  Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p(tv, unknown/bt709/iec61966-2-1, progressive), 7680x4320, q=2-31, 23.98 fps, 1k tbn
    Metadata:
      encoder         : Lavc60.35.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
[png @ 00000231363c8880] inflate returned error -301:02.72 bitrate=698356.0kbits/s speed=0.171x
[vist#0:0/png @ 00000231363c16c0] Error submitting packet to decoder: Generic error in an external library
[png @ 00000231363c8880] inflate returned error -301:15.24 bitrate=679969.1kbits/s dup=1 drop=0 speed=0.172x
[vist#0:0/png @ 00000231363c16c0] Error submitting packet to decoder: Generic error in an external library3x
[png @ 00000231363f32c0] inflate returned error -301:16.65 bitrate=694583.2kbits/s dup=2 drop=0 speed=0.171x
[vist#0:0/png @ 00000231363c16c0] Error submitting packet to decoder: Generic error in an external library1x
[png @ 000002313646a100] inflate returned error -301:20.78 bitrate=742902.6kbits/s dup=3 drop=0 speed=0.167x
[vist#0:0/png @ 00000231363c16c0] Error submitting packet to decoder: Generic error in an external library6x
[png @ 000002313646ea00] inflate returned error -301:26.92 bitrate=839679.5kbits/s dup=4 drop=0 speed=0.159x
[vist#0:0/png @ 00000231363c16c0] Error submitting packet to decoder: Generic error in an external library8x
[png @ 00000231363cc740] inflate returned error -301:29.38 bitrate=874703.4kbits/s dup=5 drop=0 speed=0.156x
[vist#0:0/png @ 00000231363c16c0] Error submitting packet to decoder: Generic error in an external library6x
[out#0/matroska @ 00000231363a7200] video:9827779kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000442%
frame= 2208 fps=3.8 q=-1.0 Lsize= 9827822kB time=00:01:32.05 bitrate=874625.3kbits/s dup=6 drop=0 speed=0.158x


    


    IMO the problem is zlib from libpng. But I don't have skills to recompile it with libspng that doesn't require zlib. Maybe there is a ffmpeg version without this error ?

    


  • Can't initialize "h264_mediacodec" for hw accelerated decoding, FFMPEG, Android

    27 mars 2024, par Ramil Galin

    I am trying to create hw accelerated decoding on Android through JNI and following this example but, unfortunately, avcodec_get_hw_config returns nullptr.

    


    I have also tried using avcodec_find_decoder_by_name("h264_mediacodec"), also returns nullptr.

    


    I built ffmpeg (version 4.4) using this script with the flags :

    


    --enable-jni \
--enable-mediacodec \
--enable-decoder=h264_mediacodec \
--enable-hwaccel=h264_mediacodec \


    


    When configuring build I saw in logs WARNING: Option --enable-hwaccel=h264_mediacodec did not match anything, which is actually strange. FFMPEG 4.4 should support hw accelerated decoding using mediacodec.

    


    Edit : (providing minimal reproducible example)

    


    In the JNI method I init input context of decoder and init decoder :

    


        void Decoder::initInputContext(&#xA;        const std::string&amp; source,&#xA;        AVDictionary* options&#xA;    ) { // open input, and allocate format context&#xA;        if (&#xA;            avformat_open_input(&#xA;                &amp;m_inputFormatContext,&#xA;                source.c_str(),&#xA;                NULL,&#xA;                options ? &amp;options : nullptr&#xA;            ) &lt; 0&#xA;        ) {&#xA;            throw FFmpegException(&#xA;                fmt::format("Decoder: Could not open source {}", source)&#xA;            );&#xA;        }&#xA; &#xA;        // retrieve stream information&#xA;        if (avformat_find_stream_info(m_inputFormatContext, NULL) &lt; 0) {&#xA;            throw FFmpegException(&#xA;                "Decoder: Could not find stream information"&#xA;            );&#xA;        }&#xA;&#xA;        // get audio and video streams&#xA;        for (size_t i = 0; i &lt; m_inputFormatContext->nb_streams; i&#x2B;&#x2B;) {&#xA;            AVStream* inStream = m_inputFormatContext->streams[i];&#xA;            AVCodecParameters* inCodecpar = inStream->codecpar;&#xA;            if (&#xA;                inCodecpar->codec_type != AVMEDIA_TYPE_AUDIO &amp;&amp;&#xA;                inCodecpar->codec_type != AVMEDIA_TYPE_VIDEO&#xA;            ) {&#xA;                continue;&#xA;            }&#xA;&#xA;            if (inCodecpar->codec_type == AVMEDIA_TYPE_VIDEO) {&#xA;                m_videoStreamIdx = i;&#xA;                m_videoStream = inStream;&#xA;&#xA;                m_codecParams.videoCodecId = m_videoStream->codecpar->codec_id;&#xA;                m_codecParams.fps = static_cast<int>(av_q2d(m_videoStream->r_frame_rate) &#x2B; 0.5);&#xA;                m_codecParams.clockrate = m_videoStream->time_base.den;&#xA;&#xA;                spdlog::debug(&#xA;                    "Decoder: fps: {}, clockrate: {}",&#xA;                    m_codecParams.fps,&#xA;                    m_codecParams.clockrate&#xA;                )&#xA;                ;&#xA;            }&#xA;&#xA;            if (inCodecpar->codec_type == AVMEDIA_TYPE_AUDIO) {&#xA;                m_audioStreamIdx = i;&#xA;                m_audioStream = inStream;&#xA;&#xA;                m_codecParams.audioCodecId = m_audioStream->codecpar->codec_id;&#xA;                m_codecParams.audioSamplerate = m_audioStream->codecpar->sample_rate;&#xA;                m_codecParams.audioChannels = m_audioStream->codecpar->channels;&#xA;                m_codecParams.audioProfile = m_audioStream->codecpar->profile;&#xA;&#xA;                spdlog::debug(&#xA;                    "Decoder: audio samplerate: {}, audio channels: {}, x: {}",&#xA;                    m_codecParams.audioSamplerate,&#xA;                    m_codecParams.audioChannels,&#xA;                    m_audioStream->codecpar->channels&#xA;                )&#xA;                ;&#xA;            }&#xA;        }&#xA;    }&#xA;&#xA;    void Decoder::initDecoder() {&#xA;        AVCodecParameters* videoStreamCodecParams = m_videoStream->codecpar;&#xA;&#xA;        m_swsContext = sws_getContext(&#xA;                videoStreamCodecParams->width, videoStreamCodecParams->height, m_pixFormat,&#xA;                videoStreamCodecParams->width, videoStreamCodecParams->height, m_targetPixFormat,&#xA;                SWS_BICUBIC, nullptr, nullptr, nullptr);&#xA;&#xA;        // find best video stream info and decoder&#xA;        int ret = av_find_best_stream(m_inputFormatContext, AVMEDIA_TYPE_VIDEO, -1, -1, &amp;m_decoder, 0);&#xA;        if (ret &lt; 0) {&#xA;            throw FFmpegException(&#xA;                    "Decoder: Cannot find a video stream in the input file"&#xA;            );&#xA;        }&#xA;&#xA;        if (!m_decoder) {&#xA;            throw FFmpegException(&#xA;                    "Decoder: Can&#x27;t find decoder"&#xA;            );&#xA;        }&#xA;&#xA;        // search for supported HW decoder configuration&#xA;        for (size_t i = 0;; i&#x2B;&#x2B;) {&#xA;            const AVCodecHWConfig* config = avcodec_get_hw_config(m_decoder, i);&#xA;            if (!config) {&#xA;                spdlog::error(&#xA;                    "Decoder {} does not support device type {}. "&#xA;                    "Will use SW decoder...",&#xA;                    m_decoder->name,&#xA;                    av_hwdevice_get_type_name(m_deviceType)&#xA;                );&#xA;                break;&#xA;            }&#xA;&#xA;            if (&#xA;                config->methods &amp; AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX &amp;&amp;&#xA;                config->device_type == m_deviceType&#xA;            ) {&#xA;                // set up pixel format for HW decoder&#xA;                g_hwPixFmt = config->pix_fmt;&#xA;                m_hwDecoderSupported = true;&#xA;                break;&#xA;            }&#xA;        }&#xA;    }&#xA;</int>

    &#xA;

    And I have AVHWDeviceType m_deviceType{AV_HWDEVICE_TYPE_MEDIACODEC};

    &#xA;

    avcodec_get_hw_config returns nullptr.

    &#xA;

    Any help is appreciated.

    &#xA;

  • Unable to set "stream-number" pad property of mpegtsmux

    8 novembre 2024, par TishSerg

    Accroding to gst-inspect-1.0 mpegtsmux, mpegtsmux's sink pads have writable stream-number property :

    &#xA;

    ...&#xA;Pad Templates:&#xA;  SINK template: &#x27;sink_%d&#x27;&#xA;    Availability: On request&#xA;    Capabilities:&#xA;      ...&#xA;    Type: GstBaseTsMuxPad&#xA;    Pad Properties:&#xA;      ...&#xA;&#xA;      stream-number       : stream number&#xA;                            flags: readable, writable&#xA;                            Integer. Range: 0 - 31 Default: 0&#xA;

    &#xA;

    But when I try to set it, GStreamer says there's no such property. The following listing shows I can run multi-stream pipeline without setting that property, but when I add that property it doesn't work.

    &#xA;

    PS C:\gstreamer\1.0\msvc_x86_64\bin> ./gst-launch-1.0 mpegtsmux name=mux ! udpsink host=192.168.144.255 port=5600 sync=no `&#xA;>> videotestsrc is-live=true pattern=ball ! "video/x-raw, width=1920, height=1080, profile=main" ! x264enc ! mux.sink_300 `&#xA;>> videotestsrc is-live=true ! "video/x-raw, width=720, height=576" ! x264enc ! mux.sink_301&#xA;Use Windows high-resolution clock, precision: 1 ms&#xA;Setting pipeline to PAUSED ...&#xA;Pipeline is live and does not need PREROLL ...&#xA;Pipeline is PREROLLED ...&#xA;Setting pipeline to PLAYING ...&#xA;New clock: GstSystemClock&#xA;Redistribute latency...&#xA;Redistribute latency...&#xA;Redistribute latency...&#xA;handling interrupt.9.&#xA;Interrupt: Stopping pipeline ...&#xA;Execution ended after 0:00:03.773243400&#xA;Setting pipeline to NULL ...&#xA;Freeing pipeline ...&#xA;PS C:\gstreamer\1.0\msvc_x86_64\bin> ./gst-launch-1.0 mpegtsmux name=mux sink_300::stream-number=1 ! udpsink host=192.168.144.255 port=5600 sync=no `&#xA;>> videotestsrc is-live=true pattern=ball ! "video/x-raw, width=1920, height=1080, profile=main" ! x264enc ! mux.sink_300 `&#xA;>> videotestsrc is-live=true ! "video/x-raw, width=720, height=576" ! x264enc ! mux.sink_301&#xA;WARNING: erroneous pipeline: no property "sink_300::stream-number" in element "mpegtsmux"&#xA;PS C:\gstreamer\1.0\msvc_x86_64\bin> .\gst-launch-1.0.exe --version&#xA;gst-launch-1.0 version 1.24.8&#xA;GStreamer 1.24.8&#xA;Unknown package origin&#xA;PS C:\gstreamer\1.0\msvc_x86_64\bin> .\gst-launch-1.0.exe --version&#xA;gst-launch-1.0 version 1.24.9&#xA;GStreamer 1.24.9&#xA;Unknown package origin&#xA;PS C:\gstreamer\1.0\msvc_x86_64\bin> ./gst-launch-1.0 mpegtsmux name=mux sink_300::stream-number=1 ! udpsink host=192.168.144.255 port=5600 sync=no `&#xA;>> videotestsrc is-live=true pattern=ball ! "video/x-raw, width=1920, height=1080, profile=main" ! x264enc ! mux.sink_300 `&#xA;>> videotestsrc is-live=true ! "video/x-raw, width=720, height=576" ! x264enc ! mux.sink_301&#xA;WARNING: erroneous pipeline: no property "sink_300::stream-number" in element "mpegtsmux"&#xA;

    &#xA;

    I even updated GStreamer, but still no luck. I tried that because I found news saying there were updates regarding that property :

    &#xA;

      397 ### MPEG-TS improvements&#xA;  398 &#xA;  399 -   mpegtsdemux gained support for&#xA;  400     -   segment seeking for seamless non-flushing looping, and&#xA;  401     -   synchronous KLV&#xA;  402 -   mpegtsmux now&#xA;  403     -   allows attaching PCR to non-PES streams&#xA;  404     -   allows setting of the PES stream number for AAC audio and AVC video streams via a new “stream-number” property on the&#xA;  405         muxer sink pads. Currently, the PES stream number is hard-coded to zero for these stream types.&#xA;

    &#xA;

    The syntax seems correct (pad_name::pad_prop_name on the element). I ran out of ideas about what I'm doing wrong with that property.

    &#xA;

    Broader context :

    &#xA;

    I want to set that property because I want an exact sequence of streams I mixing.

    &#xA;

    When I feed mpegtsmux with two video streams and one audio stream (from capture devices) without specifying the stream numbers I get them muxed in a random sequence (checking it using ffprobe). Sometimes they are in the desired sequence, but sometimes they aren't. The worst case is when the audio stream is the first stream in the file, so video players get mad when trying to play such .ts file. I have to remux such files using -map key of ffmpeg. If I could set exact stream indices in mpegtsmux (not to be confused with stream PID) I could avoid analyzing actual stream layout and remuxing.

    &#xA;

    Example of the real layout of the streams (ffprobe output) :

    &#xA;

    Input #0, mpegts, from &#x27;████████████████████████████████████████&#x27;:&#xA;  Duration: 00:20:09.64, start: 3870.816656, bitrate: 6390 kb/s&#xA;  Program 1&#xA;  Stream #0:2[0x41]: Video: h264 (Baseline) (HDMV / 0x564D4448), yuvj420p(pc, bt709, progressive), 1920x1080, 30 fps, 30 tbr, 90k tbn&#xA;  Stream #0:1[0x4b]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, mono, fltp, 130 kb/s&#xA;  Program 2&#xA;  Stream #0:0[0x42]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p(progressive), 720x576, 25 fps, 25 tbr, 90k tbn&#xA;

    &#xA;

    You can see 3 streams :

    &#xA;

      &#xA;
    • FullHD video with PID 0x41 (defined by me as mpegtsmux0.sink_65) has index 2 while I want it to be 0
    • &#xA;

    • PAL video with PID 0x42 (defined by me as mpegtsmux0.sink_66) has index 0 while I want it to be 1
    • &#xA;

    • Audio with PID 0x4b (defined by me as mpegtsmux0.sink_75) has index 1 while I want it to be 2
    • &#xA;

    &#xA;