Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (102)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

Sur d’autres sites (6292)

  • ffmpeg : record 1 hour segment, right on the hour, no/little frame lost [closed]

    2 septembre 2024, par Jean-Michel

    I need to record 24/7 an incoming SRT stream into 1 hour chunks, starting right on the hour.
The start needs to be as close as XX:00:00.000 as possible and little to no frame lost between the recordings.

    


    For now I am using a systemd service with that ExecStart command :

    


    /usr/bin/ffmpeg -fflags +discardcorrupt -i 'srt://:4010?pkt_size=1316&mode=listener' -c copy -map 0:v:0 -map 0:a? -f segment -strftime 1 -segment_time 3600 -reset_timestamps 1 -segment_format ts '/somefolder/recording_%%d%%m%%Y_%%H%%M00.ts'


    


    And using a crontab to restart the service on the hour to insure the next file properly starts at the expected time.

    


    0 * * * * cd /etc/systemd/system && systemctl restart srt_recorder_4010.service


    


    Unfortunately, the restart of the service takes 5 to 10 seconds and we are loosing that duration in the recorded file.
If I'm not using the crontab, I get 1 hour files but I have no control on the start time.

    


    Any suggestion to get something more accurate ?
Could there be a way to combine ffmpeg internal ability to exactly segment 1 hour file but enforce to do it on the hour ?
Or externally, if there was a way to send a "next file" command (api, signal) to a perpetual running ffmpeg to change recording file ?

    


    Thanks

    


  • How do I toggle individual codec options in libavcodec (specifically h264_options)

    2 juillet 2020, par John Allard

    I'm trying to figure out how to enable enable_er option as is defined in h264dec.c in libavcodec. This is defined as an AVOption as part of the AVCodec.priv_class.option field. I can't figure out if this is some sort of compile-time option or if it's an option that I can enable via the av_dict_set method when initializing an AVCodec via avcodec_open2.

    


    I'm talking about these options in h264dec.c

    


    #define OFFSET(x) offsetof(H264Context, x)
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption h264_options[] = {
    { "is_avc", "is avc", OFFSET(is_avc), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, 0 },
    { "nal_length_size", "nal_length_size", OFFSET(nal_length_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0 },
    { "enable_er", "Enable error resilience on damaged frames (unsafe)", OFFSET(enable_er), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD },
    { NULL },
};

static const AVClass h264_class = {
    .class_name = "H264 Decoder",
    .item_name  = av_default_item_name,
    .option     = h264_options,
    .version    = LIBAVUTIL_VERSION_INT,
};

AVCodec ff_h264_decoder = {
    .name                  = "h264",
    .long_name             = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
    .type                  = AVMEDIA_TYPE_VIDEO,
    .id                    = AV_CODEC_ID_H264,
    .priv_data_size        = sizeof(H264Context),
    .init                  = h264_decode_init,
    .close                 = h264_decode_end,
    .decode                = h264_decode_frame,
    .capabilities          = /*AV_CODEC_CAP_DRAW_HORIZ_BAND |*/ AV_CODEC_CAP_DR1 |
                             AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS |
                             AV_CODEC_CAP_FRAME_THREADS,
    .caps_internal         = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING,
    .flush                 = flush_dpb,
    .init_thread_copy      = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
    .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context),
    .profiles              = NULL_IF_CONFIG_SMALL(ff_h264_profiles),
    .priv_class            = &h264_class,
};


    


  • Setting individual pixels of an RGB frame for ffmpeg encoding

    15 mai 2013, par Camille Goudeseune

    I'm trying to change the test pattern of an ffmpeg streamer, Trouble syncing libavformat/ffmpeg with x264 and RTP , into familiar RGB format. My broader goal is to compute frames of a streamed video on the fly.

    So I replaced its AV_PIX_FMT_MONOWHITE with AV_PIX_FMT_RGB24, which is "packed RGB 8:8:8, 24bpp, RGBRGB..." according to http://libav.org/doxygen/master/pixfmt_8h.html .

    To stuff its pixel array called data, I've tried many variations on

    for (int y=0; y/  const double j = y/double(HEIGHT);
       rgb[0] = 255*i;
       rgb[1] = 0;
       rgb[2] = 255*(1-i);
     }
    }

    At HEIGHTxWIDTH= 80x60, this version yields
    screenshot of red-to-blue stripes, when I expect a single blue-to-red horizontal gradient.

    640x480 yields the same 4-column pattern, but with far more horizontal stripes.

    640x640, 160x160, etc, yield three columns, cyan-ish / magenta-ish / yellow-ish, with the same kind of horizontal stripiness.

    Vertical gradients behave even more weirdly.

    Appearance was unaffected by an AV_PIX_FMT_RGBA attempt (4 not 3 bytes per pixel, alpha=255). Also unaffected by a port from C to C++.

    The argument srcStrides passed to sws_scale() is a length-1 array, containing the single int HEIGHT.

    Access each Pixel of AVFrame asks the same question in less detail, so far unanswered.

    The streamer emits one warning, which I doubt affects appearance :

    [rtp @ 0x269c0a0] Encoder did not produce proper pts, making some up.

    So. How do you set the RGB value of a pixel in a frame to be sent to sws_scale() (and then to x264_encoder_encode() and av_interleaved_write_frame()) ?