Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (50)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (5765)

  • Using FFMPEG to reliably convert videos to mp4 for iphone/ipod and flash players

    23 avril 2016, par Jake Stevenson

    I need to convert videos for use in both a flash player and the iphone/ipod touch. I’m using the following batch script with ffmpeg :

    @echo off
    ffmpeg.exe -i %1 -s qvga -acodec libfaac -ar 22050 -ab 128k -vcodec libx264 -threads 0 -f ipod %2

    This always outputs an mp4 file, and I can always play it on my PC. The videos also seem to play fine on my iphone 3GS. But with some input files it won’t work for older iphone versions (3G and iPod touch).

    Here’s the ffmpeg output from one such file :

    D:\ffmpeg>encode.bat d:\temp\recording.flv d:\temp\out.m4v
    FFmpeg version SVN-r18709, Copyright (c) 2000-2009 Fabrice Bellard, et al.
     configuration: --enable-memalign-hack --prefix=/mingw --cross-prefix=i686-ming
    w32- --cc=ccache-i686-mingw32-gcc --target-os=mingw32 --arch=i686 --cpu=i686 --e
    nable-avisynth --enable-gpl --enable-zlib --enable-bzlib --enable-libgsm --enabl
    e-libfaac --enable-libfaad --enable-pthreads --enable-libvorbis --enable-libtheo
    ra --enable-libspeex --enable-libmp3lame --enable-libopenjpeg --enable-libxvid -
    -enable-libschroedinger --enable-libx264
     libavutil     50. 3. 0 / 50. 3. 0
     libavcodec    52.27. 0 / 52.27. 0
     libavformat   52.32. 0 / 52.32. 0
     libavdevice   52. 2. 0 / 52. 2. 0
     libswscale     0. 7. 1 /  0. 7. 1
     built on Apr 28 2009 04:04:42, gcc: 4.2.4
    [flv @ 0x187d650]skipping flv packet: type 18, size 164, flags 0
    Input #0, flv, from 'd:\temp\recording.flv':
     Duration: 00:00:07.17, start: 0.001000, bitrate: N/A
       Stream #0.0: Video: flv, yuv420p, 320x240, 1k tbr, 1k tbn, 1k tbc
       Stream #0.1: Audio: nellymoser, 44100 Hz, mono, s16
    [libx264 @ 0x13518b0]using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE
    4.2
    [libx264 @ 0x13518b0]profile Baseline, level 4.2
    Output #0, ipod, to 'd:\temp\out.m4v':
       Stream #0.0: Video: libx264, yuv420p, 320x240, q=2-31, 200 kb/s, 1k tbn, 1k
    tbc
       Stream #0.1: Audio: libfaac, 22050 Hz, mono, s16, 128 kb/s
    Stream mapping:
     Stream #0.0 -> #0.0
     Stream #0.1 -> #0.1
    Press [q] to stop encoding
    frame=   90 fps=  0 q=-1.0 Lsize=     128kB time=6.87 bitrate= 152.4kbits/s
    video:92kB audio:32kB global headers:1kB muxing overhead 2.620892%
    [libx264 @ 0x13518b0]slice I:8     Avg QP:29.62  size:  7047
    [libx264 @ 0x13518b0]slice P:82    Avg QP:30.83  size:   467
    [libx264 @ 0x13518b0]mb I  I16..4: 17.9%  0.0% 82.1%
    [libx264 @ 0x13518b0]mb P  I16..4:  0.6%  0.0%  0.0%  P16..4: 23.1%  0.0%  0.0%
    0.0%  0.0%    skip:76.3%
    [libx264 @ 0x13518b0]final ratefactor: 57.50
    [libx264 @ 0x13518b0]SSIM Mean Y:0.9544735
    [libx264 @ 0x13518b0]kb/s:8412.6

    My suspicion is that it has something to do with the audio encoding. If so, does anyone know how to force it to reencode the audio to the proper format ?

    Any other ideas ?

  • iPhone HTTP Streaming .m3u8 and .ts files - how to create using ffmpeg

    8 septembre 2013, par ChessDev

    I'm trying to get apple-validated http media streams using ffmpeg and am getting errors. Here are some error examples :

    WARNING : Playlist Content-Type is 'application/x-mpegurl', but should
    be one of 'application/vnd.apple.mpegurl', 'audio/x-mpegurl' or
    'audio/mpegurl'.

    WARNING : 258 samples (88.966 %) do not have timestamps in track 256
    (avc1). 4 : us2-1.ts
     

    WARNING : Media segment duration outside of expected duration by 47.733
     % (5.23 vs. 10.00 seconds, limit is 20 %). 40 : us2-19.ts
     

    Average segment duration: 10.16 seconds
    Average segment bitrate: 320.12 kbit/s
    Average segment structural overhead: 175.89 kbit/s (54.94 %)

    Video codec: avc1
    Video resolution: 320x320 pixels
    Video frame rate: 29.72, 29.78, 29.82, 30.00, 29.64 fps
    Average video bitrate: 100.66 kbit/s
    H.264 profile: Baseline
    H.264 level: 3.0

    Audio codec: aac
    Audio sample rate: 48000 Hz
    Average audio bitrate: 43.57 kbit/s

    Here is the end file I've been submitting : http://files.chesscomfiles.com/images_users/using/us2.m3u8

    Here is the file I used to create this : http://files.chesscomfiles.com/images_users/using/using-computers-1.mp4

    I've tried these commands, among others :

    ffmpeg -i using-computers-1.mp4 -f mpegts -acodec libfaac -ar 48000
    -ab 64k -s 320x320 -vcodec libx264 -vbsf h264_mp4toannexb -b 96k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 2 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 96k -bufsize 96k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -g 30 -async 2 us2.ts

    ffmpeg -i using-computers-1.mp4 -f mpegts -acodec libfaac -ar 48000
    -ab 64k -s 320x320 -vcodec libx264 -vbsf h264_mp4toannexb -b 96k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 96k -bufsize 96k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -g 30 -async 2 us1.ts

    ffmpeg -i using-computers-1.mp4 -vbsf h264_mp4toannexb -acodec copy -vcodec copy -f mpegts output.ts

    If someone can help me figure out what ffmpeg commands I should be running I'd really appreciate it !

  • FFMPEG : directly decode packets after encoding

    18 avril 2012, par user1282931

    using FFMPEG API, I try to encode a x264 video to a MP4 file with 0 frame latency and also, in realtime, show the currently encoded frame on screen (with encoding artifacts). The encoding to the file works, but so far I don't get the frames decoded right after writing them to the file. What I try is to feed the packetdata that is returned from avcodec_encode_video() right into avcodec_decode_video2() but the function returns -1 and the cmd output shows :

    [h264 @ 00000000025F0710] non-existing PPS 0 referenced
    [h264 @ 00000000025F0710] decode_slice_header error
    [h264 @ 00000000025F0710] no frame

    here is some code i use for encoding :

    AVPacket FFMpegEncoder2::write_video_frame(AVFrame* pic, int &numBytes)
    {
       int out_size, ret;

       AVPacket pkt;


       /* encode the image */
       out_size = avcodec_encode_video(m_cctx, m_outbuf,
                                           m_outbufSize, pic);
       /* If size is zero, it means the image was buffered. */
       assert(out_size>0) //0 frame delay

       av_init_packet(&pkt);

       if (m_cctx->coded_frame->pts != AV_NOPTS_VALUE)
             pkt.pts = av_rescale_q(m_cctx->coded_frame->pts,m_cctx->time_base, m_video_st->time_base);
       if (m_cctx->coded_frame->key_frame)
             pkt.flags |= AV_PKT_FLAG_KEY;
       pkt.stream_index = m_video_st->index;
       pkt.data         = m_outbuf;
       pkt.size         = out_size;

       /* Write the compressed frame to the media file. */
       ret = av_interleaved_write_frame(m_fctx, &pkt);

       if (ret != 0) {
           fprintf(stderr, "Error while writing video frame\n");
           exit(1);
       }
       numBytes = out_size;
       return pkt;
    }

    and then I take this returned packet and feed it into the decoder :

    const AVFrame* FFMpegDecoder2::decode(AVPacket* packet){
       AVPacket pkt;
       av_init_packet(&pkt);
       pkt.size = packet->size;
       pkt.data = packet->data;

       int len=0;
       int got_picture=0;


       while (pkt.size > 0) {
               len = avcodec_decode_video2(m_cctx, m_frame, &got_picture, &pkt);
               if (len < 0) {
                   fprintf(stderr, "Error while decoding frame %d\n", m_f);
                   exit(1);
               }
               if (got_picture) {
                   assert(pkt.size==len);
                   m_f++;
               }
               pkt.size -= len;
               pkt.data += len;
           }
       assert(got_picture);
       return m_frame;
    }

    but as stated, avcodec_decode_video2() returns -1

    what am I doing wrong ? Do i need to feed some headerdata into the decoder first somehow ?

    //edit :

    if i set

    m_formatCtx->oformat->flags &= ~AVFMT_GLOBALHEADER;
    m_codecctx->flags &= ~CODEC_FLAG_GLOBAL_HEADER;

    then i can decode the returned packet without error, but the written mp4 file will be black.

    //edit : this is how i setup the decoder :

    FFMpegDecoder2::FFMpegDecoder2(CodecID id)
       : m_codec(NULL)
       , m_cctx(NULL)
    {


       /* Initialize libavcodec, and register all codecs and formats. */
       avcodec_register_all();

       m_codec = avcodec_find_decoder(id);
       if (!m_codec) {
           fprintf(stderr, "codec not found\n");
           exit(1);
       }

       m_cctx = avcodec_alloc_context3(m_codec);
       m_cctx->codec = m_codec;
       m_cctx->pix_fmt = PIX_FMT_YUV420P;

       avcodec_open2(m_cctx, m_codec, NULL);

       //alloc frame
       m_frame = avcodec_alloc_frame();
    }

    this is what the memory window shows for the first packet (didn't copy all. the size of the first packet is 7859) :

    0x0000000002E66670  00 00 01 06 05 ff ff 55 dc 45 e9 bd e6 d9 48 b7 96 2c d8 20 d9 23 ee ef 78 32 36 34 20 2d 20 63 6f 72 65 20 31 32 30 20 72 32 31 34 36 20 62  .....ÿÿUÜEé.æÙH·–,Ø Ù#îïx264 - core 120 r2146 b
    0x0000000002E6669F  63 64 34 31 64 62 20 2d 20 48 2e 32 36 34 2f 4d 50 45 47 2d 34 20 41 56 43 20 63 6f 64 65 63 20 2d 20 43 6f 70 79 6c 65 66 74 20 32 30 30 33  cd41db - H.264/MPEG-4 AVC codec - Copyleft 2003
    0x0000000002E666CE  2d 32 30 31 31 20 2d 20 68 74 74 70 3a 2f 2f 77 77 77 2e 76 69 64 65 6f 6c 61 6e 2e 6f 72 67 2f 78 32 36 34 2e 68 74 6d 6c 20 2d 20 6f 70 74  -2011 - http://www.videolan.org/x264.html - opt
    0x0000000002E666FD  69 6f 6e 73 3a 20 63 61 62 61 63 3d 30 20 72 65 66 3d 33 20 64 65 62 6c 6f 63 6b 3d 31 3a 30 3a 30 20 61 6e 61 6c 79 73 65 3d 30 78 33 3a 30  ions: cabac=0 ref=3 deblock=1:0:0 analyse=0x3:0
    0x0000000002E6672C  78 31 31 33 20 6d 65 3d 68 65 78 20 73 75 62 6d 65 3d 34 20 70 73 79 3d 31 20 70 73 79 5f 72 64 3d 31 2e 30 30 3a 30 2e 30 30 20 6d 69 78 65  x113 me=hex subme=4 psy=1 psy_rd=1.00:0.00 mixe
    0x0000000002E6675B  64 5f 72 65 66 3d 31 20 6d 65 5f 72 61 6e 67 65 3d 31 36 20 63 68 72 6f 6d 61 5f 6d 65 3d 31 20 74 72 65 6c 6c 69 73 3d 30 20 38 78 38 64 63  d_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dc
    0x0000000002E6678A  74 3d 31 20 63 71 6d 3d 30 20 64 65 61 64 7a 6f 6e 65 3d 32 31 2c 31 31 20 66 61 73 74 5f 70 73 6b 69 70 3d 31 20 63 68 72 6f 6d 61 5f 71 70  t=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp
    0x0000000002E667B9  5f 6f 66 66 73 65 74 3d 30 20 74 68 72 65 61 64 73 3d 31 20 73 6c 69 63 65 64 5f 74 68 72 65 61 64 73 3d 30 20 6e 72 3d 30 20 64 65 63 69 6d  _offset=0 threads=1 sliced_threads=0 nr=0 decim
    0x0000000002E667E8  61 74 65 3d 31 20 69 6e 74 65 72 6c 61 63 65 64 3d 30 20 62 6c 75 72 61 79 5f 63 6f 6d 70 61 74 3d 30 20 63 6f 6e 73 74 72 61 69 6e 65 64 5f  ate=1 interlaced=0 bluray_compat=0 constrained_
    0x0000000002E66817  69 6e 74 72 61 3d 30 20 62 66 72 61 6d 65 73 3d 30 20 77 65 69 67 68 74 70 3d 32 20 6b 65 79 69 6e 74 3d 32 35 20 6b 65 79 69 6e 74 5f 6d 69  intra=0 bframes=0 weightp=2 keyint=25 keyint_mi
    0x0000000002E66846  6e 3d 32 20 73 63 65 6e 65 63 75 74 3d 34 30 20 69 6e 74 72 61 5f 72 65 66 72 65 73 68 3d 30 20 72 63 3d 61 62 72 20 6d 62 74 72 65 65 3d 30  n=2 scenecut=40 intra_refresh=0 rc=abr mbtree=0
    0x0000000002E66875  20 62 69 74 72 61 74 65 3d 34 30 30 20 72 61 74 65 74 6f 6c 3d 31 2e 30 20 71 63 6f 6d 70 3d 30 2e 36 30 20 71 70 6d 69 6e 3d 30 20 71 70 6d   bitrate=400 ratetol=1.0 qcomp=0.60 qpmin=0 qpm
    0x0000000002E668A4  61 78 3d 36 39 20 71 70 73 74 65 70 3d 34 20 69 70 5f 72 61 74 69 6f 3d 31 2e 34 30 20 61 71 3d 31 3a 31 2e 30 30 00 80 00 00 00 01 65 88 84  ax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00.€....eˆ.
    0x0000000002E668D3  11 ef ff f8 22 0f 8a 00 02 09 7e 38 00 08 45 c7 00 01 1d c9 39 3d 87 ff e0 ac 13 03 6d 05 f1 00 10 00 10 12 88 04 00 04 02 60 70 4e 2d cc 38  .ïÿø".Š...~8..EÇ...É9=.ÿà¬..m.ñ.....ˆ....`pN-Ì8
    0x0000000002E66902  27 16 e6 07 21 1a e6 1c 84 6b 9f f0 f0 27 15 f2 7b 87 ff c1 58 2a 8a 00 04 b8 80 00 58 00 04 02 62 01 03 c1 c1 04 63 07 04 11 88 90 b1 89 0b  '.æ.!.æ..kŸðð'.ò{.ÿÁX*Š..¸€.X...b..ÁÁ.c...ˆ.±..
    0x0000000002E66931  1f 2c 11 02 b1 40 00 87 8f a4 f7 0f ff 82 b0 55 06 93 41 c4 10 51 00 00 40 14 00 04 00 a3 b7 35 b7 30 38 26 1e e6 1c 13 0f 73 f2 c1 10 2b 14  .,..±@...¤÷.ÿ.°U.“AÄ.Q..@....£·5·08&.æ...sòÁ.+.
    0x0000000002E66960  1f 1f 1c 32 7f 94 11 82 a1 40 01 f1 00 00 40 14 01 22 00 01 e0 1e 22 0a e3 83 1c 19 3d f8 7f e0 b0 16 03 01 22 0f 88 00 02 00 00 16 20 01 17  ...2.”..¡@.ñ..@.."..à.".ãƒ..=ø.à°...".ˆ..... ..
    0x0000000002E6698F  03 84 c2 5c 87 09 84 b9 06 4a e4 a4 ae 08 82 d8 e0 00 20 0f 1d 93 df c3 fe 0b 01 54 50 07 88 a8 80 00 64 09 88 58 88 58 83 84 1d 88 38 41 d8  ..Â\.....J䤮..Øà. ..“ßÃþ..TP.ˆ¨€.d.ˆXˆXƒ..ˆ8AØ
    0x0000000002E669BE  f2 c1 10 2b 14 00 08 f8 e0 00 62 38 64 ff 08 70 13 0a c1 d2 e9 b5 5d ba 10 80 09 a2 01 2e 07 04 c2 dc 87 04 c2 dc 81 c8 66 b9 0e 43 35 cb 0f  òÁ.+...øà.b8dÿ.p..ÁÒéµ]º.€.¢....ÂÜ..ÂÜ.Èf..C5Ë.
    0x0000000002E669ED  ff c1 10 27 2c 00 7e 8e 00 05 64 e4 f6 1f ff 82 28 a0 00 21 99 e3 80 00 99 ac 70 00 11 39 93 93 d8 7f fe 0a c1 40 34 9a 0b e3 40 00 84 40 01  ÿÁ.',.~Ž..däö.ÿ.( .!™ã€.™¬p..9““Ø.þ.Á@4š.ã@..@.
    0x0000000002E66A1C  00 01 02 88 fd cd 7d cc 0e 08 a4 dc c3 82 29 37 3f e0 88 14 8b f1 c3 1c 03 27 f0 c3 60 a0 50 62 86 da 36 1f 10 00 0a 80 00 80 14 40 00 20 00  ...ˆýÍ}Ì..¤ÜÃ.)7?àˆ..ñÃ..'ðÃ` Pb.Ú6....€.€.@. .

    and this is the encoders output (until after encoding frame 0) :

    [libx264 @ 00000000005ADAA0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShu
    ffle SSE4.2
    [libx264 @ 00000000005ADAA0] profile High, level 3.0
    [libx264 @ 00000000005ADAA0] 264 - core 120 r2146 bcd41db - H.264/MPEG-4 AVC cod
    ec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=0 r
    ef=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=4 psy=1 psy_rd=1.00:0.00 mixed
    _ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pski
    p=1 chroma_qp_offset=0 threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 b
    luray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=25 keyint_min=2 sc
    enecut=40 intra_refresh=0 rc=abr mbtree=0 bitrate=100 ratetol=1.0 qcomp=0.60 qpm
    in=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'out2.mp4':
       Stream #0:0: Video: h264, yuv420p, 640x480, q=-1--1, 100 kb/s, 90k tbn, 25 t
    bc
    [mp4 @ 0000000000467570] Encoder did not produce proper pts, making some up.