Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (78)

  • 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 ;

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

Sur d’autres sites (8888)

  • avcodec : add external enc libvvenc for H266/VVC

    5 juin 2024, par Thomas Siedel
    avcodec : add external enc libvvenc for H266/VVC
    

    Add external encoder VVenC for H266/VVC encoding.
    Register new encoder libvvenc.
    Add libvvenc to wrap the vvenc interface.
    libvvenc implements encoder option : preset,qp,qpa,period,
    passlogfile,stats,vvenc-params,level,tier.
    Enable encoder by adding —enable-libvvenc in configure step.

    Co-authored-by : Christian Bartnik chris10317h5@gmail.com
    Signed-off-by : Thomas Siedel <thomas.ff@spin-digital.com>

    • [DH] Changelog
    • [DH] configure
    • [DH] doc/encoders.texi
    • [DH] fftools/ffmpeg_mux_init.c
    • [DH] libavcodec/Makefile
    • [DH] libavcodec/allcodecs.c
    • [DH] libavcodec/libvvenc.c
    • [DH] libavcodec/version.h
  • ffmpeg audio output in iOS

    19 septembre 2015, par user3249421

    Good day,

    I have own project which using iFrameExtraktor (https://github.com/lajos/iFrameExtractor). I modified initWithVideo method to :

    -(id)initWithVideo:(NSString *)moviePath imgView: (UIImageView *)imgView {
    if (!(self=[super init])) return nil;

    AVCodec         *pCodec;
    AVCodec         *aCodec;

    // Register all formats and codecs
    avcodec_register_all();
    av_register_all();

    imageView = imgView;

    // Open video file
    if(avformat_open_input(&amp;pFormatCtx, [moviePath cStringUsingEncoding:NSASCIIStringEncoding], NULL, NULL) != 0) {
       av_log(NULL, AV_LOG_ERROR, "Couldn't open file\n");
       goto initError;
    }

    // Retrieve stream information
    if(avformat_find_stream_info(pFormatCtx,NULL) &lt; 0) {
       av_log(NULL, AV_LOG_ERROR, "Couldn't find stream information\n");
       goto initError;
    }

    // Find the first video stream
    if ((videoStream =  av_find_best_stream(pFormatCtx, AVMEDIA_TYPE_VIDEO, -1, -1, &amp;pCodec, 0)) &lt; 0) {
       av_log(NULL, AV_LOG_ERROR, "Cannot find a video stream in the input file\n");
       goto initError;
    }

    if((audioStream = av_find_best_stream(pFormatCtx, AVMEDIA_TYPE_AUDIO, -1, -1, &amp;aCodec, 0)) &lt; 0 ){
       av_log(NULL, AV_LOG_ERROR, "Cannot find a audio stream in the input file\n");
       goto initError;
    }

    // Get a pointer to the codec context for the video stream
    pCodecCtx = pFormatCtx->streams[videoStream]->codec;
    aCodecCtx = pFormatCtx->streams[audioStream]->codec;

    // Find the decoder for the video stream
    pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
    if(pCodec == NULL) {
       av_log(NULL, AV_LOG_ERROR, "Unsupported video codec!\n");
       goto initError;
    }

    aCodec = avcodec_find_decoder(aCodecCtx->codec_id);
    if(aCodec == NULL) {
       av_log(NULL, AV_LOG_ERROR, "Unsupported audio codec!\n");
       goto initError;
    }

    // Open codec
    if(avcodec_open2(pCodecCtx, pCodec, NULL) &lt; 0) {
       av_log(NULL, AV_LOG_ERROR, "Cannot open video decoder\n");
       goto initError;
    }

    if(avcodec_open2(aCodecCtx, aCodec, NULL) &lt; 0){
       av_log(NULL, AV_LOG_ERROR, "Cannot open audio decoder\n");
       goto initError;
    }

    // Allocate video frame
    pFrame = av_frame_alloc();

    outputWidth = pCodecCtx->width;
    self.outputHeight = pCodecCtx->height;

    lastFrameTime = -1;
    [self seekTime:0.0];

    return self;

    initError:
       //[self release];
       return nil;
    }

    Video rendering works fine, but I don’t know how play audio to device output.

    Thanks for any tips.

  • Issues Streaming FLV Video from RTSP using FFmpeg and Python to flv.js

    14 juin 2024, par yternal

    I am currently working on a project where I need to stream video from an RTSP source, convert it to FLV format using FFmpeg, and then send the FLV stream to clients upon request. The code I have written to achieve this is as follows :

    &#xA;

    import subprocess&#xA;from flask import Flask, Response, stream_with_context&#xA;&#xA;app = Flask(__name__)&#xA;&#xA;flv_header = b&#x27;&#x27;&#xA;&#xA;def update_stream(ffmpeg_path="ffmpeg", rtsp_url=&#x27;rtsp://192.168.1.168/0&#x27;, rtsp_id="rtsp01"):&#xA;    global flv_header&#xA;&#xA;    command = [&#xA;        ffmpeg_path,&#xA;        &#x27;-i&#x27;, rtsp_url,&#xA;        &#x27;-c:v&#x27;, &#x27;libx264&#x27;,&#xA;        &#x27;-c:a&#x27;, &#x27;aac&#x27;,&#xA;        &#x27;-b:v&#x27;, &#x27;1M&#x27;,&#xA;        &#x27;-g&#x27;, &#x27;30&#x27;,&#xA;        &#x27;-preset&#x27;, &#x27;ultrafast&#x27;,&#xA;        &#x27;-bsf:v&#x27;, &#x27;dump_extra&#x27;,&#xA;        &#x27;-f&#x27;, &#x27;flv&#x27;,&#xA;        &#x27;-&#x27;&#xA;    ]&#xA;    process = subprocess.Popen(&#xA;        command,&#xA;        stdout=subprocess.PIPE,&#xA;        stderr=subprocess.PIPE&#xA;    )&#xA;    flv_header = process.stdout.read(1024)&#xA;    while True:&#xA;        data = process.stdout.read(1024)&#xA;        if not data:&#xA;            break&#xA;        producer.notify(rtsp_id, data)&#xA;&#xA;@app.route(&#x27;/flv//&#x27;)&#xA;def flv_stream(user_id, rtsp_id):&#xA;    try:&#xA;        consumer_queue = producer.register(user_id, rtsp_id)&#xA;&#xA;        @stream_with_context&#xA;        def generate():&#xA;            yield flv_header&#xA;            while True:&#xA;                yield consumer_queue.get()&#xA;&#xA;        response = Response(generate(), mimetype=&#x27;video/x-flv&#x27;)&#xA;        response.headers.add(&#x27;Access-Control-Allow-Origin&#x27;, &#x27;*&#x27;)  # Allow all origins&#xA;        response.headers.add(&#x27;Access-Control-Allow-Methods&#x27;, &#x27;*&#x27;)  # Allow all HTTP methods&#xA;        response.headers.add(&#x27;Access-Control-Allow-Headers&#x27;, &#x27;Content-Type&#x27;)  # Allow specific headers&#xA;        return response&#xA;    except Exception as e:&#xA;        print(f&#x27;{e}&#x27;)&#xA;

    &#xA;

    In order to handle initial playback issues in FFplay and VLC, I save the first 1024 bytes of the FLV stream and send this header before streaming the actual data. This workaround allows playback in FFplay and VLC, but it does not work with flv.js.

    &#xA;

    When attempting to play the stream using flv.js, the stream keeps loading indefinitely, and the console outputs warnings like :

    &#xA;

    flv.min.js:9 [FLVDemuxer] > Invalid PrevTagSize 3491417133&#xA;[FLVDemuxer] > Unsupported tag type 204, skipped&#xA;

    &#xA;

    I have tried several modifications to the FFmpeg command, including adding parameters such as -bsf:v dump_extra, but none of these changes have resolved the issue. My expectation is that the FLV stream would play smoothly in flv.js just as it does in FFplay and VLC.

    &#xA;