Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (82)

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

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (11358)

  • Ffmpeg C++ Could not find a valid device and can't configure encoder

    7 septembre 2022, par Turgut

    I'm trying to change my encoders format to "h264" from "mpeg4" but I'm getting these two errors back-to-back :

    


    [h264_v4l2m2m @ 0x55d6ba5b0780] Could not find a valid device
[h264_v4l2m2m @ 0x55d6ba5b0780] can't configure encoder


    


    I've seen this question and tried to run ./configure --enable-shared --enable-libx264 --enable-encoder=libx264 --enable-gpl It succeeded and when I run ffmpeg -codecs | grep h264 I get this as output :

    


     DEV.LS h264    H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m ) (encoders: h264_v4l2m2m )


    


    But after all these I'm still getting the error. Why is this ? I just want my encoder to encode in h264 format. Here is my code so far (this is mostly the muxing.c example of ffpmeg) :

    


    

video_encoder::video_encoder(int w, int h, float fps, unsigned int duration) 
 :width(w), height(h), STREAM_FRAME_RATE(fps), STREAM_DURATION(duration)
{
    std::string as_str = "./output/video.mp4";

    char* filename = const_cast(as_str.c_str());
    enc_inf.video_st, enc_inf.audio_st = (struct OutputStream) { 0 };
    enc_inf.video_st.next_pts = 1; 
    enc_inf.encode_video = 0;
    int ret;
    int i;
    
    avformat_alloc_output_context2(&enc_inf.oc, NULL, "h264", filename);

    //video_codec = avcodec_find_encoder(AV_CODEC_ID_H264);

    if (!enc_inf.oc) {
        std::cout << "FAILED" << std::endl;
        avformat_alloc_output_context2(&enc_inf.oc, NULL, "mpeg", filename);
    }

    enc_inf.fmt = enc_inf.oc->oformat;

    //enc_inf.fmt->video_codec = AV_CODEC_ID_H264;

    if (enc_inf.fmt->video_codec != AV_CODEC_ID_NONE) {
        add_stream(&enc_inf.video_st, enc_inf.oc, &video_codec, enc_inf.fmt->video_codec);
        enc_inf.have_video = 1;
        enc_inf.encode_video = 1;
    }

    if (enc_inf.have_video)
        open_video(enc_inf.oc, video_codec, &enc_inf.video_st, opt);

    av_dump_format(enc_inf.oc, 0, filename, 1);

    if (!(enc_inf.fmt->flags & AVFMT_NOFILE)) {
        ret = avio_open(&enc_inf.oc->pb, filename, AVIO_FLAG_WRITE);
        if (ret < 0) {
            exit(0);
        }
    }
    ret = avformat_write_header(enc_inf.oc, &opt);
    if (ret < 0) {
        exit(0);
    }
}

void video_encoder::add_stream(OutputStream *ost, AVFormatContext *oc,
                       const AVCodec **codec,
                       enum AVCodecID codec_id)
{
    AVCodecContext *c;
    int i;

    /* find the encoder */
    *codec = avcodec_find_encoder(codec_id);
    
    if (!(*codec)) {
        fprintf(stderr, "Could not find encoder for '%s'\n",
                avcodec_get_name(codec_id));
        exit(1);
    }

    ost->tmp_pkt = av_packet_alloc();

    if (!ost->tmp_pkt) {
        fprintf(stderr, "Could not allocate AVPacket\n");
        exit(1);
    }

    ost->st = avformat_new_stream(oc, NULL);
    if (!ost->st) {
        fprintf(stderr, "Could not allocate stream\n");
        exit(1);
    }
    ost->st->id = oc->nb_streams-1;
    c = avcodec_alloc_context3(*codec);
    if (!c) {
        fprintf(stderr, "Could not alloc an encoding context\n");
        exit(1);
    }
    ost->enc = c;


    switch ((*codec)->type) {
    case AVMEDIA_TYPE_VIDEO:
        c->codec_id = codec_id;

        c->bit_rate = 10000;
        c->width    = width;
        c->height   = height;
        ost->st->time_base = (AVRational){ 1, STREAM_FRAME_RATE }; // *frame_rate
        c->time_base       = ost->st->time_base;

        c->gop_size      = 7;
        c->pix_fmt       = STREAM_PIX_FMT;
        if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
            c->mb_decision = 2;
        }

