Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (26)

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

Sur d’autres sites (5095)

  • Ffmpeg x265 error : "Color Primaries must be", "ransfer Characteristics must be", "Matrix Coefficients must be" [closed]

    16 septembre 2022, par Mister Sir

    I'm trying to do the following conversion :

    


    ffmpeg -i video.mp4 -map 0 -c copy -c:v libx265 -crf 30 -vf "scale=-1:\'min(720,ih)\'" -c:a libopus -b:a 44k -map_metadata 0 -loglevel error -hide_banner video.mkv


    


    This works fine except for a specific video. I'm getting the following output :

    


    x265 [info]: HEVC encoder version 3.5+39-7c7ea0a4b
x265 [info]: build info [Windows][GCC 12.1.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x265 [error]: Color Primaries must be unknown, bt709, bt470m, bt470bg, smpte170m, smpte240m, film, bt2020, smpte-st-428, smpte-rp-431 or smpte-eg-432
x265 [error]: Transfer Characteristics must be unknown, bt709, bt470m, bt470bg, smpte170m, smpte240m, linear, log100, log316, iec61966-2-4, bt1361e, iec61966-2-1, bt2020-10, bt2020-12, smpte-st-2084, smpte-st-428 or arib-std-b67
x265 [error]: Matrix Coefficients must be unknown, bt709, fcc, bt470bg, smpte170m, smpte240m, gbr, ycgco, bt2020nc, bt2020c, smpte-st-2085, chroma-nc, chroma-c or ictcp
[libx265 @ 00000000005a2940] Cannot open libx265 encoder.


    


    Can't find a single result when I google the first error text, ffmpeg "Color Primaries must be unknown"

    


    This is the verbose output :

    


    ffmpeg version 2022-06-16-git-5242ede48d-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.3.0 (Rev1, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 27.100 / 57. 27.100
  libavcodec     59. 33.100 / 59. 33.100
  libavformat    59. 25.100 / 59. 25.100
  libavdevice    59.  6.100 / 59.  6.100
  libavfilter     8. 41.100 /  8. 41.100
  libswscale      6.  6.100 /  6.  6.100
  libswresample   4.  6.100 /  4.  6.100
  libpostproc    56.  5.100 / 56.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video_2022-07-22_10-01-25.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2022-07-04T13:14:36.000000Z
  Duration: 00:01:04.32, start: 0.000000, bitrate: 342 kb/s
  Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, reserved, progressive), 1280x720, 209 kb/s, 24.99 fps, 50 tbr, 90k tbn (default)
    Metadata:
      creation_time   : 2022-07-04T13:14:29.000000Z
      handler_name    : VideoHandle
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2022-07-04T13:14:29.000000Z
      handler_name    : SoundHandle
      vendor_id       : [0][0][0][0]
Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options specified for stream 0, only the last option '-c:v libx265' will be used.
Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options specified for stream 1, only the last option '-c:a libopus' will be used.
File 'C:\Users\Administrator\Downloads\delendum\New folder\testout.mkv' already exists. Overwrite? [y/N] Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
  Stream #0:1 -> #0:1 (aac (native) -> opus (libopus))
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 3.5+37-07b011400
x265 [info]: build info [Windows][GCC 11.2.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [error]: Color Primaries must be unknown, bt709, bt470m, bt470bg, smpte170m, smpte240m, film, bt2020, smpte-st-428, smpte-rp-431 or smpte-eg-432
x265 [error]: Transfer Characteristics must be unknown, bt709, bt470m, bt470bg, smpte170m, smpte240m, linear, log100, log316, iec61966-2-4, bt1361e, iec61966-2-1, bt2020-10, bt2020-12, smpte-st-2084, smpte-st-428 or arib-std-b67
x265 [error]: Matrix Coefficients must be unknown, bt709, fcc, bt470bg, smpte170m, smpte240m, gbr, ycgco, bt2020nc, bt2020c, smpte-st-2085, chroma-nc, chroma-c or ictcp
[libx265 @ 0000000002e60340] Cannot open libx265 encoder.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[libopus @ 000000000056fe00] 1 frames left in the queue on closing
Conversion failed!


    


    I'm not an expert at video encoding, so I don't really know what this all means. Probably something with the source file. How to get around this ? Thanks in advance ! If I need to upload the video, let me know how I can do that.

    


  • How to Skip frames while decoding H264 stream ?

    16 septembre 2018, par TTGroup

    I’m using FFMPEG to decode H264 (or H265) RTSP Stream.

    My system have 2 software : Server and Client

    Server: Read frames from RTSP stream --> Forward frames to Client    
    Client: Receive frames from Server --> Decode --> Render

    I have implemented and it worked ok, but there is a case make my system work not good. That is when internet from Server - Client is slow, frames can not transfer real-time to Client.

    In present, I deal with this issue by Skip some frames (not send to Client) when the Queue is reached limit of count. The following is my summary code

    //At Server Software (include 2 threads A and B)
    //Thread A: Read AVPacket and forward to Client
    while(true)
    {
       AVPacket packet;
       av_init_packet(&packet);
       packet.size = 0;
       packet.data = NULL;
       int ret = AVERROR(EAGAIN);
       while (AVERROR(EAGAIN) == ret)
           ret = av_read_frame(pFormatCtx, &packet);
       if(packet.size > 0)
       {
           if(mySendQueue.count < 120) //limit 120 packet in queue
               mySendQueue.Enqueue(packet); ////Thread B will read from this queue, to send packets to Client via TCP socket
           else
               ;//SkipThisFrame ***: No send
       }
    }
    //Thread B: Send To Client via TCP Socket
    While(true)
    {
       AVPacket packet;
       if(mySendQueue.Dequeue(packet))
       {
           SendPacketToClient(packet);
       }
    }

    //At Server Software : Receive AVPacket from Server --> Decode --> Render
    While(true)
    {
       AVPacket packet;
       AVFrame frame;
       ReadPacketFromServer(packet);
       if (av_decode_asyn(pCodecCtx, &frame, &frameFinished, &packet) == RS_OK)
       {
           if (frameFinished)
           {
               RenderFrame(frame);
           }
       }          
    }
    UINT32 __clrcall av_decode_asyn(AVCodecContext *pCodecCtx, AVFrame *frame, int *frameFinished, AVPacket *packet)
    {
       int ret = -1;
       *frameFinished = 0;
       if (packet)
       {
           ret = avcodec_send_packet(pCodecCtx, packet);
           // In particular, we don't expect AVERROR(EAGAIN), because we read all
           // decoded frames with avcodec_receive_frame() until done.
           if (ret < 0 && ret != AVERROR_EOF)
               return RS_NOT_OK;
       }

       ret = avcodec_receive_frame(pCodecCtx, frame);
       if (ret < 0 && ret != AVERROR(EAGAIN))
       {
           return RS_NOT_OK;
       }
       if (ret >= 0)
           *frameFinished = 1;

       return RS_OK;
    }

    My question is focus in line of code SkipThisFrame ***, this algorithm skip frame continuously, so it maybe make the decoder on Client occur unexpectedly error or Crash ?

    And when skip frame like that, make Client Render frames is not normally ?

    And someone call show me the proper algorithm to skip frames in my case ?

    Thank you very much !

  • FFmpeg ignores some HTTP options when using the PUT method

    6 mars 2020, par mehdi.r

    I am using FFmpeg to create a CMAF stream and I upload it to an AWS resource (AWS MediaStore) using the PUT method of FFMpeg.
    I need to pass the Content-Type header when uploading manifests & segments.
    I have 3 type of files :

    application/x-mpegURL : m3u8 manifest

    application/dash+xml : mpd manifest

    video/mp4 : video segments

    Currently, all the types are set to Binary - octet-stream in the AWS resource (AWS MediaStore).
    As I will upload a huge number of files, I can’t use AWS Lambda functions to set the correct content type after a file as been uploaded.

    FFmpeg upload logs

    [https @ 0x555fe7a7d1c0] Opening 'https://XXXX.YYYY.amazonaws.com/chunk-stream0-00001.mp4' for writing
    [https @ 0x555fe7a7d0c0] request: PUT /chunk-stream0-00001.mp4 HTTP/1.1
    Transfer-Encoding: chunked
    User-Agent: Lavf/58.28.100
    Accept: */*
    Connection: keep-alive
    Host: XXXXX.YYYY.amazonaws.com
    Icy-MetaData: 1

    My tries

    I tried static builds & master branch of FFMpeg.
    I tried different ways to pass the content type, without success :

    -mime_type 1 -headers "Content-type: video/mp4\r\n"

    -mime_type "video/mp4,application/dash+xml,application/x-mpegURL"

    -content_type application/dash+xml

    -multiple_requests 1  -headers "a:b" -icy 0

    Upload command :

    ./ffmpeg -re -i ~/videos/BigBuckBunny.mp4 -loglevel debug \
     -map 0 -map 0 -map 0 -c:a aac -c:v libx264 -tune zerolatency \
     -b:v:0 2000k -s:v:0 1280x720 -profile:v:0 high -b:v:1 1500k -s:v:1 640x340  -profile:v:1 main -b:v:2 500k -s:v:2 320x170  -profile:v:2 baseline -bf 1 \
    -keyint_min 24 -g 24 -sc_threshold 0 -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 -window_size 5 \
    -adaptation_sets "id=0,streams=v id=1,streams=a" -hls_playlist 1 -seg_duration 3 -streaming 1 \
    -strict experimental -lhls 1 -remove_at_exit 0 -master_m3u8_publish_rate 3 \
    -f dash -method PUT -http_persistent 1  https://example.com/manifest.mpd

    Any help would be highly appreciated.

    Reference :
    https://www.ffmpeg.org/ffmpeg-protocols.html#http