Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (112)

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

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

Sur d’autres sites (10429)

  • FFMPEG MKV -> MP4 Batch Conversion

    15 juillet 2024, par blaziken386

    I'm trying to write a program that lets me convert a series of .mkv files with subtitle files into .mp4 files with the subs hardcoded.

    


    Right now, the script I use is

    


    ffmpeg -i input.mkv -vf subtitles=input.mkv output.mp4



    


    This is fine, but it means I can only convert them one at a time, and it's kind of a hassle because it means I have to fiddle with it every few minutes to set up the next one.

    


    I have another script I use for converting .flac files to .mp3 files, which is

    


    @ECHO OFF

FOR %%f IN (*.flac) DO (
echo Converting: %%f
ffmpeg -i "%%f" -ab 320k -map_metadata 0 "%%~nf.mp3"
)

echo Finished

PAUSE



    


    Running that converts every single .flac folder into an .mp3 equivalent, with the same filename and everything.

    


    I've tried to combine the above scripts into something like this :

    


    @ECHO OFF

FOR %%f IN (*.mkv) DO (
echo Converting: %%f
ffmpeg -i "%%f" -vf subtitles=%%f "%%~nf.mp4"
)

echo Finished

PAUSE


    


    but every time I do so, it returns errors like "invalid argument" or "unable to find a suitable output type", or "error initializing filters", or "2 frames left in the queue on closing" or something along those lines. I've swapped out subtitles=%%f for "subtitles-%%f" or subtitles="%%f.mkv" and so on and so forth, and none of those give me what I want either. Sometimes it creates Empty .mp4 file containers with nothing in them, sometimes it does nothing at all.

    


    I don't really understand what exactly is happening under the hood in that flac->mp3 code, because I grabbed it from a different stackoverflow post years ago. All I know is that trying to copy that code and repurpose it into something else doesn't work. Is this just an issue where I've fucked up the formatting of the code and not realized it, or is this a "ffmpeg can't actually do that because of a weird technical issue" thing ?

    


    I also tried the code listed here, when Stackoverflow listed that as a possible duplicate, but that gave me similar errors, and I don't really understand why !

    


    Also, if it's relevant, I'm running windows.

    


  • How are ARM GPUs supported by Video display/decoding/encoding Programs ?

    7 juillet 2020, par John Allard

    I often see ARM-based chips advertising onboard GPUs, like the RPI3 that came with "Broadcom VideoCore IV @ 250 MHz" and the OdroidC2 that comes with a "Mali-450 GPU". These chips advertise stuff like "Decode 4k/30FPS, Encode 1080p,30FPS" as the capabilities of the GPU for encoding and decoding videos.

    


    My question is this - how does a program like Kodi, VLC, or FFMPEG come to make use of these GPUs for actual encoding and decoding ? When I do research on how to make use of the Mali-450 GPU, for example, I find some esoteric and poorly documented C-examples of sending compressed frames to the GPU and getting decoded frames back. If I were to use a device like the OdroidC2 and install VLC on it, how does VLC make use of the GPU ? Did someone have to write logic into VLC to use the specific encoding/decoding API exposed by the Mali GPU in order to use it or do these GPUs follow some sort of consistent API that is exposed by all GPUs and VLC/Kodi can just program against this system API ?

    


    The reason I ask this question is that VLC and Kodi tend to support these GPUs out of the Box, but a very popular program like FFMPEG that prides itself on supporting as many codecs and accelerators as possible has no support for decoding and encoding with the Mali GPU series. Why would VLC/Kodi support encoding/decoding and not FFMPEG ? Why do these manufacturers claim wild decoding and encoding support if these GPUs are difficult to program against and one must use their custom esoteric APIs instead of something like libavcodec ?

    


    I hope my question makes sense, I guess what I'm curious about is that GPUs on most systems whether it be the Intel HD Graphics, Nvidia cards, AMD cards, etc seem to be used automatically by most video players but when it comes to using something like FFMPEG against these devices the process becomes much more process and you need to custom compile the build and give special flags to use the device as intended. Is there something I'm missing here ? Is VLC programmed to make use of all of these different type of GPUs ? And why, in that case, does FFMEPG not support Mali GPUs out of the Box ?

    


  • Confused about x264 and encoding video frames

    26 février 2015, par spartygw

    I built a test driver for encoding a series of images I have captured. I am using libx264 and based my driver off of this guy’s answer :

    StackOverflow link

    In my case I am starting out by reading in a JPG image and converting to YUV and passing that same frame over and over in a loop to the x264 encoder.

    My expectation was that since the frame is the same that the output from the encoder would be very small and constant.

    Instead I find that the NAL payload is varied from a few bytes to a few KB and also varies highly depending on the frame rate I specify in the encoder parameters.

    Obviously I don’t understand video encoding. Why does the output size vary so much ?

    int main()
    {
     Image image(WIDTH, HEIGHT);
     image.FromJpeg("frame-1.jpg");

     unsigned char *data = image.GetRGB();

     x264_param_t param;

     x264_param_default_preset(&param, "fast", "zerolatency");
     param.i_threads = 1;
     param.i_width = WIDTH;
     param.i_height = HEIGHT;
     param.i_fps_num = FPS;
     param.i_fps_den = 1;

     // Intra refres:
     param.i_keyint_max = FPS;
     param.b_intra_refresh = 1;

     //Rate control:
     param.rc.i_rc_method = X264_RC_CRF;
     param.rc.f_rf_constant = FPS-5;
     param.rc.f_rf_constant_max = FPS+5;

     //For streaming:
     param.b_repeat_headers = 1;
     param.b_annexb = 1;

     x264_param_apply_profile(&param, "baseline");

     // initialize the encoder
     x264_t* encoder = x264_encoder_open(&param);
     x264_picture_t pic_in, pic_out;
     x264_picture_alloc(&pic_in, X264_CSP_I420, WIDTH, HEIGHT);
     // X264 expects YUV420P data use libswscale
     // (from ffmpeg) to convert images to the right format
     struct SwsContext* convertCtx =
           sws_getContext(WIDTH, HEIGHT, PIX_FMT_RGB24, WIDTH, HEIGHT,
                          PIX_FMT_YUV420P, SWS_FAST_BILINEAR,
                          NULL, NULL, NULL);

     // encoding is as simple as this then, for each frame do:
     // data is a pointer to your RGB structure
     int srcstride = WIDTH*3; //RGB stride is just 3*width
     sws_scale(convertCtx, &data, &srcstride, 0, HEIGHT,
               pic_in.img.plane, pic_in.img.i_stride);
     x264_nal_t* nals;
     int i_nals;
     int frame_size =
           x264_encoder_encode(encoder, &nals, &i_nals, &pic_in, &pic_out);

     int max_loop=15;
     int this_loop=1;

     while (frame_size >= 0 && --max_loop)
     {
         cout << "------------" << this_loop++ << "-----------------\n";
         cout << "Frame size = " << frame_size << endl;
         cout << "output has " << pic_out.img.i_csp << " colorspace\n";
         cout << "output has " << pic_out.img.i_plane << " # img planes\n";

         cout << "i_nals = " << i_nals << endl;
         for (int n=0; n