Recherche avancée

Médias (91)

Autres articles (41)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Création définitive du canal

    12 mars 2010, par

    Lorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
    A la validation, vous recevez un email vous invitant donc à créer votre canal.
    Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
    A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)

  • MediaSPIP Init et Diogène : types de publications de MediaSPIP

    11 novembre 2010, par

    À l’installation d’un site MediaSPIP, le plugin MediaSPIP Init réalise certaines opérations dont la principale consiste à créer quatre rubriques principales dans le site et de créer cinq templates de formulaire pour Diogène.
    Ces quatre rubriques principales (aussi appelées secteurs) sont : Medias ; Sites ; Editos ; Actualités ;
    Pour chacune de ces rubriques est créé un template de formulaire spécifique éponyme. Pour la rubrique "Medias" un second template "catégorie" est créé permettant d’ajouter (...)

Sur d’autres sites (4952)

  • Using GStreamer to receive and send h264 video (from OBS)

    16 mars 2020, par Ivorius

    I’ve been trying to set up using GStreamer to get support for some input I can output from OBS.

    OBS : rtp_mpegts to udp ://localhost:5000

    http-launch 8080 webmmux streamable=true name=stream udpsrc uri=udp://localhost:5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T-ES, payload=(int)
    33" ! gstrtpjitterbuffer latency=200 ! application/x-rtp ! rtpmp2tdepay ! video/mpegts ! mpegtsdemux ! video/x-h264 ! queue ! decodebin ! vp8enc ! stream.   audiotestsrc ! vorbisenc ! stream.

    However, using this it seems to accept connections, but just closes them again after a while. Any clues on what I am doing wrong ? I am open to any format changes as long as they’re supported by OBS / ffmpeg.

    As a bonus, how do I add support for audio as well ?

    Background

    I’ve found https://github.com/sdroege/http-launch, which works well in displaying a GStreamer video over http:

    <video autoplay="autoplay" controls="">
       <source src="https://localhost:8080" type="video/mp4" codecs="avc1.4D401E, mp4a.40.2">
       You browser doesn't support element <code>video

    .

    I’ve managed to set up a pipeline where I can use a GStreamer source to pipe into a http-launch
    pipeline and display it on video :

    http-launch 8080 webmmux streamable=true name=stream udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! mpegtsdemu
    x ! h264parse ! TIViddec2 ! videoconvert ! vp8enc ! stream.   audiotestsrc ! vorbisenc ! stream.

    gst-launch-1.0 -v videotestsrc ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000

    However, I don’t think OBS supports rpt over UDP. It uses ffmpeg to send these packets, which can stream rtp_mpegts. I’ve found some code snippets which claim to support the format, and stitch together the above pipeline.

  • Rotating a video during encoding with ffmpeg and libav API results in half of video corrupted

    11 mai 2020, par Daniel Kobe

    I'm using the C API for ffmpeg/libav to rotate a vertically filmed iphone video during the encoding step. There are other questions asking to do a similar thing but they are all using the CLI tool to do so.

    &#xA;&#xA;

    So far I was able to figure out how to use the AVFilter to rotate the video, base off this example https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/filtering_video.c

    &#xA;&#xA;

    The problem is that half the output file is corrupt.&#xA;Corrupt Video Screenshot

    &#xA;&#xA;

    Here is the code for my encoding logic. Its written with GOLANG using CGO to interface with the C API.

    &#xA;&#xA;

    // Encode encode an AVFrame and return it&#xA;func Encode(enc Encoder, frame *C.AVFrame) (*EncodedFrame, error) {&#xA;    ctx := enc.Context()&#xA;&#xA;    if ctx.buffersrcctx == nil {&#xA;        // initialize filter&#xA;        outputs := C.avfilter_inout_alloc()&#xA;        inputs  := C.avfilter_inout_alloc()&#xA;        m_pFilterGraph := C.avfilter_graph_alloc()&#xA;        buffersrc := C.avfilter_get_by_name(C.CString("buffer"))&#xA;        argsStr := fmt.Sprintf("video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", ctx.avctx.width, ctx.avctx.height, ctx.avctx.pix_fmt, ctx.avctx.time_base.num, ctx.avctx.time_base.den, ctx.avctx.sample_aspect_ratio.num, ctx.avctx.sample_aspect_ratio.den)&#xA;        Log.Info.Println("yakotest")&#xA;        Log.Info.Println(argsStr)&#xA;        args := C.CString(argsStr)&#xA;        ret := C.avfilter_graph_create_filter(&amp;ctx.buffersrcctx, buffersrc, C.CString("my_buffersrc"), args, nil, m_pFilterGraph)&#xA;        if ret &lt; 0 {&#xA;            Log.Info.Printf("\n problem creating filter %v\n", AVError(ret).Error())&#xA;        }&#xA;&#xA;        buffersink := C.avfilter_get_by_name(C.CString("buffersink"))&#xA;        ret = C.avfilter_graph_create_filter(&amp;ctx.buffersinkctx, buffersink, C.CString("my_buffersink"), nil, nil, m_pFilterGraph)&#xA;        if ret &lt; 0 {&#xA;            Log.Info.Printf("\n problem creating filter %v\n", AVError(ret).Error())&#xA;        }&#xA;&#xA;        /*&#xA;         * Set the endpoints for the filter graph. The filter_graph will&#xA;         * be linked to the graph described by filters_descr.&#xA;         */&#xA;&#xA;        /*&#xA;         * The buffer source output must be connected to the input pad of&#xA;         * the first filter described by filters_descr; since the first&#xA;         * filter input label is not specified, it is set to "in" by&#xA;         * default.&#xA;         */&#xA;        outputs.name       = C.av_strdup(C.CString("in"))&#xA;        outputs.filter_ctx = ctx.buffersrcctx&#xA;        outputs.pad_idx    = 0&#xA;        outputs.next       = nil&#xA;&#xA;        /*&#xA;         * The buffer sink input must be connected to the output pad of&#xA;         * the last filter described by filters_descr; since the last&#xA;         * filter output label is not specified, it is set to "out" by&#xA;         * default.&#xA;         */&#xA;        inputs.name       = C.av_strdup(C.CString("out"))&#xA;        inputs.filter_ctx = ctx.buffersinkctx&#xA;        inputs.pad_idx    = 0&#xA;        inputs.next       = nil&#xA;&#xA;        ret = C.avfilter_graph_parse_ptr(m_pFilterGraph, C.CString("transpose=clock,scale=-2:1080"),&#xA;            &amp;inputs, &amp;outputs, nil)&#xA;        if ret &lt; 0 {&#xA;            Log.Info.Printf("\n problem with avfilter_graph_parse %v\n", AVError(ret).Error())&#xA;        }&#xA;&#xA;        ret = C.avfilter_graph_config(m_pFilterGraph, nil)&#xA;        if ret &lt; 0 {&#xA;            Log.Info.Printf("\n problem with graph config %v\n", AVError(ret).Error())&#xA;        }&#xA;    }&#xA;&#xA;    filteredFrame :=  C.av_frame_alloc()&#xA;&#xA;    /* push the decoded frame into the filtergraph */&#xA;    ret := C.av_buffersrc_add_frame_flags(ctx.buffersrcctx, frame, C.AV_BUFFERSRC_FLAG_KEEP_REF)&#xA;    if ret &lt; 0 {&#xA;        Log.Error.Printf("\nError while feeding the filter greaph, err = %v\n", AVError(ret).Error())&#xA;        return nil, errors.New(ErrorFFmpegCodecFailure)&#xA;    }&#xA;&#xA;    /* pull filtered frames from the filtergraph */&#xA;    for {&#xA;        ret = C.av_buffersink_get_frame(ctx.buffersinkctx, filteredFrame)&#xA;        if ret == C.AVERROR_EAGAIN || ret == C.AVERROR_EOF {&#xA;            break&#xA;        }&#xA;        if ret &lt; 0 {&#xA;            Log.Error.Printf("\nCouldnt find a frame, err = %v\n", AVError(ret).Error())&#xA;            return nil, errors.New(ErrorFFmpegCodecFailure)&#xA;        }&#xA;&#xA;        filteredFrame.pts = frame.pts&#xA;        frame = filteredFrame&#xA;        defer C.av_frame_free(&amp;filteredFrame)&#xA;    }&#xA;&#xA;    if frame != nil {&#xA;        frame.pict_type = 0 // reset pict type for the encoder&#xA;        if C.avcodec_send_frame(ctx.avctx, frame) != 0 {&#xA;            Log.Error.Printf("%&#x2B;v\n", StackErrorf("codec error, could not send frame"))&#xA;            return nil, errors.New(ErrorFFmpegCodecFailure)&#xA;        }&#xA;    }&#xA;&#xA;    for {&#xA;        ret := C.avcodec_receive_packet(ctx.avctx, ctx.pkt)&#xA;        if ret == C.AVERROR_EAGAIN {&#xA;            break&#xA;        }&#xA;        if ret == C.AVERROR_EOF {&#xA;            return nil, fmt.Errorf("EOF")&#xA;        }&#xA;        if ret &lt; 0 {&#xA;            Log.Error.Printf("%&#x2B;v\n", StackErrorf("codec error, receiving packet"))&#xA;            return nil, errors.New(ErrorFFmpegCodecFailure)&#xA;        }&#xA;&#xA;        data := C.GoBytes(unsafe.Pointer(ctx.pkt.data), ctx.pkt.size)&#xA;        return &amp;EncodedFrame{data, int64(ctx.pkt.pts), int64(ctx.pkt.dts),&#xA;            (ctx.pkt.flags &amp; C.AV_PKT_FLAG_KEY) != 0}, nil&#xA;    }&#xA;&#xA;    return nil, nil&#xA;}&#xA;

    &#xA;&#xA;

    It seems like I need to do something with the scaling here but I'm struggling to find helpful information online.

    &#xA;

  • VLC stops video before the end of video encoded with h264

    12 mai 2020, par user2342558

    VLC stops video before the end of video and prints this in terminal :

    &#xA;&#xA;

    [h264 @ 0x7ff318ce36c0] co located POCs unavailable&#xA;[h264 @ 0x7ff318ce36c0] mmco: unref short failure&#xA;[h264 @ 0x7ff318c7f0c0] co located POCs unavailable&#xA;[h264 @ 0x7ff318c9da60] mmco: unref short failure&#xA;[h264 @ 0x7ff318ce36c0] co located POCs unavailable&#xA;[h264 @ 0x7ff318cff780] mmco: unref short failure&#xA;[h264 @ 0x7ff318d37b00] co located POCs unavailable&#xA;[h264 @ 0x7ff318c7f0c0] co located POCs unavailable&#xA;[h264 @ 0x7ff318c9da60] mmco: unref short failure&#xA;[h264 @ 0x7ff318cff780] co located POCs unavailable&#xA;[h264 @ 0x7ff318d37b00] co located POCs unavailable&#xA;[h264 @ 0x7ff318c7f0c0] mmco: unref short failure&#xA;[h264 @ 0x7ff318ce36c0] co located POCs unavailable&#xA;[h264 @ 0x7ff318d1b900] co located POCs unavailable&#xA;[h264 @ 0x7ff318d37b00] mmco: unref short failure&#xA;[h264 @ 0x7ff318cff780] mmco: unref short failure&#xA;[h264 @ 0x7ff318d1b900] mmco: unref short failure&#xA;[h264 @ 0x7ff318c9da60] co located POCs unavailable&#xA;[h264 @ 0x7ff318ce36c0] co located POCs unavailable&#xA;[h264 @ 0x7ff318d37b00] mmco: unref short failure&#xA;[00007ff318c6a260] main decoder error: Timestamp conversion failed for 24718094: no reference clock&#xA;[00007ff318c6a260] main decoder error: Could not convert timestamp 0 for FFmpeg&#xA;[00007ff318c6a260] main decoder error: Timestamp conversion failed for 34926677: no reference clock&#xA;[00007ff318c6a260] main decoder error: Could not convert timestamp 0 for FFmpeg&#xA;[00007ff318c6a260] main decoder error: Timestamp conversion failed for 45796649: no reference clock&#xA;[00007ff318c6a260] main decoder error: Could not convert timestamp 0 for FFmpeg&#xA;[h264 @ 0x7ff318d1b900] co located POCs unavailable&#xA;[h264 @ 0x7ff318d37b00] mmco: unref short failure&#xA;[h264 @ 0x7ff318d37b00] co located POCs unavailable&#xA;[h264 @ 0x7ff318c7f0c0] mmco: unref short failure&#xA;[h264 @ 0x7ff318ce36c0] co located POCs unavailable&#xA;[h264 @ 0x7ff318cff780] mmco: unref short failure&#xA;[h264 @ 0x7ff318d1b900] co located POCs unavailable&#xA;[h264 @ 0x7ff318d37b00] mmco: unref short failure&#xA;[00007ff318c6a260] main decoder error: buffer deadlock prevented&#xA;

    &#xA;&#xA;

    I created the video file converting the original video with this command :

    &#xA;&#xA;

    ffmpeg -i video.mp4 -b 1000000 video_mod.mp4&#xA;

    &#xA;&#xA;

    The same file is played correctly using Firefox.

    &#xA;&#xA;

    I converted other video files with that command and Vlc can play them entirely.

    &#xA;&#xA;

    How to solve this error ?

    &#xA;&#xA;

    Thanks in advance !

    &#xA;