Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (42)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

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

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

Sur d’autres sites (7120)

  • Problem with FFMPEG and PHP

    10 septembre 2014, par ziritrion

    I know this isn’t exactly a programming question per se, but rather a settings question, but still :

    I’m trying to convert video with FFMPEG with a PHP script, following this tutorial :

    http://vexxhost.com/blog/2007/05/20/how-to-convertencode-files-to-flv-using-ffmpeg-php/

    FFMPEG works perfectly and I’ve used it from the command line a number of times. PHP also seems to work fine. I’ve also installed ffmpeg-php and it seems to be loading file.

    The problem lies when I try to do the following in PHP :

    $srcFile = "p1.avi" ;

    $ffmpegObj = new ffmpeg_movie($srcFile) ;

    No matter what, PHP will return this :

    Warning : can’t open movie file p1.avi in /var/www/converter.php on line xx

    Obviously, whatever call I do afterwards with $ffmpegObj will throw a fatal error. I’m absolutely stuck and extensive googling hasn’t helped much.

    If you must know, I’m using Ubuntu 9.04 with the default LAMP server packages as well as php5-ffmpeg, and I’ve compiled ffmpeg following a tutorial I found on Ubuntuforums (I’d link to it but stackoverflow won’t let me)

    Thanks !

  • 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();
           }
       }
    }
  • 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)