Recherche avancée

Médias (0)

Mot : - Tags -/configuration

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (83)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • 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" (...)

Sur d’autres sites (15315)

  • Are there any resources listing current codecs and formats not supported by FFmpeg ?

    4 mars 2020, par Alexander Swann

    We are building a service where we do not know what format/codec a video uploaded by a user is in. Due to the nature of the application, we expect input video formats to be very fragmented, diverse and niche. We are currently using FFmpeg to transcode input formats to a consistent output (e.g. mp4).

    Due to the above scenario, I would like to establish a general list of what formats and codecs are not currently supported by FFmpeg. This is so I can research other open source video transcoding tools which I can utilise to fill in the gaps and allow our service to be more reliable for the user.

    Are there resources online that can help at least get a general idea of what might not be supported by FFmpeg ?

  • How do I write to a file in Golang using a pointer to the C data ?

    20 juillet 2020, par nevernew

    I'm writing an app for the windows platform using FFmpeg and it's golang wrapper goav, but I'm having trouble understanding how to use the C pointers to gain access to an array.

    



    I'm trying to write the frame data, pointed to by a uint8 pointer from C, to a .ppm file in golang.

    



    Once I have this done, for proof of concept that FFmpeg is doing what I expect it to, I want to set the frames to a texture in OpenGl to make a video player with cool transitions ; any pointers to do that nice and efficiently would be so very helpful ! I'm guessing I need to write some shader code to draw the ppm as a texture...

    



    The PPM file structure looks pretty simple just the header and then a byte of data for each red, green and blue value of each pixel in the frame from top left to bottom right

    



    I'm starting to understanding how to cast the pointers between C and Go types, but how can I access the data and write it in Go with the same result as C ? In C I just have to set the pointer offset for the data and state how much of it to write :

    



    for (y = 0; y < height; y++) {
    fwrite(pFrame->data[0]+y*pFrame->linesize[0], 1, width*3, pFile);
}


    



    I've stripped out all the relevant parts of the C code, the wrapper and my code, shown below :

    



    C code - libavutil/frame.h

    



    #include 

