Recherche avancée

Médias (1)

Mot : - Tags -/iphone

Autres articles (56)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

Sur d’autres sites (8329)

  • Up-to-date example for libavfilter usage [closed]

    25 juillet 2024, par Michael Werner

    I am looking for an example how to use the latest FFmpeg libavfilter functions to add a bitmap overlay image to a video. I only find more than ten years old examples which are based on an old versions of libavfilter.

    


    What I am trying to do :
On Windows with latest libav (full build) an C++ app reads YUV420P frames from a frame grabber card. I want to draw a Windows bitmap BGR24 overlay image (from file) on every frame via libavfilter. First I convert the BGR24 overlay image via format filter to YUV420P. Then I feed the YUV420P frame from frame grabber and the YUV420P overlay into the overlay filter. Everything seems to be fine but when I try to get the frame out of the filter graph I always get an "Resource is temporary not available" (EAGAIN) error, independent on how many frames I put into the graph.

    


    My current initialization code looks like below. It does not report any errors or warnings but when I try to get the filtered frame out of the graph via av_buffersink_get_frame I always get an EAGAIN return code.

    


    Here is my current initialization code :

    


    int init_overlay_filter(AVFilterGraph** graph, AVFilterContext** src_ctx, AVFilterContext** overlay_src_ctx,
                        AVFilterContext** sink_ctx)
{
    AVFilterGraph* filter_graph;
    AVFilterContext* buffersrc_ctx;
    AVFilterContext* overlay_buffersrc_ctx;
    AVFilterContext* buffersink_ctx;
    AVFilterContext* overlay_ctx;
    AVFilterContext* format_ctx;
    const AVFilter *buffersrc, *buffersink, *overlay_buffersrc, *overlay_filter, *format_filter;
    int ret;

    // Create the filter graph
    filter_graph = avfilter_graph_alloc();
    if (!filter_graph)
    {
        fprintf(stderr, "Unable to create filter graph.\n");
        return AVERROR(ENOMEM);
    }

    // Create buffer source filter for main video
    buffersrc = avfilter_get_by_name("buffer");
    if (!buffersrc)
    {
        fprintf(stderr, "Unable to find buffer filter.\n");
        return AVERROR_FILTER_NOT_FOUND;
    }

    // Create buffer source filter for overlay image
    overlay_buffersrc = avfilter_get_by_name("buffer");
    if (!overlay_buffersrc)
    {
        fprintf(stderr, "Unable to find buffer filter.\n");
        return AVERROR_FILTER_NOT_FOUND;
    }

    // Create buffer sink filter
    buffersink = avfilter_get_by_name("buffersink");
    if (!buffersink)
    {
        fprintf(stderr, "Unable to find buffersink filter.\n");
        return AVERROR_FILTER_NOT_FOUND;
    }

    // Create overlay filter
    overlay_filter = avfilter_get_by_name("overlay");
    if (!overlay_filter)
    {
        fprintf(stderr, "Unable to find overlay filter.\n");
        return AVERROR_FILTER_NOT_FOUND;
    }

    // Create format filter
    format_filter = avfilter_get_by_name("format");
    if (!format_filter) 
    {
        fprintf(stderr, "Unable to find format filter.\n");
        return AVERROR_FILTER_NOT_FOUND;
    }

    // Initialize the main video buffer source
    char args[512];
    snprintf(args, sizeof(args),
             "video_size=1920x1080:pix_fmt=yuv420p:time_base=1/25:pixel_aspect=1/1");
    ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in", args, NULL, filter_graph);
    if (ret < 0)
    {
        fprintf(stderr, "Unable to create buffer source filter for main video.\n");
        return ret;
    }

    // Initialize the overlay buffer source
    snprintf(args, sizeof(args),
             "video_size=165x165:pix_fmt=bgr24:time_base=1/25:pixel_aspect=1/1");
    ret = avfilter_graph_create_filter(&overlay_buffersrc_ctx, overlay_buffersrc, "overlay_in", args, NULL,
                                       filter_graph);
    if (ret < 0)
    {
        fprintf(stderr, "Unable to create buffer source filter for overlay.\n");
        return ret;
    }

    // Initialize the format filter to convert overlay image to yuv420p
    snprintf(args, sizeof(args), "pix_fmts=yuv420p");
    ret = avfilter_graph_create_filter(&format_ctx, format_filter, "format", args, NULL, filter_graph);

    if (ret < 0) 
    {
        fprintf(stderr, "Unable to create format filter.\n");
        return ret;
    }

    // Initialize the buffer sink
    ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out", NULL, NULL, filter_graph);
    if (ret < 0)
    {
        fprintf(stderr, "Unable to create buffer sink filter.\n");
        return ret;
    }

    // Initialize the overlay filter
    ret = avfilter_graph_create_filter(&overlay_ctx, overlay_filter, "overlay", "W-w:H-h:enable='between(t,0,20)':format=yuv420", NULL, filter_graph);
    if (ret < 0)
    {
        fprintf(stderr, "Unable to create overlay filter.\n");
        return ret;
    }

    // Connect the filters
    ret = avfilter_link(overlay_buffersrc_ctx, 0, format_ctx, 0);

    if (ret >= 0)
    {
        ret = avfilter_link(buffersrc_ctx, 0, overlay_ctx, 0);
    }
    else
    {
        fprintf(stderr, "Unable to configure filter graph.\n");
        return ret;
    }


    if (ret >= 0) 
    {
        ret = avfilter_link(format_ctx, 0, overlay_ctx, 1);
    }
    else
    {
        fprintf(stderr, "Unable to configure filter graph.\n");
        return ret;
    }

    if (ret >= 0) 
    {
        if ((ret = avfilter_link(overlay_ctx, 0, buffersink_ctx, 0)) < 0)
        {
            fprintf(stderr, "Unable to link filter graph.\n");
            return ret;
        }
    }
    else
    {
        fprintf(stderr, "Unable to configure filter graph.\n");
        return ret;
    }

    // Configure the filter graph
    if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0)
    {
        fprintf(stderr, "Unable to configure filter graph.\n");
        return ret;
    }

    *graph = filter_graph;
    *src_ctx = buffersrc_ctx;
    *overlay_src_ctx = overlay_buffersrc_ctx;
    *sink_ctx = buffersink_ctx;

    return 0;
}


    


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

    


  • avr32 : remove explicit support

    9 juin 2024, par Rémi Denis-Courmont
    avr32 : remove explicit support
    

    The vendor has long since switched to Arm, with the last product
    reaching their official end-of-life over 11 years ago. Linux support for
    the ISA was dropped 7 years ago. More importantly, this architecture was
    never supported by upstream GCC, and the vendor fork is stuck at version
    4.2, which FFmpeg no longer supports (as per C11 requirement).

    Presumably, this is still the case given the lack of vendor support.
    Indeed all of the code being removed here consisted of inline assembler
    scalar optimisations. A sane C compiler should be able to perform those
    automatically nowadays (with the sole exception of fast CLZ detection),
    but this is moot as this architecture is evidently dead.

    • [DH] configure
    • [DH] libavcodec/avr32/mathops.h
    • [DH] libavcodec/mathops.h
    • [DH] libavutil/avr32/intreadwrite.h
    • [DH] libavutil/intreadwrite.h