Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (98)

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

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (8405)

  • ffmpeg create RTP stream

    27 novembre 2016, par DankMemes

    I’m trying to encode and stream using ffmpeg (libavcodec/libavformat - MSVC x64 with Zeranoe builds)

    Here is my code, largely adapted from the encoding example, error handling removed

    #include "stdafx.h"
    extern "C" {
    #include <libavformat></libavformat>avformat.h>
    #include <libavcodec></libavcodec>avcodec.h>

    #include <libavutil></libavutil>opt.h>
    #include <libavutil></libavutil>channel_layout.h>
    #include <libavutil></libavutil>common.h>
    #include <libavutil></libavutil>imgutils.h>
    #include <libavutil></libavutil>mathematics.h>
    #include <libavutil></libavutil>samplefmt.h>
    }
    #pragma comment(lib, "avformat.lib")
    #pragma comment(lib, "avutil.lib")
    #pragma comment(lib, "avcodec.lib")

    int main() {
       avcodec_register_all();
       av_register_all();
       avformat_network_init();

       AVCodecID codec_id = AV_CODEC_ID_H264;
       AVCodec *codec;
       AVCodecContext *c = NULL;
       int i, ret, x, y, got_output;
       AVFrame *frame;
       AVPacket pkt;

       codec = avcodec_find_encoder(codec_id);
       c = avcodec_alloc_context3(codec);

       c->bit_rate = 400000;
       c->width = 352;
       c->height = 288;
       c->time_base.num = 1;
       c->time_base.den = 25;
       c->gop_size = 25;
       c->max_b_frames = 1;
       c->pix_fmt = AV_PIX_FMT_YUV420P;
       c->codec_type = AVMEDIA_TYPE_VIDEO;
       c->flags = CODEC_FLAG_GLOBAL_HEADER;

       if (codec_id == AV_CODEC_ID_H264) {
           ret = av_opt_set(c->priv_data, "preset", "ultrafast", 0);
           ret = av_opt_set(c->priv_data, "tune", "zerolatency", 0);
       }

       avcodec_open2(c, codec, NULL)

       frame = av_frame_alloc();
       frame->format = c->pix_fmt;
       frame->width = c->width;
       frame->height = c->height;
       ret = av_image_alloc(frame->data, frame->linesize, c->width, c->height,
           c->pix_fmt, 32);

       AVFormatContext* avfctx;
       AVOutputFormat* fmt = av_guess_format("rtp", NULL, NULL);

       ret = avformat_alloc_output_context2(&amp;avfctx, fmt, fmt->name,
           "rtp://127.0.0.1:49990");

       printf("Writing to %s\n", avfctx->filename);

       avio_open(&amp;avfctx->pb, avfctx->filename, AVIO_FLAG_WRITE)

       struct AVStream* stream = avformat_new_stream(avfctx, codec);
       stream->codecpar->bit_rate = 400000;
       stream->codecpar->width = 352;
       stream->codecpar->height = 288;
       stream->codecpar->codec_id = AV_CODEC_ID_H264;
       stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
       stream->time_base.num = 1;
       stream->time_base.den = 25;

       avformat_write_header(avfctx, NULL);
       char buf[200000];
       AVFormatContext *ac[] = { avfctx };
       av_sdp_create(ac, 1, buf, 20000);
       printf("sdp:\n%s\n", buf);
       FILE* fsdp;
       fopen_s(&amp;fsdp, "test.sdp", "w");
       fprintf(fsdp, "%s", buf);
       fclose(fsdp);
       system("PAUSE");
       system("start "" \"C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe\" test.sdp");

       int j = 0;
       for (i = 0; i &lt; 10000; i++) {
           av_init_packet(&amp;pkt);
           pkt.data = NULL;    // packet data will be allocated by the encoder
           pkt.size = 0;
           fflush(stdout);
           /* prepare a dummy image */
           /* Y */
           for (y = 0; y &lt; c->height; y++) {
               for (x = 0; x &lt; c->width; x++) {
                   frame->data[0][y * frame->linesize[0] + x] = x + y + i * 3;
               }
           }
           /* Cb and Cr */
           for (y = 0; y &lt; c->height / 2; y++) {
               for (x = 0; x &lt; c->width / 2; x++) {
                   frame->data[1][y * frame->linesize[1] + x] = 128 + y + i * 2;
                   frame->data[2][y * frame->linesize[2] + x] = 64 + x + i * 5;
               }
           }
           frame->pts = i;
           /* encode the image */
           ret = avcodec_send_frame(c, frame);
           ret = avcodec_receive_packet(c, &amp;pkt);

           if (ret == AVERROR_EOF) {
               got_output = false;
               printf("Stream EOF\n");
           } else if(ret == AVERROR(EAGAIN)) {
               got_output = false;
               printf("Stream EAGAIN\n");
           } else {
               got_output = true;
           }

           if (got_output) {
               printf("Write frame %3d (size=%5d)\n", j++, pkt.size);
               av_interleaved_write_frame(avfctx, &amp;pkt);
               av_packet_unref(&amp;pkt);
           }

           Sleep(40);
       }

       // end
       ret = avcodec_send_frame(c, NULL);

       /* get the delayed frames */
       for (; ; i++) {
           fflush(stdout);
           ret = avcodec_receive_packet(c, &amp;pkt);
           if (ret == AVERROR_EOF) {
               printf("Stream EOF\n");
               break;
           } else if (ret == AVERROR(EAGAIN)) {
               printf("Stream EAGAIN\n");
               got_output = false;
           } else {
               got_output = true;
           }

           if (got_output) {
               printf("Write frame %3d (size=%5d)\n", j++, pkt.size);
               av_interleaved_write_frame(avfctx, &amp;pkt);
               av_packet_unref(&amp;pkt);
           }
       }

       avcodec_close(c);
       av_free(c);
       av_freep(&amp;frame->data[0]);
       av_frame_free(&amp;frame);
       printf("\n");
       system("pause");
       return 0;
    }

    However VLC (opened with the generated SDP file) isn’t able to play the stream. Messages has this

    core error: ES_OUT_RESET_PCR called

    followed by repeated

    packetizer_h264 warning: waiting for SPS/PPS
    core debug: Buffering <some percent="percent">%
    </some>

    What am I doing wrong ?

  • FFmpeg(C/libav) VPX to mpeg2video stream cannot be reproduce in VLC

    21 septembre 2017, par caiomcg

    I am currently trying to transcode a VPX(VP8/VP9) video to a mpeg2video and stream it over UDP with mpegts.

    I have initialized all of the contexts and the streams and as long as I stream it to ffplay it works, if I send the stream to VLC or another player, the receiver only display the first frame and do nothing else. If I do the same thing through the command line it works flawlessly - ffmpeg -re -i video.webm -an -f mpegts udp://127.0.0.1:8080

    My output context :

    this->output_codec_ctx_->codec_type    = AVMEDIA_TYPE_VIDEO; // Set media type
    this->output_codec_ctx_->pix_fmt       = AV_PIX_FMT_YUV420P; // Set stream pixel format
    this->output_codec_ctx_->time_base.den = ceil(av_q2d(input_stream->r_frame_rate));     // Add the real video framerate. Eg.: 29.9
    this->output_codec_ctx_->time_base.num = 1;                  // Numerator of the framerate. Eg.: num/29.9
    this->output_codec_ctx_->width         = input_stream->codecpar->width;  // Video width
    this->output_codec_ctx_->height        = input_stream->codecpar->height; // Video height
    this->output_codec_ctx_->bit_rate      = 400000; // Video quality
    this->output_codec_ctx_->gop_size      = 12;
    this->output_codec_ctx_->max_b_frames  = 2;
    this->output_codec_ctx_->framerate     = this->input_codec_ctx_->framerate;
    this->output_codec_ctx_->sample_aspect_ratio     = this->input_codec_ctx_->sample_aspect_ratio;

    My av_dump :

    Output #0, mpegts, to 'udp://127.0.0.1:20010':
     Metadata:
       encoder         : Lavf57.72.101
       Stream #0:0: Video: mpeg2video (Main), 1 reference frame, yuv420p, 480x640 (0x0), q=2-31, 400 kb/s, SAR 1:1 DAR 3:4, 24 fps, 24 tbr, 90k tbn

    FFMPEG av_dump :

    Output #0, mpegts, to 'udp://127.0.0.1:20010':
     Metadata:
       title           : Tears of Steel
       encoder         : Lavf57.72.101
       Stream #0:0: Video: mpeg2video (Main), yuv420p, 480x640 [SAR 1:1 DAR 3:4], q=2-31, 200 kb/s, 24 fps, 90k tbn, 24 tbc (default)
       Metadata:
         encoder         : Lavc57.96.101 mpeg2video
       Side data:
         cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1

    Any ideia on what I may be doing wrong ?

  • ffmpeg generates file with only audio from ts

    8 novembre 2016, par Seoman

    I’m trying to get some parts of a ts video and then merge them into a new video. The problem is that when doing the split, the video is lost. The splits only contains audio. Here is the video source information :

    ffmpeg -i source_file.ts

    ffmpeg version 3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
    built with Apple LLVM version 7.3.0 (clang-703.0.29)
    configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
    libavutil      55. 17.103 / 55. 17.103
    libavcodec     57. 24.102 / 57. 24.102
    libavformat    57. 25.100 / 57. 25.100
    libavdevice    57.  0.101 / 57.  0.101
    libavfilter     6. 31.100 /  6. 31.100
    libavresample   3.  0.  0 /  3.  0.  0
    libswscale      4.  0.100 /  4.  0.100
    libswresample   2.  0.101 /  2.  0.101
    libpostproc    54.  0.100 / 54.  0.100
    Input #0, mpegts, from '97274181.ts':
    Duration: 00:02:30.70, start: 60.000000, bitrate: 3582 kb/s
    Program 1
    Stream #0:0[0x100]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 139 kb/s
    Stream #0:1[0x101]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, unknown/bt709/unknown), 1920x1080, 60 fps, 60 tbr, 90k tbn, 2k tbc
    Stream #0:2[0x102]: Data: timed_id3 (ID3  / 0x20334449)
    At least one output file must be specified

    This is the command used for doing the split :

    ffmpeg -ss 10 -i source_file.ts -t 5 -c copy cut1.ts

    And this is the video information after the cut :

    ffmpeg version 3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
    built with Apple LLVM version 7.3.0 (clang-703.0.29)
    configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
    libavutil      55. 17.103 / 55. 17.103
    libavcodec     57. 24.102 / 57. 24.102
    libavformat    57. 25.100 / 57. 25.100
    libavdevice    57.  0.101 / 57.  0.101
    libavfilter     6. 31.100 /  6. 31.100
    libavresample   3.  0.  0 /  3.  0.  0
    libswscale      4.  0.100 /  4.  0.100
    libswresample   2.  0.101 /  2.  0.101
    libpostproc    54.  0.100 / 54.  0.100
    [NULL @ 0x7fc9ba008000] start time for stream 0 is not set in estimate_timings_from_pts
    [mpegts @ 0x7fc9b9800000] Could not find codec parameters for stream 0 (Video: h264 ([27][0][0][0] / 0x001B), none): unspecified size
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, mpegts, from 'siri1.ts':
    Duration: 00:00:05.08, start: 1.400000, bitrate: 148 kb/s
    Program 1
    Metadata:
     service_name    : Service01
     service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 ([27][0][0][0] / 0x001B), none, 90k tbr, 90k tbn, 180k tbc
    Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 120 kb/s
    At least one output file must be specified

    If I reproduce cut1.ts I can only hear the audio. Video is gone.