Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (33)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • MediaSPIP Player : les contrôles

    26 mai 2010, par

    Les contrôles à la souris du lecteur
    En plus des actions au click sur les boutons visibles de l’interface du lecteur, il est également possible d’effectuer d’autres actions grâce à la souris : Click : en cliquant sur la vidéo ou sur le logo du son, celui ci se mettra en lecture ou en pause en fonction de son état actuel ; Molette (roulement) : en plaçant la souris sur l’espace utilisé par le média (hover), la molette de la souris n’exerce plus l’effet habituel de scroll de la page, mais diminue ou (...)

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

Sur d’autres sites (2911)

  • Access violation reading location 0x000000148965F000

    14 février 2014, par user3012914

    I tried to encode BMP Images, which i get from a buffer and store it as a H264 Video. I am stuck with these errors the arrive randomly and repeatedly

    I am using Visual Studio 2012

    1) Access violation reading location 0x000000148965F000.

    2)Heap corruption

    The debug shows the error at this point

       struct SwsContext* fooContext = sws_getContext(_imgWidth,_imgHeight,PIX_FMT_RGB32,c->width,c->height,PIX_FMT_YUV420P, SWS_FAST_BILINEAR,NULL,NULL,NULL);
                       sws_scale(fooContext, inpic->data, inpic->linesize, 0, c->height, outpic->data, outpic->linesize);    // converting frame size and format

    I guess the read violation happens due to non - pre initialized values. But i couldnt exactly understand why. I have also attached part of the code below

    PagedImage *inImg = getUpdatedInputImage(0);
           ML_CHECK(inImg);
           ImageVector imgExt = inImg->getImageExtent();
           if ((imgExt.x == _imgWidth) && (imgExt.y == _imgHeight))
           {
               if (((imgExt.x % 4) == 0) && ((imgExt.y % 4) == 0))
               {
                  _numFramesFld->setIntValue(_numFramesFld->getIntValue() + 1);
                   MLFree(unicodeFilename);
                   // configure header
                   //BITMAPINFO bitmapInfo
                   // read out input image and write output image into video
                   // get input image as an array
                   void* imgData = NULL;
                   SubImageBox imageBox(imgExt); // get the whole image
                   getTile(inImg, imageBox, MLuint8Type, &imgData);
                   MLuint8* iData = (MLuint8*)imgData;
                   // since we have only images with
                   // a z-ext of 1, we can compute the c stride as follows
                   int cStride = _imgWidth * _imgHeight;
                   int offset  = 0;
                   MLuint8 r=0, g=0, b=0;
                   // pointer into the bitmap that is
                   // used to write images into an video
                   UCHAR* dst = (UCHAR*)_bits;
                   for (int y = _imgHeight-1; y >= 0; y--)
                   { // reversely scan the image. if y-rows of DIB are set in normal order, no compression will be available.
                       offset = _imgWidth * y;
                       for (int x = 0; x < _imgWidth; x++)
                       {
                           if (_isGreyValueImage)
                           {
                               r = iData[offset + x];
                               *dst++ = (UCHAR)r;
                               *dst++ = (UCHAR)r;
                               *dst++ = (UCHAR)r;
                           }
                           else
                           {
                               b = iData[offset + x]; // windows bitmap need reverse order: bgr instead of rgb
                               g = iData[offset + x + cStride          ];
                               r = iData[offset + x + cStride + cStride];
                               *dst++ = (UCHAR)r;
                               *dst++ = (UCHAR)g;
                               *dst++ = (UCHAR)b;
                           }
                           // alpha channel in input image is ignored
                       }
                   }
                   outbuf_size = 100000 + c->width*c->height*(32>>3);      // allocate output buffer
                   outbuf = static_cast(malloc(outbuf_size));
                   fileName_ = (_outputFilenameFld->getStringValue()).c_str();
                   FILE* f = fopen(fileName_,"wb");                    // opening video file for writing
                   if(!f)
                   {
                       _messageFld->setStringValue("Cannot open file");
                   }
                   else _messageFld->setStringValue("Opened video file for writing\n");

                   //for(i=0;i<_numFramesFld->getIntValue();i++)
                   //{
                       fflush(stdout);
                       int nbytes = avpicture_get_size(PIX_FMT_YUV420P, c->width, c->height);                                // allocating outbuffer
                       uint8_t* outbuffer = (uint8_t*)av_malloc(nbytes*sizeof(uint8_t));
                       AVFrame* inpic = avcodec_alloc_frame();                                                               // mandatory frame allocation
                       AVFrame* outpic = avcodec_alloc_frame();
                       //outpic->pts = (int64_t)((float)i * (1000.0/((float)(c->time_base.den))) * 90);                        // setting frame pts
                       avpicture_fill((AVPicture*)inpic,(uint8_t*)dst, PIX_FMT_RGB32, c->width, c->height);                            // fill image with input screenshot
                       avpicture_fill((AVPicture*)outpic, outbuffer, PIX_FMT_YUV420P, c->width, c->height);                  // clear output picture for buffer copy
                       av_image_alloc(outpic->data, outpic->linesize, c->width, c->height, c->pix_fmt, 1);

                       inpic->data[0] += inpic->linesize[0]*(c->height-1);                                                   // flipping frame
                       inpic->linesize[0] = -inpic->linesize[0];                                                             // flipping frame

                       struct SwsContext* fooContext = sws_getContext(_imgWidth,_imgHeight,PIX_FMT_RGB32,c->width,c->height,PIX_FMT_YUV420P, SWS_FAST_BILINEAR,NULL,NULL,NULL);
                       sws_scale(fooContext, inpic->data, inpic->linesize, 0, c->height, outpic->data, outpic->linesize);    // converting frame size and format
                       out_size = avcodec_encode_video(c, outbuf, outbuf_size, outpic);                                      // encoding video
                       _messageFld->setStringValue("Encoding frame %3d (size=%5d)\n");
                        fwrite(outbuf, 1, out_size, f);
                        delete [] dst;                                                                                         // freeing memory
                       av_free(outbuffer);    
                       av_free(inpic);
                       av_free(outpic);
                       av_free(fooContext);
                       DeleteObject(_hbitmap);

                       for(int Z = 0; Z/ encode the delayed frames
                           fwrite(outbuf, 1, out_size, f);
                       }
                       //outbuf[0] = 0x00;
                       //outbuf[1] = 0x00;                                                                                               // add sequence end code to have a real mpeg file
                       //outbuf[2] = 0x01;
                       //outbuf[3] = 0xb7;
                       //fwrite(outbuf, 1, 4, f);
                       fclose(f);
                       avcodec_close(c);                                                                                               // freeing memory
                       free(outbuf);
                       av_free(c);
                       printf("Closed codec and Freed\n");
                   }
               }
  • HTTP Header for Duration of a MP4 for HTML 5 video

    9 mars 2014, par Mustafa

    I am trying to stream MP4 video as it is encoded from a webserver. I believe I used the appropriate flags, but it is not working correctly. When I download the video from my stream and open it with VLC, it properly shows the duration. Since a socket is not seekable, I assume it writes the metadata to end ? My Chrome browser always shows 8 seconds duration. The first 8 seconds plays at the normal speed, but afterwards the pause button turns into play button and the video plays very fast, probably as fast as it is recieved. However the audio is played at normal speed. I tried document.getElementById('myVid').duration = 20000 but it is a readonly field.

    I wonder, is there anyway to explicitly state the duration in HTTP headers or in any other way ? I cannot find any documentation about it.

    ffmpeg -i - -vcodec libx264 -acodec libvo_aacenc -ar 44100 -ac 2 -ab 128000 -f mp4 -movflags frag_keyframe+faststart pipe:1 -fflags +genpts -re -profile baseline -level 30 -preset fast

    To close-voters, that thinks it is not programming related, I use it in my own server I coded, and I need to set the duration programatically via JavaScript or setting the HTTP header. I believe it may be related to both ffmpeg or http headers, that's why I posted it here.

    app.get("/video/*", function(req,res){
       res.writeHead(200, {
           'Content-Type': 'video/mp4',
       });
       var dir = req.url.split("/").splice(2).join("/");
       var buf = new Buffer(dir, 'base64');
       var src = buf.toString();

       var Transcoder = require('stream-transcoder');
       var stream = fs.createReadStream(src);
       // I added my own flags to this module, they are at below:
       new Transcoder(stream)
           .videoCodec('libx264')
           .audioCodec("libvo_aacenc")
           .sampleRate(44100)
           .channels(2)
           .audioBitrate(128 * 1000)
           .format('mp4')
           .on('finish', function() {
               console.log("finished");
           })
           .stream().pipe(res);
    });

    exec function in that stream-transcoder module,

       a.push("-fflags");
       a.push("+genpts");
       a.push("-re");
       a.push("-profile");
       a.push("baseline");
       a.push("-level");
       a.push("30");
       a.push("-preset");
       a.push("fast");
       a.push("-strict");
       a.push("experimental");
       a.push("-frag_duration");
       a.push("" + 2 * (1000 * 1000));
       var child = spawn('ffmpeg', a, {
           cwd: os.tmpdir()
       });
  • FFMPEG stops converting

    19 février 2014, par user3328745

    I've got Ubuntu 12.04 LTS, which runs Wowza Media Server, so I use FFmpeg as a transcoder for live streaming and JWplayer on my website. But ffmpeg always stops converting, and I have to input the command again and again. So here is the command :

    nohup ffmpeg -i rtsp://log:pass@<cameraip>:554/live1.sdp -ar 44100 -ab 128k -f flv -b 5000k -s 480x270 -y rtmp://<serverip>:1935/live/camera.stream &amp;
    </serverip></cameraip>

    And that's what i get

    ffmpeg version 0.8.10-4:0.8.10-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers
     built on Feb  6 2014 20:56:59 with gcc 4.6.3
    *** THIS PROGRAM IS DEPRECATED ***
    This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
    [rtsp @ 0x25317a0] Estimating duration from bitrate, this may be inaccurate

    Seems stream 0 codec frame rate differs from container frame rate: 150.00 (150/1) -> 1000.00 (1000/1)
    Input #0, rtsp, from &#39;rtsp://log:pass@<cameraip>:554/live1.sdp&#39;:
     Metadata:
       title           : RTSP/RTP stream 1 from DCS-2132L
       comment         : live1.sdp with v2.0
     Duration: N/A, start: 0.000000, bitrate: N/A
       Stream #0.0: Video: h264 (High), yuvj420p, 640x360 [PAR 1:1 DAR 16:9], 75 fps, 1k tbr, 90k tbn, 150 tbc
       Stream #0.1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s
    Incompatible pixel format &#39;yuvj420p&#39; for codec &#39;mpeg4&#39;, auto-selecting format &#39;yuv420p&#39;
    [buffer @ 0x2539f80] w:640 h:360 pixfmt:yuvj420p
    [scale @ 0x253a940] w:640 h:360 fmt:yuvj420p -> w:480 h:270 fmt:yuv420p flags:0x4
    Incompatible sample format &#39;s16&#39; for codec &#39;ac3&#39;, auto-selecting format &#39;flt&#39;
    [ac3 @ 0x2531120] channel_layout not specified
    [ac3 @ 0x2531120] No channel layout specified. The encoder will guess the layout, but it might be incorrect.
    [ac3 @ 0x2531120] invalid bit rate
    Output #0, avi, to &#39;rtmp://<serverip>:1935/live/camera.stream&#39;:
       Stream #0.0: Video: mpeg4, yuv420p, 480x270 [PAR 1:1 DAR 16:9], q=2-31, 1024 kb/s, 90k tbn, 1k tbc
       Stream #0.1: Audio: ac3, 22050 Hz, mono, flt, 1024 kb/s
    Stream mapping:
     Stream #0.0 -> #0.0
     Stream #0.1 -> #0.1
    Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
    </serverip></cameraip>

    Plese, help me to correct the errors