Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (47)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (6562)

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

    24 avril 2018, 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...

    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

    /*
       #cgo pkg-config: libavutil
       #include <libavutil></libavutil>frame.h>
       #include
    */
    import "C"
    import (
       "unsafe"
    )

    type Frame C.struct_AVFrame

    func Data(f *Frame) *uint8 {
       return (*uint8)(unsafe.Pointer((*C.uint8_t)(unsafe.Pointer(&amp;f.data))))
    }
    func Linesize(f *Frame) int {
       return int(*(*C.int)(unsafe.Pointer(&amp;f.linesize)))
    }

    My Golang code

    package main

    import "github.com/giorgisio/goav/avutil"

    func saveFrame(videoFrame *avutil.Frame, width int, height int, iFrame int) {
       var szFilename string
       var y int
       var file *os.File
       var err error

       szFilename = ""

       // Open file
       szFilename = fmt.Sprintf("frame%d.ppm", iFrame)

       if file, err = os.Open(szFilename); err != nil {
           log.Println("Error Reading")
       }

       // Write header
       fh := []byte(fmt.Sprintf("P6\n%d %d\n255\n", width, height))
       file.Write(fh)
       var b byte = 0
       // Write pixel data
       for y = 0; y &lt; height; y++ {
           d := avutil.Data(videoFrame) // d should be a pointer to the first byte of data
           l := avutil.Linesize(videoFrame)

           // I'm basically lost trying to figure out how to write this to a file
           data := make([]byte, width*3)

           addr := int(*d) + y*l // figure out the address

           for i := 0; i &lt; l; i++ {
               // This is where I'm having the problem, I get an "invalid
               // memory address or nil pointer dereference" error
               byteArrayPtr := (*byte)(unsafe.Pointer(uintptr(addr) + uintptr(i)*unsafe.Sizeof(b)))
               data = append(data, *byteArrayPtr)
               fmt.Println(*byteArrayPtr)
           }
           file.Write(data)
       }

       file.Close()
    }

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

  • ffmpeg.exe - receiving audio and video data from C#

    9 janvier 2017, par LTR

    I can encode raw frames to video with ffmpeg.exe like this :

    proc = new Process();
    proc.StartInfo.FileName = @"ffmpeg.exe";
    proc.StartInfo.Arguments = String.Format("-f image2pipe -i pipe:.bmp -r 24 -c:v libx264 -an output_video.mp4");
    foreach (Bitmap frame in frames)
       frame.Save(proc.StandardInput.BaseStream, ImageFormat.Bmp);

    Now, I’m sending the image data through the stdin. How can I also add some audio data ? I’m pretty sure I cannot send both via the stdin !

    Saving audio to a separate file and then merging is an ugly solution, as it requires twice the diskspace.

    PS : I need to use ffmpeg.exe as a standalone process, for licensing reasons.

  • embed video stream with custom meta data

    15 mai 2022, par Sergey Kolesnik

    I have an optical system that provides a UDP video stream.

    &#xA;

    From device specification FAQ :

    &#xA;

    &#xA;

    Both single metadata (KLV) stream and compressed video (H.264) with metadata (KLV) are available on Ethernet link. Compressed video and metadata are coupled in the same stream compliant with STANAG 4609 standard. Each encoded video stream is encapsulated with the associated metadata within an MPEG-TS single program stream over Ethernet UDP/IP/ The video and metadata are synchronized through the use of timestamps.

    &#xA;

    &#xA;

    Also there are other devices that provide data about the state of an aircraft (velocity, coords, etc). This data should be displayed on a client GUI display alongside with video. Of course it has to be synchronized with the current video frame.

    &#xA;

    One of the approaches I though of is to embed this data into the video stream. But I am not sure if it is possible or should I use another (than UDP) protocol for this purpose.

    &#xA;

    Is it possible/reasonable to use such approach ? Is ffmpeg library suitable in this case ?&#xA;If not, what are the other ways to synchronize data with a video frame.&#xA;Latency is crucial. Although bandwidth is limited to 2-5 Mbps.

    &#xA;


    &#xA;

    It seems to be possible using ffmpeg : AVPacket can be provided with additional data using function av_packet_add_side_data which takes a preallocated buffer, size and a type AVPacketSideDataType.&#xA;However, I am not sure for now, which enum value of AVPacketSideDataType can be used for custom user-provided binary data.

    &#xA;

    Something similar that might be used for my needs :

    &#xA;

    How do I encode KLV packets to an H.264 video using libav*

    &#xA;