        break;
    }
     

    /* Some formats want stream headers to be separate. */
    if (oc->oformat->flags & AVFMT_GLOBALHEADER)
        c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}
void video_encoder::open_video(AVFormatContext *oc, const AVCodec *codec,
                       OutputStream *ost, AVDictionary *opt_arg)
{
    int ret;
    AVCodecContext *c = ost->enc;
    AVDictionary *opt = NULL;
    av_dict_copy(&opt, opt_arg, 0);
    /* open the codec */
    ret = avcodec_open2(c, codec, &opt);
    av_dict_free(&opt);
    
    if (ret < 0) {
        fprintf(stderr, "Could not open video codec: %s\n", ret);
        exit(1);
    }

    /* allocate and init a re-usable frame */
    ost->frame = alloc_picture(c->pix_fmt, c->width, c->height);
    if (!ost->frame) {
        fprintf(stderr, "Could not allocate video frame\n");
        exit(1);
    }

    /* If the output format is not YUV420P, then a temporary YUV420P
     * picture is needed too. It is then converted to the required
     * output format. */
    ost->tmp_frame = NULL;


    /* copy the stream parameters to the muxer */
    ret = avcodec_parameters_from_context(ost->st->codecpar, c);
    if (ret < 0) {
        fprintf(stderr, "Could not copy the stream parameters\n");
        exit(1);
    }
}




    


    Error happens at ret = avcodec_open2(c, codec, &opt); inside video_encoder::open_video.

    


    Am I setting the format wrong or is my configuration faulty ? I'm using ubuntu.

    


  • Copying GoPro metadata with ffmpeg - Could not find tag for codec none

    12 juin 2024, par TomMaier

    I am trying to use ffmpeg to copy the metadata of a gopro file.
The most basic demonstration of the problem would be to copy everything to a new file :

    


    ffmpeg -y -i source.MP4 -c copy -copy_unknown -map 0:v -map 0:a -map 0:2 -map 0:3 -map 0:4 -map_metadata 0 result.MP4


    


    This produces the error :

    


    Could not find tag for codec none in stream #2, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:4 --


    


    As I understand it this means that ffmpeg doesn't apply the -c copy operation correctly and instead complains that there is no encoder for the data streams. The same error happens for 0:2 and 0:4

    


    While searching on google if have found some people who have had the same issue in the past but I have also found some reports of it working.

    


    Any ideas what am I doing wrong or is this actually a bug ?

    


    Here is the ffprobe and the link to the GoPro file.

    


    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'source.MP4':
  Metadata:
    major_brand     : mp41
    minor_version   : 538120216
    compatible_brands: mp41
    creation_time   : 2021-05-17T22:36:48.000000Z
    firmware        : HD7.01.01.90.00
  Duration: 00:00:02.88, start: 0.000000, bitrate: 58664 kb/s
  Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), 2704x1520 [SAR 1:1 DAR 169:95], 58557 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2021-05-17T22:36:48.000000Z
      handler_name    : GoPro H.265
      vendor_id       : [0][0][0][0]
      encoder         : GoPro H.265 encoder
      timecode        : 02:43:36:15
  Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 187 kb/s (default)
    Metadata:
      creation_time   : 2021-05-17T22:36:48.000000Z
      handler_name    : GoPro AAC
      vendor_id       : [0][0][0][0]
      timecode        : 02:43:36:15
  Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2021-05-17T22:36:48.000000Z
      handler_name    : GoPro TCD
      timecode        : 02:43:36:15
  Stream #0:3(eng): Data: bin_data (gpmd / 0x646D7067), 30 kb/s (default)
    Metadata:
      creation_time   : 2021-05-17T22:36:48.000000Z
      handler_name    : GoPro MET
  Stream #0:4(eng): Data: none (fdsc / 0x63736466), 16 kb/s (default)
    Metadata:
      creation_time   : 2021-05-17T22:36:48.000000Z
      handler_name    : GoPro SOS
Unsupported codec with id 0 for input stream 2
Unsupported codec with id 100359 for input stream 3
Unsupported codec with id 0 for input stream 4


    


  • Anomalie #4345 : super_cron HS en https

    26 janvier 2020, par jluc -