Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (88)

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

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

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

  • all : Replace if (ARCH_FOO) checks by #if ARCH_FOO

    12 juin 2022, par Andreas Rheinhardt
    all : Replace if (ARCH_FOO) checks by #if ARCH_FOO
    

    This is more spec-compliant because it does not rely
    on dead-code elimination by the compiler. Especially
    MSVC has problems with this, as can be seen in
    https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html
    or
    https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html

    This commit does not eliminate every instance where we rely
    on dead code elimination : It only tackles branching to
    the initialization of arch-specific dsp code, not e.g. all
    uses of CONFIG_ and HAVE_ checks. But maybe it is already
    enough to compile FFmpeg with MSVC with whole-programm-optimizations
    enabled (if one does not disable too many components).

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

    • [DH] libavcodec/aacdec_template.c
    • [DH] libavcodec/aacenc.c
    • [DH] libavcodec/aacpsdsp_template.c
    • [DH] libavcodec/aacsbr_template.c
    • [DH] libavcodec/ac3dsp.c
    • [DH] libavcodec/acelp_filters.c
    • [DH] libavcodec/acelp_vectors.c
    • [DH] libavcodec/alacdsp.c
    • [DH] libavcodec/audiodsp.c
    • [DH] libavcodec/blockdsp.c
    • [DH] libavcodec/bswapdsp.c
    • [DH] libavcodec/cavsdsp.c
    • [DH] libavcodec/celp_filters.c
    • [DH] libavcodec/celp_math.c
    • [DH] libavcodec/cfhddsp.c
    • [DH] libavcodec/cfhdencdsp.c
    • [DH] libavcodec/dcadsp.c
    • [DH] libavcodec/dct.c
    • [DH] libavcodec/dirac_dwt.c
    • [DH] libavcodec/diracdsp.c
    • [DH] libavcodec/dnxhdenc.c
    • [DH] libavcodec/exrdsp.c
    • [DH] libavcodec/fdctdsp.c
    • [DH] libavcodec/fft_template.c
    • [DH] libavcodec/flacdsp.c
    • [DH] libavcodec/fmtconvert.c
    • [DH] libavcodec/g722dsp.c
    • [DH] libavcodec/h263dsp.c
    • [DH] libavcodec/h264chroma.c
    • [DH] libavcodec/h264dsp.c
    • [DH] libavcodec/h264pred.c
    • [DH] libavcodec/h264qpel.c
    • [DH] libavcodec/hevcdsp.c
    • [DH] libavcodec/hevcpred.c
    • [DH] libavcodec/hpeldsp.c
    • [DH] libavcodec/huffyuvdsp.c
    • [DH] libavcodec/huffyuvencdsp.c
    • [DH] libavcodec/idctdsp.c
    • [DH] libavcodec/iirfilter.c
    • [DH] libavcodec/jpeg2000dsp.c
    • [DH] libavcodec/lossless_audiodsp.c
    • [DH] libavcodec/lossless_videodsp.c
    • [DH] libavcodec/lossless_videoencdsp.c
    • [DH] libavcodec/lpc.c
    • [DH] libavcodec/mdct15.c
    • [DH] libavcodec/me_cmp.c
    • [DH] libavcodec/mlpdsp.c
    • [DH] libavcodec/mpegaudiodsp.c
    • [DH] libavcodec/mpegvideo.c
    • [DH] libavcodec/mpegvideo_enc.c
    • [DH] libavcodec/mpegvideodsp.c
    • [DH] libavcodec/mpegvideoencdsp.c
    • [DH] libavcodec/opus_pvq.c
    • [DH] libavcodec/opusdsp.c
    • [DH] libavcodec/pixblockdsp.c
    • [DH] libavcodec/pngdsp.c
    • [DH] libavcodec/proresdsp.c
    • [DH] libavcodec/qpeldsp.c
    • [DH] libavcodec/rdft.c
    • [DH] libavcodec/rv34dsp.c
    • [DH] libavcodec/rv40dsp.c
    • [DH] libavcodec/sbcdsp.c
    • [DH] libavcodec/sbrdsp_template.c
    • [DH] libavcodec/snow_dwt.c
    • [DH] libavcodec/svq1enc.c
    • [DH] libavcodec/synth_filter.c
    • [DH] libavcodec/takdsp.c
    • [DH] libavcodec/ttadsp.c
    • [DH] libavcodec/ttaencdsp.c
    • [DH] libavcodec/utvideodsp.c
    • [DH] libavcodec/v210dec_init.h
    • [DH] libavcodec/v210enc_init.h
    • [DH] libavcodec/vc1dsp.c
    • [DH] libavcodec/videodsp.c
    • [DH] libavcodec/vorbisdsp.c
    • [DH] libavcodec/vp3dsp.c
    • [DH] libavcodec/vp56dsp.c
    • [DH] libavcodec/vp8dsp.c
    • [DH] libavcodec/vp9dsp.c
    • [DH] libavcodec/wmv2dsp.c
    • [DH] libavcodec/x86/mdct15_init.c
    • [DH] libavcodec/xvididct.c
    • [DH] libavfilter/af_afirdsp.h
    • [DH] libavfilter/af_anlmdn.c
    • [DH] libavfilter/af_volume.c
    • [DH] libavfilter/avf_showcqt.c
    • [DH] libavfilter/colorspacedsp.c
    • [DH] libavfilter/scene_sad.c
    • [DH] libavfilter/vf_atadenoise.c
    • [DH] libavfilter/vf_blend_init.h
    • [DH] libavfilter/vf_bwdif.c
    • [DH] libavfilter/vf_eq.h
    • [DH] libavfilter/vf_framerate.c
    • [DH] libavfilter/vf_fspp.c
    • [DH] libavfilter/vf_gblur_init.h
    • [DH] libavfilter/vf_gradfun.c
    • [DH] libavfilter/vf_hflip_init.h
    • [DH] libavfilter/vf_hqdn3d.c
    • [DH] libavfilter/vf_idet.c
    • [DH] libavfilter/vf_limiter.c
    • [DH] libavfilter/vf_lut3d.c
    • [DH] libavfilter/vf_maskedclamp.c
    • [DH] libavfilter/vf_maskedmerge.c
    • [DH] libavfilter/vf_nlmeans_init.h
    • [DH] libavfilter/vf_noise.c
    • [DH] libavfilter/vf_overlay.c
    • [DH] libavfilter/vf_pp7.c
    • [DH] libavfilter/vf_psnr.c
    • [DH] libavfilter/vf_pullup.c
    • [DH] libavfilter/vf_removegrain.c
    • [DH] libavfilter/vf_spp.c
    • [DH] libavfilter/vf_ssim.c
    • [DH] libavfilter/vf_stereo3d.c
    • [DH] libavfilter/vf_threshold_init.h
    • [DH] libavfilter/vf_tinterlace.c
    • [DH] libavfilter/vf_transpose.c
    • [DH] libavfilter/vf_v360.c
    • [DH] libavfilter/vf_w3fdif.c
    • [DH] libavfilter/vf_yadif.c
    • [DH] libavutil/cpu.c
    • [DH] libavutil/fixed_dsp.c
    • [DH] libavutil/float_dsp.c
    • [DH] libavutil/lls.c
    • [DH] libswresample/audioconvert.c
    • [DH] libswresample/rematrix.c
    • [DH] libswresample/resample_dsp.c
    • [DH] libswscale/rgb2rgb.c
    • [DH] libswscale/swscale.c
    • [DH] libswscale/swscale_unscaled.c
    • [DH] libswscale/utils.c
    • [DH] libswscale/yuv2rgb.c
  • ffmpeg how to concat and COMPRESS at the same time ? [closed]

    17 juin 2022, par Alex Nox

    Concat command :

    &#xA;

    ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp4&#xA;

    &#xA;

    Content of list.txt

    &#xA;

    file &#x27;2022-03-26-1.mp4&#x27;&#xA;&#xA;file &#x27;2022-03-26-2.mp4&#x27;&#xA;

    &#xA;

    The following above seems working, but I want to compress files at the same time, so I type :

    &#xA;

    ffmpeg concat -an -i list.txt -crf 23 -c:v libx264 out.mp4&#xA;

    &#xA;

    But it doesn't work ? Why ?

    &#xA;

  • ffmpeg api alternate transcoding and remuxing for same file

    21 juin 2022, par Alexandre Novius

    Context

    &#xA;

    Hello !

    &#xA;

    I'm currently working on the development of a small library allowing to cut an h.264 video on any frame, but without re-encoding (transcoding) the whole video. The idea is to re-encode only the GOP on which we want to cut, and to rewrite (remux) directly the others GOP.

    &#xA;

    The avcut project (https://github.com/anyc/avcut) allows to do that, but requires a systematic decoding of each package, and seems to not work with the recent versions of ffmpeg from the tests I could do and from the recent feedbacks in the github issues.

    &#xA;

    As a beginner, I started from the code examples provided in the ffmpeg documentation, in particular : transcoding.c and remuxing.c.

    &#xA;

    Problem encountered

    &#xA;

    The problem I'm having is that I can't get both transcoding and remuxing to work properly at the same time. In particular, depending on the method I use to initialize the AVCodecParameters of the output video stream, transcoding works, or remuxing works :

    &#xA;

      &#xA;
    • avcodec_parameters_copy works well for remuxing
    • &#xA;

    • avcodec_parameters_from_context works well for transcoding
    • &#xA;

    &#xA;

    In case I choose avcodec_parameters_from_context, the transcoded GOP are correctly read by my video player (parole), but the remuxed packets are not read, and ffprobe does not show/detect them.

    &#xA;

    In case I choose avcodec_parameters_from_context, the remuxing GOP are correctly read by my video player, but the transcoding key_frame are bugged (I have the impression that the b-frame and p-frame are ok), and ffprobe -i return an error about the NAL of the key-frames :

    &#xA;

    [h264 @ 0x55ec8a079300] sps_id 32 out of range&#xA;[h264 @ 0x55ec8a079300] Invalid NAL unit size (1677727148 > 735).&#xA;[h264 @ 0x55ec8a079300] missing picture in access unit with size 744&#xA;

    &#xA;

    I suspect that the problem is related to the extradata of the packets. Through some experiments on the different attributes of the output AVCodecParameters, it seems that it is the extradata and extradata_size attributes that are responsible for the functioning of one method or the other.

    &#xA;

    Version

    &#xA;

    ffmpeg development branch retrieved on 2022-05-17 from https://github.com/FFmpeg/FFmpeg.

    &#xA;

    Compiled with --enable-libx264 --enable-gpl --enable-decoder=png --enable-encoder=png

    &#xA;

    Code

    &#xA;

    My code is written in c++ and is based on two classes : a class defining the parameters and methods on the input file (InputContexts) and a class defining them for the output file (OutputContexts). The code of these two classes is defined in the following files :

    &#xA;

    &#xA;

    The code normally involved in the problem is the following :

    &#xA;

      &#xA;
    • stream initialization
    • &#xA;

    &#xA;

    int OutputContexts::init(const char* out_filename, InputContexts* input_contexts){&#xA;    int ret;&#xA;    int stream_index = 0;&#xA;&#xA;    avformat_alloc_output_context2(&amp;ofmt_ctx, NULL, NULL, out_filename);&#xA;    if (!ofmt_ctx) {&#xA;        fprintf(stderr, "Could not create output context\n");&#xA;        ret = AVERROR_UNKNOWN;&#xA;        return ret;&#xA;    }&#xA;&#xA;    av_dump_format(ofmt_ctx, 0, out_filename, 1);&#xA; &#xA;    encoders.resize(input_contexts->ifmt_ctx->nb_streams, nullptr);&#xA;    codecs.resize(input_contexts->ifmt_ctx->nb_streams, nullptr);&#xA;  &#xA;    // stream mapping&#xA;    for (int i = 0; i &lt; input_contexts->ifmt_ctx->nb_streams; i&#x2B;&#x2B;) {&#xA;        AVStream *out_stream;&#xA;        AVStream *in_stream = input_contexts->ifmt_ctx->streams[i];&#xA;        AVCodecContext* decoder_ctx = input_contexts->decoders[i];&#xA; &#xA;        // add new stream to output context&#xA;        out_stream = avformat_new_stream(ofmt_ctx, NULL);&#xA;        if (!out_stream) {&#xA;            fprintf(stderr, "Failed allocating output stream\n");&#xA;            ret = AVERROR_UNKNOWN;&#xA;            return ret;&#xA;        }&#xA;&#xA;        // from avcut blog&#xA;        av_dict_copy(&amp;out_stream->metadata, in_stream->metadata, 0);&#xA;&#xA;        out_stream->time_base = in_stream->time_base;&#xA;&#xA;        // encoder&#xA;        if (decoder_ctx->codec_type == AVMEDIA_TYPE_VIDEO){&#xA;            ret = prepare_encoder_video(i, input_contexts);&#xA;            if (ret &lt; 0){&#xA;                fprintf(stderr, "Error while preparing encoder for stream #%u\n", i);&#xA;                return ret;&#xA;            }&#xA;&#xA;            // from avcut&#xA;            out_stream->sample_aspect_ratio = in_stream->sample_aspect_ratio;&#xA;&#xA;            // works well for remuxing&#xA;            ret = avcodec_parameters_copy(out_stream->codecpar, in_stream->codecpar);&#xA;            if (ret &lt; 0) {&#xA;                fprintf(stderr, "Failed to copy codec parameters\n");&#xA;                return ret;&#xA;            }&#xA;&#xA;            // works well for transcoding&#xA;            // ret = avcodec_parameters_from_context(out_stream->codecpar, encoders[i]);&#xA;            // if (ret &lt; 0) {&#xA;            //     av_log(NULL, AV_LOG_ERROR, "Failed to copy encoder parameters to output stream #%u\n", i);&#xA;            //     return ret;&#xA;            // }&#xA;&#xA;        } else if (decoder_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {&#xA;            ...&#xA;        } else {&#xA;            ...&#xA;        }&#xA;&#xA;        // TODO useful ???&#xA;        // set current stream position to 0&#xA;        // out_stream->codecpar->codec_tag = 0;&#xA;    }&#xA;&#xA;    // opening output file in write mode with the ouput context&#xA;    if (!(ofmt_ctx->oformat->flags &amp; AVFMT_NOFILE)) {&#xA;        ret = avio_open(&amp;ofmt_ctx->pb, out_filename, AVIO_FLAG_WRITE);&#xA;        if (ret &lt; 0) {&#xA;            fprintf(stderr, "Could not open output file &#x27;%s&#x27;", out_filename);&#xA;            return ret;&#xA;        }&#xA;    }&#xA; &#xA;    // write headers from output context in output file&#xA;    ret = avformat_write_header(ofmt_ctx, NULL);&#xA;    if (ret &lt; 0) {&#xA;        fprintf(stderr, "Error occurred when opening output file\n");&#xA;        return ret;&#xA;    }&#xA;&#xA;    return ret;&#xA;}&#xA;

    &#xA;

      &#xA;
    • AVCodecContext initialization for encoder
    • &#xA;

    &#xA;

    int OutputContexts::prepare_encoder_video(int stream_index, InputContexts* input_contexts){&#xA;    int ret;&#xA;    const AVCodec* encoder;&#xA;    AVCodecContext* decoder_ctx = input_contexts->decoders[stream_index];&#xA;    AVCodecContext* encoder_ctx;&#xA;&#xA;    if (video_index >= 0){&#xA;        fprintf(stderr, "Impossible to mark stream #%u as video, stream #%u is already registered as video stream.\n", &#xA;                stream_index, video_index);&#xA;        return -1; //TODO change this value for correct error code&#xA;    }&#xA;    video_index = stream_index;&#xA;&#xA;    if(decoder_ctx->codec_id == AV_CODEC_ID_H264){&#xA;        encoder = avcodec_find_encoder_by_name("libx264");&#xA;        if (!encoder) {&#xA;            av_log(NULL, AV_LOG_FATAL, "Encoder libx264 not found\n");&#xA;            return AVERROR_INVALIDDATA;&#xA;        }&#xA;        fmt::print("Encoder libx264 will be used for stream {}.\n", stream_index);&#xA;    } else {&#xA;        std::string s = fmt::format("No video encoder found for the given codec_id: {}\n", avcodec_get_name(decoder_ctx->codec_id));&#xA;        av_log(NULL, AV_LOG_FATAL, s.c_str());&#xA;        return AVERROR_INVALIDDATA;&#xA;    }&#xA;    &#xA;    encoder_ctx = avcodec_alloc_context3(encoder);&#xA;    if (!encoder_ctx) {&#xA;        av_log(NULL, AV_LOG_FATAL, "Failed to allocate the encoder context\n");&#xA;        return AVERROR(ENOMEM);&#xA;    }&#xA;&#xA;    // from avcut&#xA;    encoder_ctx->time_base = decoder_ctx->time_base;&#xA;    encoder_ctx->ticks_per_frame = decoder_ctx->ticks_per_frame;&#xA;    encoder_ctx->delay = decoder_ctx->delay;&#xA;    encoder_ctx->width = decoder_ctx->width;&#xA;    encoder_ctx->height = decoder_ctx->height;&#xA;    encoder_ctx->pix_fmt = decoder_ctx->pix_fmt;&#xA;    encoder_ctx->sample_aspect_ratio = decoder_ctx->sample_aspect_ratio;&#xA;    encoder_ctx->color_primaries = decoder_ctx->color_primaries;&#xA;    encoder_ctx->color_trc = decoder_ctx->color_trc;&#xA;    encoder_ctx->colorspace = decoder_ctx->colorspace;&#xA;    encoder_ctx->color_range = decoder_ctx->color_range;&#xA;    encoder_ctx->chroma_sample_location = decoder_ctx->chroma_sample_location;&#xA;    encoder_ctx->profile = decoder_ctx->profile;&#xA;    encoder_ctx->level = decoder_ctx->level;&#xA;&#xA;    encoder_ctx->thread_count = 1; // spawning more threads causes avcodec_close to free threads multiple times&#xA;    encoder_ctx->codec_tag = 0;&#xA;    &#xA;    // correct values ???&#xA;    encoder_ctx->qmin = 16;&#xA;    encoder_ctx->qmax = 26;&#xA;    encoder_ctx->max_qdiff = 4;&#xA;    // end from avcut&#xA;&#xA;    // according to avcut, should not be set&#xA;    // if (ofmt_ctx->oformat->flags &amp; AVFMT_GLOBALHEADER){&#xA;    //     encoder_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;&#xA;    // }&#xA;&#xA;    ret = avcodec_open2(encoder_ctx, encoder, NULL);&#xA;    if (ret &lt; 0) {&#xA;        av_log(NULL, AV_LOG_ERROR, "Cannot open video encoder for stream #%u\n", stream_index);&#xA;        return ret;&#xA;    }&#xA;    &#xA;    codecs[stream_index] = encoder;&#xA;    encoders[stream_index] = encoder_ctx;&#xA;&#xA;    return ret;&#xA;}&#xA;

    &#xA;

    Example

    &#xA;

    To illustrate my problem, I provide here a test code using the two classes that alternates between transcoding and remuxing at each key-frame encountered in the file using my classes.

    &#xA;

    &#xA;

    To compile the code :

    &#xA;

    g&#x2B;&#x2B; -o trans_remux trans_remux.cpp contexts.cpp -D__STDC_CONSTANT_MACROS `pkg-config --libs libavfilter` -lfmt -g&#xA;

    &#xA;

    Currently the code is using avcodec_parameters_copy (contexts.cpp:333), so it works well for remuxing. If you want to test the version with avcodec_parameters_from_context, pls comment from line 333 to 337 in contexts.cpp and uncomment from line 340 to 344 and recompile.

    &#xA;