Recherche avancée

Médias (91)

Autres articles (36)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (2608)

  • How would I assign multiple MMAP's from single file descriptor ?

    9 juin 2011, par Alex Stevens

    So, for my final year project, I'm using Video4Linux2 to pull YUV420 images from a camera, parse them through to x264 (which uses these images natively), and then send the encoded stream via Live555 to an RTP/RTCP compliant video player on a client over a wireless network. All of this I'm trying to do in real-time, so there'll be a control algorithm, but that's not the scope of this question. All of this - except Live555 - is being written in C. Currently, I'm near the end of encoding the video, but want to improve performance.

    To say the least, I've hit a snag... I'm trying to avoid User Space Pointers for V4L2 and use mmap(). I'm encoding video, but since it's YUV420, I've been malloc'ing new memory to hold the Y', U and V planes in three different variables for x264 to read upon. I would like to keep these variables as pointers to an mmap'ed piece of memory.

    However, the V4L2 device has one single file descriptor for the buffered stream, and I need to split the stream into three mmap'ed variables adhering to the YUV420 standard, like so...

    buffers[n_buffers].y_plane = mmap(NULL, (2 * width * height) / 3,
                                       PROT_READ | PROT_WRITE, MAP_SHARED,
                                       fd, buf.m.offset);
    buffers[n_buffers].u_plane = mmap(NULL, width * height / 6,
                                       PROT_READ | PROT_WRITE, MAP_SHARED,
                                       fd, buf.m.offset +
                                       ((2 * width * height) / 3 + 1) /
                                       sysconf(_SC_PAGE_SIZE));
    buffers[n_buffers].v_plane = mmap(NULL, width * height / 6,
                                       PROT_READ | PROT_WRITE, MAP_SHARED,
                                       fd, buf.m.offset +
                                       ((2 * width * height) / 3 +
                                       width * height / 6 + 1) /
                                       sysconf(_SC_PAGE_SIZE));

    Where "width" and "height" is the resolution of the video (eg. 640x480).

    From what I understand... MMAP seeks through a file, kind of like this (pseudoish-code) :

    fd = v4l2_open(...);
    lseek(fd, buf.m.offset + (2 * width * height) / 3);
    read(fd, buffers[n_buffers].u_plane, width * height / 6);

    My code is located in a Launchpad Repo here (for more background) :
    http://bazaar.launchpad.net/ alex-stevens/+junk/spyPanda/files (Revision 11)

    And the YUV420 format can be seen clearly from this Wiki illustration : http://en.wikipedia.org/wiki/File:Yuv420.svg (I essentially want to split up the Y, U, and V bytes into each mmap'ed memory)

    Anyone care to explain a way to mmap three variables to memory from the one file descriptor, or why I went wrong ? Or even hint at a better idea to parse the YUV420 buffer to x264 ? :P

    Cheers ! ^^

  • How to add arbitrary or custom metadata in MP4 ?

    13 avril 2021, par 大大大大萝卜凉

    The MP4 muxer in ffmpeg only allows certain metadata by default. I would like to add :

    


    com.android.model: Mi 10 Pro
xyz: +22.9835+113.3621/
com.android.version: 1
com.android.manufacturer: Xiaomi


    


    How can I add this with ffmpeg ?

    


  • Encode NV12 frames to h264 using x264enc (appsrc and appsink)

    9 octobre 2023, par Abdul Rehman

    I am trying to encode NV12 frames to h264 files. For that I found a following code that is encoding raw frames to jpeg using jpegenc. The code works fine with jpeg encoder after some minor changes for NV12 frames. However x264enc encode only first frame and the rest of them are outputting the pps error when running with mplayer.

    


    First frame output

    


    [h264 @ 0x7f1ea2ed3600]decoding for stream 0 failed
[lavf] stream 0: video (h264), -vid 0
VIDEO:  [H264]  1920x1080  0bpp  1.000 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 58.54.100 (external)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Load subtitles in ./
Audio: no sound
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [vdpau] 1920x1080 => 1920x1080 Planar YV12


    


    Error frame output :

    


    
[h264 @ 0x7f9c2e44f4c0]non-existing PPS 0 referenced
[h264 @ 0x7f9c2e44f4c0]non-existing PPS 0 referenced
[h264 @ 0x7f9c2e44f4c0]decode_slice_header error

[h264 @ 0x7f9c2eece600]decoding for stream 0 failed
[h264 @ 0x7f9c2eece600]Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[lavf] stream 0: video (h264), -vid 0
VIDEO:  [H264]  0x0  0bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 58.54.100 (external)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)


    


    I have changed the pipeline, block size and added queue.
Pipeline :

    


    pipeline = gst_pipeline_new("mypipeline");
appsrc = gst_element_factory_make("appsrc", "mysource");
queue1 = gst_element_factory_make("queue", "myqueue1");
jpegenc = gst_element_factory_make("x264enc", "myenc");
//parser = gst_element_factory_make("h264parse", "parser");
appsink = gst_element_factory_make("appsink", "mysink");


...
g_object_set(G_OBJECT(appsrc), "format", GST_FORMAT_TIME, "is-live", TRUE, "do-timestamp", TRUE, NULL);
g_object_set(G_OBJECT(jpegenc), "tune", 0x00000004, NULL); // 0x00000004 is the ultrafast preset

...
capsappsrc2Jpegenc = gst_caps_new_simple("video/x-raw", "format",
            G_TYPE_STRING, "NV12", "width", G_TYPE_INT, width, "height",
            G_TYPE_INT, height, "framerate", GST_TYPE_FRACTION, 1, 1, 
            "interlace-mode", G_TYPE_STRING, "progressive",
            "colorimetry", G_TYPE_STRING, "bt601",
            NULL);

    // blocksize is important for jpegenc to know how many data to expect from appsrc in a single frame, too
    char szTemp[64];
    sprintf(szTemp, "%d", 3110400);
    g_object_set(G_OBJECT (appsrc), "blocksize", szTemp,
            NULL);