Recherche avancée

Médias (91)

Autres articles (50)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (6069)

  • ffmpeg, ffprobe : don’t "merge" side data into packet data by default

    9 mars 2017, par wm4
    ffmpeg, ffprobe : don’t "merge" side data into packet data by default
    

    Preparation for potentially disabling merged side data by default in the
    libs. Do this in particular because it affects fate tests.

    The changed tests either reflect added packet side data, or the changed
    packet size due to merged side data removal reducing the packet size.

    • [DH] ffmpeg_opt.c
    • [DH] ffprobe.c
    • [DH] libavformat/tests/seek.c
    • [DH] tests/ref/fate/gaplessenc-itunes-to-ipod-aac
    • [DH] tests/ref/fate/gaplessenc-pcm-to-mov-aac
    • [DH] tests/ref/fate/gaplessinfo-itunes1
    • [DH] tests/ref/fate/gaplessinfo-itunes2
    • [DH] tests/ref/fate/mov-aac-2048-priming
    • [DH] tests/ref/seek/cache-pipe
    • [DH] tests/ref/seek/extra-mp3
    • [DH] tests/ref/seek/lavf-ts
    • [DH] tests/ref/seek/mkv-codec-delay
  • "Invalid data found when processing input" no matter the FFMPEG configuration

    25 mars 2017, par Jamie Bonnett

    I’ve been stumped on this for a while now, no matter the configuration if use in NodeJS I always get the same error "Error : ffmpeg exited with code 1".

    Here’s my code :

    var http = require('http');
    var fs = require('fs');
    var ffmpeg = require('fluent-ffmpeg');

    var server = http.createServer(function(req, res) {

       var seektime = 100;
       var pathToMovie = __dirname + '/src/video.mp4';
       var stat = fs.statSync(pathToMovie);
       res.writeHead(200, {
           'Content-Type': 'video/mp4',
           'Content-Length': stat.size
       });

       var proc = new ffmpeg(pathToMovie)
       .seekInput(seektime)
       .withVideoBitrate(1024)
       .withVideoCodec('libx264')
       .withAspect('16:9')
       .withFps(24)
       .toFormat('mp4');

       var ffstream = proc.pipe(res, {end:true});
       ffstream.on('data', function(chunk) {
           console.log('ffmpeg just wrote ' + chunk.length + ' bytes');
       });

    });
    server.listen(8000);

    I have no idea what to do now. Any ideas ?

    Thanks,
    Jamie

  • ffmpeg av_read_frame "Invalid data found"

    26 mai 2017, par DweebsUnited

    I am using ffmpeg to cut part of a file, following the remux example provided. However, I am having issues reading from files. I am given a file descriptor as input and an output filename, and can successfully set up the output file, read the stream info, copy all the streams, etc, etc. On the first call to av_read_frame though, I get an "Invalid data found when processing input" error. I have tried this with many different video files, and have not been able to get a single one to process correctly.

    Here is my code. I get no errors anywhere, except av_read_frame, which gives Invalid data found no matter what video file I give it.

    char path[512];
    sprintf(path, "pipe:%d", fileno(fp));


    AVOutputFormat *ofmt = NULL;
    AVFormatContext *ifmt_ctx = avformat_alloc_context(), *ofmt_ctx = NULL;
    AVPacket pkt;
    int ret, i;

    av_register_all();
    avcodec_register_all();

    if ((ret = avformat_open_input(&ifmt_ctx, path, av_find_input_format("mp4"), NULL)) < 0) {
       LOG("Could not open input file '%s'", path);
       goto end;
    }

    if ((ret = avformat_find_stream_info(ifmt_ctx, 0)) < 0) {
       LOG("Failed to retrieve input stream information", "");
       goto end;
    }

    avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, out_filename);
    if (!ofmt_ctx) {
       LOG("Could not create output context\n");
       ret = AVERROR_UNKNOWN;
       goto end;
    }

    ofmt = ofmt_ctx->oformat;

    for (i = 0; i < ifmt_ctx->nb_streams; i++) {
       AVStream *in_stream = ifmt_ctx->streams[i];
       AVStream *out_stream = avformat_new_stream(ofmt_ctx, in_stream->codec->codec);

       if (!out_stream) {
           LOG("Failed allocating output stream\n");
           goto end;
       }

       ret = avcodec_parameters_copy(out_stream->codecpar, in_stream->codecpar);
       if (ret < 0) {
           LOG("Failed to copy context from input to output stream codec context\n");
           goto end;
       }
       out_stream->codecpar->codec_tag = 0;
    }

    if (!(ofmt->flags & AVFMT_NOFILE)) {
       ret = avio_open(&ofmt_ctx->pb, out_filename, AVIO_FLAG_WRITE);
       if (ret < 0) {
           LOG("Could not open output file '%s'", out_filename);
           goto end;
       }
    }

    ret = avformat_write_header(ofmt_ctx, NULL);
    if (ret < 0) {
       LOG("Error occurred when opening output file\n");
       goto end;
    }

    //    int indexs[8] = {0};

    //    int64_t start_from = 8*AV_TIME_BASE;
    ret = av_seek_frame(ifmt_ctx, -1, from_seconds*AV_TIME_BASE, AVSEEK_FLAG_ANY);
    if (ret < 0) {
       LOG("Error seek\n");
       goto end;
    }

    int64_t *dts_start_from;
    int64_t *pts_start_from;
    dts_start_from = (int64_t *) malloc(sizeof(int64_t) * ifmt_ctx->nb_streams);
    memset(dts_start_from, 0, sizeof(int64_t) * ifmt_ctx->nb_streams);
    pts_start_from = (int64_t *) malloc(sizeof(int64_t) * ifmt_ctx->nb_streams);
    memset(pts_start_from, 0, sizeof(int64_t) * ifmt_ctx->nb_streams);

    while (1) {
       AVStream *in_stream, *out_stream;

       ret = av_read_frame(ifmt_ctx, &pkt);
       if (ret < 0)
           break;

       in_stream = ifmt_ctx->streams[pkt.stream_index];
       out_stream = ofmt_ctx->streams[pkt.stream_index];

       if (av_q2d(in_stream->time_base) * pkt.pts > end_seconds) {
           av_packet_unref(&pkt);
           break;
       }

       if (dts_start_from[pkt.stream_index] == 0)
           dts_start_from[pkt.stream_index] = pkt.dts;
       if (pts_start_from[pkt.stream_index] == 0)
           pts_start_from[pkt.stream_index] = pkt.pts;

       /* copy packet */
       pkt.pts = ::av_rescale_q_rnd(pkt.pts - pts_start_from[pkt.stream_index], in_stream->time_base, out_stream->time_base, (AVRounding) (AV_ROUND_NEAR_INF |
                                                                                                                                           AV_ROUND_PASS_MINMAX));
       pkt.dts = ::av_rescale_q_rnd(pkt.dts - dts_start_from[pkt.stream_index], in_stream->time_base, out_stream->time_base, (AVRounding) (AV_ROUND_NEAR_INF |
                                                                                                                                           AV_ROUND_PASS_MINMAX));
       if (pkt.pts < 0) {
           pkt.pts = 0;
       }
       if (pkt.dts < 0) {
           pkt.dts = 0;
       }
       pkt.duration = (int) av_rescale_q((int64_t) pkt.duration, in_stream->time_base, out_stream->time_base);
       pkt.pos = -1;

       ret = av_interleaved_write_frame(ofmt_ctx, &pkt);
       if (ret < 0) {
           LOG("Error muxing packet\n");
           break;
       }
       av_packet_unref(&pkt);
    }
    free(dts_start_from);
    free(pts_start_from);

    av_write_trailer(ofmt_ctx);

    end:
    LOG("END");

    avformat_close_input(&ifmt_ctx);

    /* close output */
    if (ofmt_ctx && !(ofmt->flags & AVFMT_NOFILE))
       avio_closep(&ofmt_ctx->pb);
    avformat_free_context(ofmt_ctx);

    if (ret < 0 && ret != AVERROR_EOF) {
       LOG("-- Error occurred: %s\n", av_err2str(ret));
       return 1;
    }

    Thank you for any help, I’m still getting used to ffmpeg. Did I miss some setting on the input ? Am I not setting something up that I need to be ? This problem is really stumping me.