Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (87)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (8666)

  • FFmpeg returns empty byte when retrieving frames with python

    13 août 2020, par Ronald Saunfe

    I am trying to retrieve frames from a video frame by frame using ffmpeg which i downloaded here but i get an empty response as byte :
i need someone to outline what my problem is.I got the solution from a blog here
Here is my source code :

    


    import subprocess as sp

command=['bin\\ffmpeg.exe',
'-i','%s'%self.source,
'-f','image2pipe',
'-pix_fmt','rgb24',
'-vcodex','rawvideo','-']

self.pipe = sp.Popen(command, stdout = sp.PIPE, bufsize = 10**8)
Raw_image = self.pipe.stdout.read(420*360*3)


    


  • Encoding of video returns 0, and nothing written to the output file

    14 juillet 2014, par AnilJ

    I have written a code to record the webcam feed into a file on disk. I am attempting to do this using IContainer class rather than IMediaWriter class. I am pasting the code snippet below showing important sections of the code.

    The problem I am facing is that nothing is being written to the file. Some of the observations I have made are as follows :

    1. In the Record() function, the ’while’ loop is kicked off, but the mVideoEncoder.encodeVideo(packet, frame, offset) ; method always returns zero (0). This results in no picture complete and no data is being written to the output file. Can you please provide clue as to what is missing ?
    2. I checked that the frame size is 80640, which confirms that frame has data.
    3. I see that only header and trailer is being written to the file.

    Let me know if you need any other information.

    public class WebcamRecorder {

       private boolean StartVideoEncoder() {

           boolean result = true;

           // Open a container
           mPositionInMicroseconds = 0;
           mOutputContainer = IContainer.make();
           mOutputContainer.open(mOutputFileName, IContainer.Type.WRITE, null);

           // Create the video stream and get its coder
           ICodec videoCodec = ICodec.findEncodingCodec(ICodec.ID.CODEC_ID_H264);
           IStream videoStream = mOutputContainer.addNewStream(videoCodec);
           mVideoEncoder = videoStream.getStreamCoder();

           // Setup the stream coder
           mFrameRate = IRational.make(1, 30);
           mVideoEncoder.setWidth(Constants.RESAMPLE_PICT_WIDTH);
           mVideoEncoder.setHeight(Constants.RESAMPLE_PICT_HEIGHT);
           mVideoEncoder.setFrameRate(mFrameRate);
           mVideoEncoder.setTimeBase(IRational.make(mFrameRate.getDenominator(),
                                     mFrameRate.getNumerator()));
           mVideoEncoder.setBitRate(350000);
           mVideoEncoder.setNumPicturesInGroupOfPictures(30);
           mVideoEncoder.setPixelType(IPixelFormat.Type.YUV420P);
           mVideoEncoder.setFlag(IStreamCoder.Flags.FLAG_QSCALE, true);
           mVideoEncoder.setGlobalQuality(0);

           // Open the encoder
           mVideoEncoder.open(null, null);

           // Write the header
           mOutputContainer.writeHeader();

           return result;
       }

       public void Record() {

           picture = GetNextPicture();
           image = Utils.videoPictureToImage(picture);
           // convert to the right image type
           BufferedImage bgrScreen = ConvertToType(image, BufferedImage.TYPE_3BYTE_BGR);
           IConverter converter = ConverterFactory.createConverter(bgrScreen, mVideoEncoder.getPixelType());
           IVideoPicture frame = converter.toPicture(bgrScreen, mPositionInMicroseconds);
           frame.setQuality(0);

           IPacket packet = IPacket.make();
           int offset = 0;
           while (offset < frame.getSize()) {
               int bytesEncoded = mVideoEncoder.encodeVideo(packet, frame, offset);
               if (bytesEncoded < 0) {
                   throw new RuntimeException("Unable to encode video.");
               }
               offset += bytesEncoded;

               if (packet.isComplete()) {
                   System.out.println("Packet is complete");
                   if (mOutputContainer.writePacket(packet) < 0) {
                       throw new RuntimeException(
                               "Could not write packet to container.");
                   }

                   // Update frame time
                   mPositionInMicroseconds += (mFrameRate.getDouble() * Math.pow(1000, 2));
                   break;
               }
           }
       }

       public void Cleanup() {

           if (mOutputContainer != null) {
               mOutputContainer.writeTrailer();
               mOutputContainer.close();
               // mOutputContainer.flushPackets();
           }

           if (mVideoEncoder != null) {
               mVideoEncoder.close();
           }
       }
    }
  • Add ’audio/mp3’ and related MIME checks for flash, correct edge case where play({type :’audio/mp3’}) would use HTML5 when preferFlash = true due to seeming lack of Flash support for the MIME type.

    24 juin 2012, par Scott Schiller

    m script/soundmanager2-jsmin.js m script/soundmanager2-nodebug-jsmin.js m script/soundmanager2-nodebug.js m script/soundmanager2.js Add ’audio/mp3’ and related MIME checks for flash, correct edge case where play(type :’audio/mp3’) would use HTML5 when preferFlash = true due to seeming lack of (...)