typedef struct AVFrame {
#define AV_NUM_DATA_POINTERS 8
    uint8_t *data[AV_NUM_DATA_POINTERS];
    int linesize[AV_NUM_DATA_POINTERS];
}


    



    Golang goav wrapper

    



    package avutil&#xA;&#xA;/*&#xA;    #cgo pkg-config: libavutil&#xA;    #include <libavutil></libavutil>frame.h>&#xA;    #include &#xA;*/&#xA;import "C"&#xA;import (&#xA;    "unsafe"&#xA;)&#xA;&#xA;type Frame C.struct_AVFrame&#xA;&#xA;func Data(f *Frame) *uint8 {&#xA;    return (*uint8)(unsafe.Pointer((*C.uint8_t)(unsafe.Pointer(&amp;f.data))))&#xA;}&#xA;func Linesize(f *Frame) int {&#xA;    return int(*(*C.int)(unsafe.Pointer(&amp;f.linesize)))&#xA;}&#xA;

    &#xA;&#xA;

    My Golang code

    &#xA;&#xA;

    package main&#xA;&#xA;import "github.com/giorgisio/goav/avutil"&#xA;&#xA;func saveFrame(videoFrame *avutil.Frame, width int, height int, iFrame int) {&#xA;    var szFilename string&#xA;    var y int&#xA;    var file *os.File&#xA;    var err error&#xA;&#xA;    szFilename = ""&#xA;&#xA;    // Open file&#xA;    szFilename = fmt.Sprintf("frame%d.ppm", iFrame)&#xA;&#xA;    if file, err = os.Create(szFilename); err != nil {&#xA;        log.Println("Error Reading")&#xA;    }&#xA;&#xA;    // Write header&#xA;    fh := []byte(fmt.Sprintf("P6\n%d %d\n255\n", width, height))&#xA;    file.Write(fh)&#xA;    var b byte = 0&#xA;    // Write pixel data&#xA;    for y = 0; y &lt; height; y&#x2B;&#x2B; {&#xA;        d := avutil.Data(videoFrame) // d should be a pointer to the first byte of data&#xA;        l := avutil.Linesize(videoFrame)&#xA;&#xA;        // I&#x27;m basically lost trying to figure out how to correctly write&#xA;        // this to a file, the file is created, but when I open it in GIMP&#xA;        // the image is mostly black with glitchy fuzz - so it&#x27;s not being&#xA;        // written properly; the header seems to be ok, it knows the height&#xA;        // and width at least.&#xA;&#xA;        data := make([]byte, l*3)&#xA;&#xA;        ptr := unsafe.Pointer(d)&#xA;        for i := 0; i &lt; l; i&#x2B;&#x2B; {&#xA;            datum := (*uint8)(unsafe.Pointer(uintptr(ptr) &#x2B; (uintptr(i)&#x2B;(uintptr(y)*uintptr(l)))*unsafe.Sizeof(*d)))&#xA;            data = append(data, *datum)&#xA;            //fmt.Println(*datum)&#xA;        }&#xA;&#xA;        n, err := file.Write(data)&#xA;        if err != nil {&#xA;            log.Println("Error Writing:", szFilename, "-", n)&#xA;        }&#xA;    }&#xA;&#xA;    file.Close()&#xA;}&#xA;

    &#xA;&#xA;

    So, how can I write to a file using a pointer to the data, like you can do in C, and get the same result ?

    &#xA;&#xA;

    The first frame should be black so all 0's but I'm getting a glitchy fuzz, so it must be accessing some random data

    &#xA;&#xA;

    Update : My fix using a C function to save :

    &#xA;&#xA;

    package avutil&#xA;&#xA;/*&#xA;    #cgo pkg-config: libavutil&#xA;    #include <libavutil></libavutil>frame.h>&#xA;    #include &#xA;    #include &#xA;&#xA;    void SaveFrame(const char* location, AVFrame *pFrame, int width, int height) {&#xA;        FILE *pFile;&#xA;        int  y;&#xA;&#xA;        // Open file&#xA;        pFile=fopen(location, "wb");&#xA;        if(pFile==NULL)&#xA;            return;&#xA;&#xA;        // Write header&#xA;        fprintf(pFile, "P6\n%d %d\n255\n", width, height);&#xA;&#xA;        // Write pixel data&#xA;        for(y=0; ydata[0]&#x2B;y*pFrame->linesize[0], 1, width*3, pFile);&#xA;&#xA;        // Close file&#xA;        fclose(pFile);&#xA;    }&#xA;    uint8_t* GetData(AVFrame *pFrame) {&#xA;        return pFrame->data[0];&#xA;    }&#xA;*/&#xA;import "C"&#xA;

    &#xA;&#xA;

    I updated the avutil file, in the goav wrapper package, with this save function at the top, then pass it the frame context so it can get the data pointer from it. I also added this Go function to that avutil file to call the C function

    &#xA;&#xA;

    func SaveFrame(location string, f *Frame, width int, height int) {&#xA;    csLoc := C.CString(location)&#xA;    C.SaveFrame(csLoc, (*C.struct_AVFrame)(unsafe.Pointer(f)), C.int(width), C.int(height))&#xA;    C.free(unsafe.Pointer(csLoc))&#xA;}&#xA;

    &#xA;

  • libav ffmpeg - streaming from both a mkv and input stream

    20 janvier 2020, par kealist

    I am trying to use ffmpeg libraries in C# with AutoGen bindings. The overall issue is that I am taking a collection of sources, some streams, and some .mkv containing recordings of a stream. As for now, they are all h264 and only video. For input streams, I am able to adjust the packets and broad cast them and that works fine, but any time I try to call av_interleaved_write_frame with packets from the MKV file, I get the error Error occurred: Invalid data found when processing input.

    Here is the main loop, where the error happens for mkv files. Is there an extra step ?

    /* read all packets */
    while (true)
    {
       if ((ret = ffmpeg.av_read_frame(ifmt_ctx, &amp;packet)) &lt; 0)
       {
           Console.WriteLine("Unable to read packet");
           break;
       }
       stream_index = (uint)packet.stream_index;
       type = ifmt_ctx->streams[packet.stream_index]->codecpar->codec_type;
       Console.WriteLine($"Demuxer gave frame of stream_index %{stream_index}");


       /* remux this frame without reencoding */
       ffmpeg.av_packet_rescale_ts(&amp;packet,
           ifmt_ctx->streams[stream_index]->time_base,
           ofmt_ctx->streams[stream_index]->time_base);

       if (packet.stream_index &lt; 0)
       {
           Console.WriteLine("Packet stream error");
       }



       ret = ffmpeg.av_write_frame(ofmt_ctx, &amp;packet);
       if (ret &lt; 0)
       {
           goto end;
       }
       else
       {
           ffmpeg.av_packet_unref(&amp;packet);
       }
    }

    Anything need to be different for MKV files ?

    I get some contradictory error output where it claims it is annex b but also isn’t :

    [AVBSFContext @ 00000220eb657080] The input looks like it is Annex B already
    Automatically inserted bitstream filter 'h264_mp4toannexb'; args=''
    [mpegts @ 00000220ebace300] H.264 bitstream malformed, no startcode found, use the video bitstream filter 'h264_mp4toannexb' to fix it ('-bsf:v h264_mp4toannexb' option with ffmpeg)

    Verbose output from ffplay from an MKV file :

    ffplay version git-2020-01-13-7225479 Copyright (c) 2003-2020 the FFmpeg developers
     built with gcc 9.2.1 (GCC) 20200111
     configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
     libavutil      56. 38.100 / 56. 38.100
     libavcodec     58. 65.103 / 58. 65.103
     libavformat    58. 35.102 / 58. 35.102
     libavdevice    58.  9.103 / 58.  9.103
     libavfilter     7. 71.100 /  7. 71.100
     libswscale      5.  6.100 /  5.  6.100
     libswresample   3.  6.100 /  3.  6.100
     libpostproc    55.  6.100 / 55.  6.100
    Initialized direct3d renderer.
    [h264 @ 00000165ed18d140] Reinit context to 640x480, pix_fmt: yuv444p
    Input #0, matroska,webm, from '.\webcam_14_Test1.mkv':   0B f=0/0
     Metadata:
       ENCODER         : Lavf58.12.100
     Duration: 00:00:39.30, start: 0.000000, bitrate: 1943 kb/s
       Stream #0:0: Video: h264 (High 4:4:4 Predictive), 1 reference frame, yuv444p(progressive, left), 640x480 [SAR 1:1 DAR 4:3], 1k fps, 30 tbr, 1k tbn, 60 tbc (default)
       Metadata:
         DURATION        : 00:00:39.299000000
    [h264 @ 00000165f424e200] Reinit context to 640x480, pix_fmt: yuv444p
    [ffplay_buffer @ 00000165f52ea840] w:640 h:480 pixfmt:yuv444p tb:1/1000 fr:30/1 sar:1/1
    [auto_scaler_0 @ 00000165ed1d2c80] w:iw h:ih flags:'bicubic' interl:0
    [ffplay_buffersink @ 00000165f424ef00] auto-inserting filter 'auto_scaler_0' between the filter 'ffplay_buffer' and the filter 'ffplay_buffersink'
    [auto_scaler_0 @ 00000165ed1d2c80] w:640 h:480 fmt:yuv444p sar:1/1 -> w:640 h:480 fmt:yuv420p sar:1/1 flags:0x4
    Created 640x480 texture with SDL_PIXELFORMAT_IYUV.
    [AVIOContext @ 00000165ed179a40] Statistics: 9547965 bytes read, 0 seeks