Recherche avancée

Médias (91)

Autres articles (57)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

Sur d’autres sites (7002)

  • how can I copy file frame by frame to get exactly the same file ? (FFmpeg)

    14 février 2018, par user3360601

    I was using an ffmpeg example from original source remuxing.c to copy file by frames. It works, but the result file has another structure inside. enter image description here

    From the left is original file. It has "framerate" field. Moreover, the copy file has smaller size. On 18 bytes less.

    Question : how can I copy file frame by frame to get exactly the same file ? Including "framerate" field and total size ?

    Code from the source site.

       /*
    * Copyright (c) 2013 Stefano Sabatini
    *
    * Permission is hereby granted, free of charge, to any person obtaining a copy
    * of this software and associated documentation files (the "Software"), to deal
    * in the Software without restriction, including without limitation the rights
    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    * copies of the Software, and to permit persons to whom the Software is
    * furnished to do so, subject to the following conditions:
    *
    * The above copyright notice and this permission notice shall be included in
    * all copies or substantial portions of the Software.
    *
    * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    * THE SOFTWARE.
    */

    /**
    * @file
    * libavformat/libavcodec demuxing and muxing API example.
    *
    * Remux streams from one container format to another.
    * @example remuxing.c
    */

    #include <libavutil></libavutil>timestamp.h>
    #include <libavformat></libavformat>avformat.h>

    static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt, const char *tag)
    {
       AVRational *time_base = &amp;fmt_ctx->streams[pkt->stream_index]->time_base;

       printf("%s: pts:%s pts_time:%s dts:%s dts_time:%s duration:%s duration_time:%s stream_index:%d\n",
              tag,
              av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, time_base),
              av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, time_base),
              av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, time_base),
              pkt->stream_index);
    }

    int main(int argc, char **argv)
    {
       AVOutputFormat *ofmt = NULL;
       AVFormatContext *ifmt_ctx = NULL, *ofmt_ctx = NULL;
       AVPacket pkt;
       const char *in_filename, *out_filename;
       int ret, i;
       int stream_index = 0;
       int *stream_mapping = NULL;
       int stream_mapping_size = 0;

       if (argc &lt; 3) {
           printf("usage: %s input output\n"
                  "API example program to remux a media file with libavformat and libavcodec.\n"
                  "The output format is guessed according to the file extension.\n"
                  "\n", argv[0]);
           return 1;
       }

       in_filename  = argv[1];
       out_filename = argv[2];

       av_register_all();

       if ((ret = avformat_open_input(&amp;ifmt_ctx, in_filename, 0, 0)) &lt; 0) {
           fprintf(stderr, "Could not open input file '%s'", in_filename);
           goto end;
       }

       if ((ret = avformat_find_stream_info(ifmt_ctx, 0)) &lt; 0) {
           fprintf(stderr, "Failed to retrieve input stream information");
           goto end;
       }

       av_dump_format(ifmt_ctx, 0, in_filename, 0);

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

       stream_mapping_size = ifmt_ctx->nb_streams;
       stream_mapping = av_mallocz_array(stream_mapping_size, sizeof(*stream_mapping));
       if (!stream_mapping) {
           ret = AVERROR(ENOMEM);
           goto end;
       }

       ofmt = ofmt_ctx->oformat;

       for (i = 0; i &lt; ifmt_ctx->nb_streams; i++) {
           AVStream *out_stream;
           AVStream *in_stream = ifmt_ctx->streams[i];
           AVCodecParameters *in_codecpar = in_stream->codecpar;

           if (in_codecpar->codec_type != AVMEDIA_TYPE_AUDIO &amp;&amp;
               in_codecpar->codec_type != AVMEDIA_TYPE_VIDEO &amp;&amp;
               in_codecpar->codec_type != AVMEDIA_TYPE_SUBTITLE) {
               stream_mapping[i] = -1;
               continue;
           }

           stream_mapping[i] = stream_index++;

           out_stream = avformat_new_stream(ofmt_ctx, NULL);
           if (!out_stream) {
               fprintf(stderr, "Failed allocating output stream\n");
               ret = AVERROR_UNKNOWN;
               goto end;
           }

           ret = avcodec_parameters_copy(out_stream->codecpar, in_codecpar);
           if (ret &lt; 0) {
               fprintf(stderr, "Failed to copy codec parameters\n");
               goto end;
           }
           out_stream->codecpar->codec_tag = 0;
       }
       av_dump_format(ofmt_ctx, 0, out_filename, 1);

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

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

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

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

           in_stream  = ifmt_ctx->streams[pkt.stream_index];
           if (pkt.stream_index >= stream_mapping_size ||
               stream_mapping[pkt.stream_index] &lt; 0) {
               av_packet_unref(&amp;pkt);
               continue;
           }

           pkt.stream_index = stream_mapping[pkt.stream_index];
           out_stream = ofmt_ctx->streams[pkt.stream_index];
           log_packet(ifmt_ctx, &amp;pkt, "in");

           /* copy packet */
           pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
           pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
           pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);
           pkt.pos = -1;
           log_packet(ofmt_ctx, &amp;pkt, "out");

           ret = av_interleaved_write_frame(ofmt_ctx, &amp;pkt);
           if (ret &lt; 0) {
               fprintf(stderr, "Error muxing packet\n");
               break;
           }
           av_packet_unref(&amp;pkt);
       }

       av_write_trailer(ofmt_ctx);
    end:

       avformat_close_input(&amp;ifmt_ctx);

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

       av_freep(&amp;stream_mapping);

       if (ret &lt; 0 &amp;&amp; ret != AVERROR_EOF) {
           fprintf(stderr, "Error occurred: %s\n", av_err2str(ret));
           return 1;
       }

       return 0;
    }
  • How to solve issue for converting ismv file of h264 video codec and aac audio codec ?

    4 octobre 2013, par Priyal

    I want to convert transmux ismv file to mp4 format. ISMV file is encoded withe the following ffmpeg detail :

      Metadata:
      major_brand     : isml
      minor_version   : 1
      compatible_brands: piffiso2
      creation_time   : 2013-10-03 14:10:41
      Duration: 15:21:13.16, start: 0.000000, bitrate: 41 kb/s
      Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64
                        kb/s (default)
      Metadata:
      creation_time   : 2013-10-03 14:10:41
      handler_name    : Audio
      Stream #0:1(und): Video: h264 (avc1 / 0x31637661), 1280x720, 3217 kb/s, 29.9
                        7 tbr, 10000k tbn, 20000k tbc (default)
    Metadata:
      creation_time   : 2013-10-03 14:10:41
      handler_name    : Video
      Stream #0:2(und): Data: none (dfxp / 0x70786664), 32 kb/s (default)
      Metadata:
      creation_time   : 2013-10-03 14:10:41
      handler_name    : Text

    I used the following ffmpeg command to transmux :

    ffmpeg -y -ss 00:00:10 -i Encoder1.ismv -vcodec libx264 -ar 44100 -t 40 -preset slow -qp 0  
    Encoder.mp4

    I got output as :

    ffmpeg version N-56010-g54d628a Copyright (c) 2000-2013 the FFmpeg developers
    built on Sep  4 2013 00:44:27 with gcc 4.7.3 (GCC)
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
    isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
    e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
    ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
    ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
    eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
    amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
    enable-libxvid --enable-zlib
        libavutil      52. 43.100 / 52. 43.100
        libavcodec     55. 31.100 / 55. 31.100
        libavformat    55. 16.100 / 55. 16.100
        libavdevice    55.  3.100 / 55.  3.100
        libavfilter     3. 83.102 /  3. 83.102
        libswscale      2.  5.100 /  2.  5.100
        libswresample   0. 17.103 /  0. 17.103
        libpostproc    52.  3.100 / 52.  3.100
    [aac @ 040f1ba0] TYPE_FIL: Input buffer exhausted before END element found
    [h264 @ 00353120] AVC: nal size -729776398
    [h264 @ 00353120] no frame!
    [h264 @ 00353120] AVC: nal size -570515285
    [h264 @ 00353120] no frame!
    [h264 @ 00353120] AVC: nal size -1477874754
    [h264 @ 00353120] no frame!
    [h264 @ 00353120] AVC: nal size -712314563
    [h264 @ 00353120] no frame!
    [h264 @ 00353120] AVC: nal size -23151524
    [h264 @ 00353120] no frame!
    [h264 @ 00353120] AVC: nal size -592499201
    [h264 @ 00353120] no frame!
    [h264 @ 00353120] AVC: nal size 225768173
    [h264 @ 00353120] no frame!
    [h264 @ 00353120] AVC: nal size 698187359
    [h264 @ 00353120] AVC: nal size 635127544
    [h264 @ 00353120] no frame!
    [h264 @ 00353120] AVC: nal size -1242688339
    [h264 @ 00353120] AVC: nal size 269543071
    [h264 @ 00353120] no frame!
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0035e840] decoding for stream 1 failed
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0035e840] Could not find codec parameters for stream
     1 (Video: h264 (avc1 / 0x31637661), 1280x720, 3217 kb/s): unspecified pixel form
     at Consider increasing the value for the &#39;analyzeduration&#39; and &#39;probesize&#39; options
     Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#39;C:\inetpub\media\archives\DEFAULT WEB S
     ITE\PushToPUblishPoint\Eagan_12034_Soccer_3-10-2013_14_10_19-isml\2013-10-03-14-
     10-35-436\Segment001\Encoder1.ismv&#39;:
      Metadata:
      major_brand     : isml
      minor_version   : 1
      compatible_brands: piffiso2
      creation_time   : 2013-10-03 14:10:41
      Duration: 15:21:13.16, start: 0.000000, bitrate: 41 kb/s
      Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64
                        kb/s (default)
       Metadata:
      creation_time   : 2013-10-03 14:10:41
      handler_name    : Audio
      Stream #0:1(und): Video: h264 (avc1 / 0x31637661), 1280x720, 3217 kb/s, 29.9
                        7 tbr, 10000k tbn, 20000k tbc (default)
      Metadata:
      creation_time   : 2013-10-03 14:10:41
      handler_name    : Video
      Stream #0:2(und): Data: none (dfxp / 0x70786664), 32 kb/s (default)
      Metadata:
      creation_time   : 2013-10-03 14:10:41
      handler_name    : Text

    [buffer @ 04679480] Unable to parse option value "-1" as pixel format
                  Last message repeated 1 times
    [buffer @ 04679480] Error setting option pix_fmt to value -1.
    [graph 0 input from stream 0:1 @ 040f7380] Error applying options to the filter.

    Error opening filters!

    Please suggest the solution for Windows OS

  • The First Problem

    19 janvier 2011, par Multimedia Mike — HTML5

    A few years ago, The Linux Hater made the following poignant observation regarding Linux driver support :

    Drivers are only just the beginning... But for some reason y’all like to focus on the drivers. You know why lusers do that ? Because it just happens to be the problem that people notice first.

    And so it is with the HTML5 video codec debate, re-invigorated in the past week by Google’s announcement of dropping native H.264 support in their own HTML5 video tag implementation. As I read up on the fiery debate, I kept wondering why people are so obsessed with this issue. Then I remembered the Linux Hater’s post and realized that the video codec issue is simply the first problem that most people notice regarding HTML5 video.

    I appreciate that the video codec debate has prompted Niedermayer to post on his blog once more. Otherwise, I’m just munching popcorn on the sidelines, amused and mildly relieved that the various factions are vociferously attacking each other rather than that little project I help with at work.

    Getting back to the "first problem" aspect— there’s so much emphasis on the video codec ; I wonder why no one ever, ever mentions word one about an audio codec. AAC is typically the codec that pairs with H.264 in the MPEG stack. Dark Shikari once mentioned that "AAC’s licensing terms are exponentially more onerous than H.264′s. If Google didn’t want to use H.264, they would sure as hell not want to use AAC." Most people are probably using "H.264" to refer to the entire MPEG/H.264/AAC stack, even if they probably don’t understand what all of those pieces mean.

    Anyway, The Linux Hater’s driver piece continues :

    Once y’all have drivers, the fight will move to the next layer up. And like I said, it’s a lot harder at that layer.

    A few months ago, when I wanted to post the WebM output of my new VP8 encoder and thought it would be a nice touch to deliver it via a video tag, I ignored the video codec problem (just encoded a VP8/WebM file) only to immediately discover a problem at a different layer— specifically, embedding a file using a video tag triggers a full file download when the page is loaded, which is unacceptable from end user and web hosting perspectives. This is a known issue but doesn’t get as much attention, I guess because there are bigger problems to solve first (c.f. video codec issue).

    For other issues, check out the YouTube blog’s HTML5 post or Hulu’s post that also commented on HTML5. Issues such as video streaming flexibility, content protection, fullscreen video, webcam/microphone input, and numerous others are rarely mentioned in the debates. Only "video codec" is of paramount importance.

    But I’m lending too much weight to the cacophony of a largely uninformed internet debate. Realistically, I know there are many talented engineers down in the trenches working to solve at least some of these problems. To tie this in with the Linux driver example, I’m consistently stunned these days regarding how simple it is to get Linux working on a new computer— most commodity consumer hardware really does just work right out of the box. Maybe one day, we’ll wake up and find that HTML5 video has advanced to the point that it solves all of the relevant problems to make it the simple and obvious choice for delivering web video in nearly all situations.

    It won’t be this year.