Recherche avancée

Médias (91)

Autres articles (60)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

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

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

Sur d’autres sites (4584)

  • Revision 32596 : minuscules et fin pour aujourd’hui

    1er novembre 2009, par fil@… — Log

    minuscules et fin pour aujourd’hui

  • javax.media.NoDataSinkException

    23 novembre 2022, par Divya

    I am trying to convert Jpeg images into .mov video file

    



     package com.ecomm.pl4mms.test;&#xA;&#xA;import java.io.*;&#xA;import java.util.*;&#xA;import java.awt.Dimension;&#xA;&#xA;import javax.media.*;&#xA;import javax.media.control.*;&#xA;import javax.media.protocol.*;&#xA;import javax.media.protocol.DataSource;&#xA;import javax.media.datasink.*;&#xA;import javax.media.format.VideoFormat;&#xA;import javax.media.format.JPEGFormat;&#xA;&#xA;public class JpegImagesToMovie implements ControllerListener, DataSinkListener {&#xA;&#xA;    public boolean doItPath(int width, int height, int frameRate, Vector inFiles, String outputURL) {&#xA;        // Check for output file extension.&#xA;        if (!outputURL.endsWith(".mov") &amp;&amp; !outputURL.endsWith(".MOV")) {&#xA;            // System.err.println("The output file extension should end with a&#xA;            // .mov extension");&#xA;            prUsage();&#xA;        }&#xA;&#xA;        // Generate the output media locators.&#xA;        MediaLocator oml;&#xA;&#xA;        if ((oml = createMediaLocator("file:" &#x2B; outputURL)) == null) {&#xA;            // System.err.println("Cannot build media locator from: " &#x2B;&#xA;            // outputURL);&#xA;            //System.exit(0);&#xA;        }&#xA;&#xA;        boolean success = doIt(width, height, frameRate, inFiles, oml);&#xA;&#xA;        System.gc();&#xA;        return success;&#xA;    }&#xA;&#xA;    public boolean doIt(int width, int height, int frameRate, Vector inFiles, MediaLocator outML) {&#xA;        try {&#xA;            System.out.println(inFiles.size());&#xA;            ImageDataSource ids = new ImageDataSource(width, height, frameRate, inFiles);&#xA;&#xA;            Processor p;&#xA;&#xA;            try {&#xA;                // System.err.println("- create processor for the image&#xA;                // datasource ...");&#xA;                System.out.println("processor");&#xA;                p = Manager.createProcessor(ids);&#xA;                System.out.println("success");&#xA;            } catch (Exception e) {&#xA;                // System.err.println("Yikes! Cannot create a processor from the&#xA;                // data source.");&#xA;                return false;&#xA;            }&#xA;&#xA;            p.addControllerListener(this);&#xA;&#xA;            // Put the Processor into configured state so we can set&#xA;            // some processing options on the processor.&#xA;            p.configure();&#xA;            if (!waitForState(p, p.Configured)) {&#xA;                System.out.println("Issue configuring");&#xA;                // System.err.println("Failed to configure the processor.");&#xA;                p.close();&#xA;                p.deallocate();&#xA;                return false;&#xA;            }&#xA;            System.out.println("Configured");&#xA;&#xA;            // Set the output content descriptor to QuickTime.&#xA;            p.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.QUICKTIME));&#xA;System.out.println(outML);&#xA;            // Query for the processor for supported formats.&#xA;            // Then set it on the processor.&#xA;            TrackControl tcs[] = p.getTrackControls();&#xA;            Format f[] = tcs[0].getSupportedFormats();&#xA;            System.out.println(f[0].getEncoding());&#xA;            if (f == null || f.length &lt;= 0) {&#xA;                 System.err.println("The mux does not support the input format: " &#x2B; tcs[0].getFormat());&#xA;                p.close();&#xA;                p.deallocate();&#xA;                return false;&#xA;            }&#xA;&#xA;            tcs[0].setFormat(f[0]);&#xA;&#xA;            // System.err.println("Setting the track format to: " &#x2B; f[0]);&#xA;&#xA;            // We are done with programming the processor. Let&#x27;s just&#xA;            // realize it.&#xA;            p.realize();&#xA;            if (!waitForState(p, p.Realized)) {&#xA;                // System.err.println("Failed to realize the processor.");&#xA;                p.close();&#xA;                p.deallocate();&#xA;                return false;&#xA;            }&#xA;&#xA;            // Now, we&#x27;ll need to create a DataSink.&#xA;            DataSink dsink;&#xA;            if ((dsink = createDataSink(p, outML)) == null) {&#xA;                // System.err.println("Failed to create a DataSink for the given&#xA;                // output MediaLocator: " &#x2B; outML);&#xA;                p.close();&#xA;                p.deallocate();&#xA;                return false;&#xA;            }&#xA;&#xA;            dsink.addDataSinkListener(this);&#xA;            fileDone = false;&#xA;&#xA;            // System.err.println("start processing...");&#xA;&#xA;            // OK, we can now start the actual transcoding.&#xA;            try {&#xA;                p.start();&#xA;                dsink.start();&#xA;            } catch (IOException e) {&#xA;                p.close();&#xA;                p.deallocate();&#xA;                dsink.close();&#xA;                // System.err.println("IO error during processing");&#xA;                return false;&#xA;            }&#xA;&#xA;            // Wait for EndOfStream event.&#xA;            waitForFileDone();&#xA;&#xA;            // Cleanup.&#xA;            try {&#xA;                dsink.close();&#xA;            } catch (Exception e) {&#xA;            }&#xA;            p.removeControllerListener(this);&#xA;&#xA;            // System.err.println("...done processing.");&#xA;&#xA;            p.close();&#xA;&#xA;            return true;&#xA;        } catch (NotConfiguredError e) {&#xA;            // TODO Auto-generated catch block&#xA;            e.printStackTrace();&#xA;        }&#xA;&#xA;        return false;&#xA;    }&#xA;&#xA;    /**&#xA;     * Create the DataSink.&#xA;     */&#xA;    DataSink createDataSink(Processor p, MediaLocator outML) {&#xA;System.out.println("In data sink");&#xA;        DataSource ds;&#xA;&#xA;        if ((ds = p.getDataOutput()) == null) {&#xA;         System.out.println("Something is really wrong: the processor does not have an output DataSource");&#xA;            return null;&#xA;        }&#xA;&#xA;        DataSink dsink;&#xA;&#xA;        try {&#xA;             System.out.println("- create DataSink for: " &#x2B; ds.toString()&#x2B;ds.getContentType());&#xA;            dsink = Manager.createDataSink(ds, outML);&#xA;            dsink.open();&#xA;            System.out.println("Done data sink");&#xA;        } catch (Exception e) {&#xA;             System.err.println("Cannot create the DataSink: " &#x2B;e);&#xA;             e.printStackTrace();&#xA;            return null;&#xA;        }&#xA;&#xA;        return dsink;&#xA;    }&#xA;&#xA;    Object waitSync = new Object();&#xA;    boolean stateTransitionOK = true;&#xA;&#xA;    /**&#xA;     * Block until the processor has transitioned to the given state. Return&#xA;     * false if the transition failed.&#xA;     */&#xA;    boolean waitForState(Processor p, int state) {&#xA;        synchronized (waitSync) {&#xA;            try {&#xA;                while (p.getState() &lt; state &amp;&amp; stateTransitionOK)&#xA;                    waitSync.wait();&#xA;            } catch (Exception e) {&#xA;            }&#xA;        }&#xA;        return stateTransitionOK;&#xA;    }&#xA;&#xA;    /**&#xA;     * Controller Listener.&#xA;     */&#xA;    public void controllerUpdate(ControllerEvent evt) {&#xA;&#xA;        if (evt instanceof ConfigureCompleteEvent || evt instanceof RealizeCompleteEvent&#xA;                || evt instanceof PrefetchCompleteEvent) {&#xA;            synchronized (waitSync) {&#xA;                stateTransitionOK = true;&#xA;                waitSync.notifyAll();&#xA;            }&#xA;        } else if (evt instanceof ResourceUnavailableEvent) {&#xA;            synchronized (waitSync) {&#xA;                stateTransitionOK = false;&#xA;                waitSync.notifyAll();&#xA;            }&#xA;        } else if (evt instanceof EndOfMediaEvent) {&#xA;            evt.getSourceController().stop();&#xA;            evt.getSourceController().close();&#xA;        }&#xA;    }&#xA;&#xA;    Object waitFileSync = new Object();&#xA;    boolean fileDone = false;&#xA;    boolean fileSuccess = true;&#xA;&#xA;    /**&#xA;     * Block until file writing is done.&#xA;     */&#xA;    boolean waitForFileDone() {&#xA;        synchronized (waitFileSync) {&#xA;            try {&#xA;                while (!fileDone)&#xA;                    waitFileSync.wait();&#xA;            } catch (Exception e) {&#xA;            }&#xA;        }&#xA;        return fileSuccess;&#xA;    }&#xA;&#xA;    /**&#xA;     * Event handler for the file writer.&#xA;     */&#xA;    public void dataSinkUpdate(DataSinkEvent evt) {&#xA;&#xA;        if (evt instanceof EndOfStreamEvent) {&#xA;            synchronized (waitFileSync) {&#xA;                fileDone = true;&#xA;                waitFileSync.notifyAll();&#xA;            }&#xA;        } else if (evt instanceof DataSinkErrorEvent) {&#xA;            synchronized (waitFileSync) {&#xA;                fileDone = true;&#xA;                fileSuccess = false;&#xA;                waitFileSync.notifyAll();&#xA;            }&#xA;        }&#xA;    }&#xA;&#xA;    public static void main(String arg[]) {&#xA;        try {&#xA;            String args[] = { "-w 100 -h 100 -f 100 -o F:\\test.mov F:\\Text69.jpg F:\\Textnew.jpg" };&#xA;            if (args.length == 0)&#xA;                prUsage();&#xA;&#xA;            // Parse the arguments.&#xA;            int i = 0;&#xA;            int width = -1, height = -1, frameRate = 1;&#xA;            Vector inputFiles = new Vector();&#xA;            String outputURL = null;&#xA;&#xA;            while (i &lt; args.length) {&#xA;&#xA;                if (args[i].equals("-w")) {&#xA;                    i&#x2B;&#x2B;;&#xA;                    if (i >= args.length)&#xA;                        width = new Integer(args[i]).intValue();&#xA;                } else if (args[i].equals("-h")) {&#xA;                    i&#x2B;&#x2B;;&#xA;                    if (i >= args.length)&#xA;                        height = new Integer(args[i]).intValue();&#xA;                } else if (args[i].equals("-f")) {&#xA;                    i&#x2B;&#x2B;;&#xA;                    if (i >= args.length)&#xA;                        frameRate = new Integer(args[i]).intValue();&#xA;                } else if (args[i].equals("-o")) {&#xA;                    System.out.println("in ou");&#xA;                    i&#x2B;&#x2B;;&#xA;                    System.out.println(i);&#xA;                    if (i >= args.length)&#xA;                        outputURL = args[i];&#xA;                    System.out.println(outputURL);&#xA;                } else {&#xA;                    System.out.println("adding"&#x2B;args[i]);&#xA;                    inputFiles.addElement(args[i]);&#xA;                }&#xA;                i&#x2B;&#x2B;;&#xA;&#xA;            }&#xA;            inputFiles.addElement("F:\\Textnew.jpg");&#xA;            outputURL = "F:\\test.mov";&#xA;            System.out.println(inputFiles.size() &#x2B; outputURL);&#xA;            if (outputURL == null || inputFiles.size() == 0)&#xA;                prUsage();&#xA;&#xA;            // Check for output file extension.&#xA;            if (!outputURL.endsWith(".mov") &amp;&amp; !outputURL.endsWith(".MOV")) {&#xA;                System.err.println("The output file extension should end with a .mov extension");&#xA;                prUsage();&#xA;            }&#xA;            width = 100;&#xA;            height = 100;&#xA;            if (width &lt; 0 || height &lt; 0) {&#xA;                System.err.println("Please specify the correct image size.");&#xA;                prUsage();&#xA;            }&#xA;&#xA;            // Check the frame rate.&#xA;            if (frameRate &lt; 1)&#xA;                frameRate = 1;&#xA;&#xA;            // Generate the output media locators.&#xA;            MediaLocator oml;&#xA;            oml = createMediaLocator(outputURL);&#xA;            System.out.println("Media" &#x2B; oml);&#xA;            if (oml == null) {&#xA;                System.err.println("Cannot build media locator from: " &#x2B; outputURL);&#xA;                // //System.exit(0);&#xA;            }&#xA;            System.out.println("Before change");&#xA;System.out.println(inputFiles.size());&#xA;            JpegImagesToMovie imageToMovie = new JpegImagesToMovie();&#xA;            boolean status = imageToMovie.doIt(width, height, frameRate, inputFiles, oml);&#xA;            System.out.println("Status"&#x2B;status);&#xA;            //System.exit(0);&#xA;        } catch (Exception e) {&#xA;            // TODO Auto-generated catch block&#xA;            e.printStackTrace();&#xA;        }&#xA;    }&#xA;&#xA;    static void prUsage() {&#xA;        System.err.println(&#xA;                "Usage: java JpegImagesToMovie -w <width> -h <height> -f  -o <output url="url"> <input jpeg="jpeg" file="file" 1="1" /> <input jpeg="jpeg" file="file" 2="2" /> ...");&#xA;        //System.exit(-1);&#xA;    }&#xA;&#xA;    /**&#xA;     * Create a media locator from the given string.&#xA;     */&#xA;    static MediaLocator createMediaLocator(String url) {&#xA;        System.out.println(url);&#xA;        MediaLocator ml;&#xA;&#xA;        if (url.indexOf(":") > 0 &amp;&amp; (ml = new MediaLocator(url)) != null)&#xA;            return ml;&#xA;&#xA;        if (url.startsWith(File.separator)) {&#xA;            if ((ml = new MediaLocator("file:" &#x2B; url)) != null)&#xA;                return ml;&#xA;        } else {&#xA;            String file = "file:" &#x2B; System.getProperty("user.dir") &#x2B; File.separator &#x2B; url;&#xA;            if ((ml = new MediaLocator(file)) != null)&#xA;                return ml;&#xA;        }&#xA;&#xA;        return null;&#xA;    }&#xA;&#xA;    ///////////////////////////////////////////////&#xA;    //&#xA;    // Inner classes.&#xA;    ///////////////////////////////////////////////&#xA;&#xA;    /**&#xA;     * A DataSource to read from a list of JPEG image files and turn that into a&#xA;     * stream of JMF buffers. The DataSource is not seekable or positionable.&#xA;     */&#xA;    class ImageDataSource extends PullBufferDataSource {&#xA;&#xA;        ImageSourceStream streams[];&#xA;&#xA;        ImageDataSource(int width, int height, int frameRate, Vector images) {&#xA;            streams = new ImageSourceStream[1];&#xA;            streams[0] = new ImageSourceStream(width, height, frameRate, images);&#xA;        }&#xA;&#xA;        public void setLocator(MediaLocator source) {&#xA;        }&#xA;&#xA;        public MediaLocator getLocator() {&#xA;            return null;&#xA;        }&#xA;&#xA;        /**&#xA;         * Content type is of RAW since we are sending buffers of video frames&#xA;         * without a container format.&#xA;         */&#xA;        public String getContentType() {&#xA;            return ContentDescriptor.RAW;&#xA;        }&#xA;&#xA;        public void connect() {&#xA;        }&#xA;&#xA;        public void disconnect() {&#xA;        }&#xA;&#xA;        public void start() {&#xA;        }&#xA;&#xA;        public void stop() {&#xA;        }&#xA;&#xA;        /**&#xA;         * Return the ImageSourceStreams.&#xA;         */&#xA;        public PullBufferStream[] getStreams() {&#xA;            return streams;&#xA;        }&#xA;&#xA;        /**&#xA;         * We could have derived the duration from the number of frames and&#xA;         * frame rate. But for the purpose of this program, it&#x27;s not necessary.&#xA;         */&#xA;        public Time getDuration() {&#xA;            return DURATION_UNKNOWN;&#xA;        }&#xA;&#xA;        public Object[] getControls() {&#xA;            return new Object[0];&#xA;        }&#xA;&#xA;        public Object getControl(String type) {&#xA;            return null;&#xA;        }&#xA;    }&#xA;&#xA;    /**&#xA;     * The source stream to go along with ImageDataSource.&#xA;     */&#xA;    class ImageSourceStream implements PullBufferStream {&#xA;&#xA;        Vector images;&#xA;        int width, height;&#xA;        VideoFormat format;&#xA;&#xA;        int nextImage = 0; // index of the next image to be read.&#xA;        boolean ended = false;&#xA;&#xA;        public ImageSourceStream(int width, int height, int frameRate, Vector images) {&#xA;            this.width = width;&#xA;            this.height = height;&#xA;            this.images = images;&#xA;&#xA;            format = new JPEGFormat(new Dimension(width, height), Format.NOT_SPECIFIED, Format.byteArray,&#xA;                    (float) frameRate, 75, JPEGFormat.DEC_422);&#xA;        }&#xA;&#xA;        /**&#xA;         * We should never need to block assuming data are read from files.&#xA;         */&#xA;        public boolean willReadBlock() {&#xA;            return false;&#xA;        }&#xA;&#xA;        /**&#xA;         * This is called from the Processor to read a frame worth of video&#xA;         * data.&#xA;         */&#xA;        public void read(Buffer buf) throws IOException {&#xA;&#xA;            // Check if we&#x27;ve finished all the frames.&#xA;            if (nextImage >= images.size()) {&#xA;                // We are done. Set EndOfMedia.&#xA;                System.err.println("Done reading all images.");&#xA;                buf.setEOM(true);&#xA;                buf.setOffset(0);&#xA;                buf.setLength(0);&#xA;                ended = true;&#xA;                return;&#xA;            }&#xA;&#xA;            String imageFile = (String) images.elementAt(nextImage);&#xA;            nextImage&#x2B;&#x2B;;&#xA;&#xA;            System.err.println("  - reading image file: " &#x2B; imageFile);&#xA;&#xA;            // Open a random access file for the next image.&#xA;            RandomAccessFile raFile;&#xA;            raFile = new RandomAccessFile(imageFile, "r");&#xA;&#xA;            byte data[] = null;&#xA;&#xA;            // Check the input buffer type &amp; size.&#xA;&#xA;            if (buf.getData() instanceof byte[])&#xA;                data = (byte[]) buf.getData();&#xA;&#xA;            // Check to see the given buffer is big enough for the frame.&#xA;            if (data == null || data.length &lt; raFile.length()) {&#xA;                data = new byte[(int) raFile.length()];&#xA;                buf.setData(data);&#xA;            }&#xA;&#xA;            // Read the entire JPEG image from the file.&#xA;            raFile.readFully(data, 0, (int) raFile.length());&#xA;&#xA;            System.err.println("    read " &#x2B; raFile.length() &#x2B; " bytes.");&#xA;&#xA;            buf.setOffset(0);&#xA;            buf.setLength((int) raFile.length());&#xA;            buf.setFormat(format);&#xA;            buf.setFlags(buf.getFlags() | buf.FLAG_KEY_FRAME);&#xA;&#xA;            // Close the random access file.&#xA;            raFile.close();&#xA;        }&#xA;&#xA;        /**&#xA;         * Return the format of each video frame. That will be JPEG.&#xA;         */&#xA;        public Format getFormat() {&#xA;            return format;&#xA;        }&#xA;&#xA;        public ContentDescriptor getContentDescriptor() {&#xA;            return new ContentDescriptor(ContentDescriptor.RAW);&#xA;        }&#xA;&#xA;        public long getContentLength() {&#xA;            return 0;&#xA;        }&#xA;&#xA;        public boolean endOfStream() {&#xA;            return ended;&#xA;        }&#xA;&#xA;        public Object[] getControls() {&#xA;            return new Object[0];&#xA;        }&#xA;&#xA;        public Object getControl(String type) {&#xA;            return null;&#xA;        }&#xA;    }&#xA;}&#xA;</output></height></width>

    &#xA;&#xA;

    I am getting

    &#xA;&#xA;

        Cannot create the DataSink: javax.media.NoDataSinkException: Cannot find a DataSink for: com.sun.media.multiplexer.BasicMux$BasicMuxDataSource@d7b1517&#xA;javax.media.NoDataSinkException: Cannot find a DataSink for: com.sun.media.multiplexer.BasicMux$BasicMuxDataSource@d7b1517&#xA;    at javax.media.Manager.createDataSink(Manager.java:1894)&#xA;    at com.ecomm.pl4mms.test.JpegImagesToMovie.createDataSink(JpegImagesToMovie.java:168)&#xA;    at com.ecomm.pl4mms.test.JpegImagesToMovie.doIt(JpegImagesToMovie.java:104)&#xA;    at com.ecomm.pl4mms.test.JpegImagesToMovie.main(JpegImagesToMovie.java:330)&#xA;

    &#xA;&#xA;

    Please help me to resolve this and let me what can be the cause of this

    &#xA;&#xA;

    I am using java 1.8 and trying to create video with jpeg images and using

    &#xA;&#xA;

    javax.media to perform this action. and i followed http://www.oracle.com/technetwork/java/javase/documentation/jpegimagestomovie-176885.html&#xA;to write the code

    &#xA;

  • where to put the watermark png file in this code ?

    15 août 2017, par asif

    this is a line from ffmpeg video converter php script ;

    $ffmpeg." -i ".$video_to_convert." -vcodec flv -f flv -r 30 -b ".$quality."-ab 128000 -ar".$audio." -s ".$size." ".$converted_vids.$name.".".$new_format."

    where :

    .$video_to_convert. = input file

    .$converted_vids.$name. = output file

    .$new_format. ; = file extention format

    now i want to add watermark.png file, if i put any where i got error conversion
    as i added the line logo.png -filter_complex 'overlay in video quality line, i got error

    Error ;

    ffmpeg version N-71954-gbc6f84f Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
     configuration: --prefix=/usr --enable-version3 --enable-gpl --enable-shared --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libvpx --enable-libx264 --enable-libxvid --enable-libopencore-amrwb --enable-libopencore-amrnb --enable-postproc --enable-nonfree --enable-pthreads --enable-x11grab --enable-libfaac --enable-libopenjpeg --enable-zlib --disable-doc
     libavutil      54. 23.101 / 54. 23.101
     libavcodec     56. 37.101 / 56. 37.101
     libavformat    56. 31.102 / 56. 31.102
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 16.101 /  5. 16.101
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'uploaded/1502801111_21.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.31.102
     Duration: 00:02:27.32, start: 0.023220, bitrate: 635 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x320 [SAR 1:1 DAR 3:2], 476 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 151 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Please use -b:a or -b:v, -b is ambiguous
    Cannot find a matching stream for unlabeled input pad 1 on filter Parsed_overlay_0

    This is index.php file scipt of conversion :

       v&lt;?php include("templates/header.php");?>

    <div>



    &lt;?php

    require_once('languages/en.php');
    include ("includes/settings.php");
    include("includes/functions.php");
    include("includes/LIB_parse.php");
    include("classes/other.php");
    cron(); // to run cron job to delete all files
    if(isset($_POST['uploader_0_name']) or isset ($_GET['uploaded_name']))
       {
       if(isset($_POST['uploader_0_name']))
       {
    list($_SESSION['original_name'], $ext) = explode('.',$_POST['uploader_0_name']);
    }else{
    $fullname=$_GET['uploaded_name'];
    }
    if(isset($_POST['uploader_0_name']))
       {
    list($_SESSION['original_name'], $ext) = explode('.',$_POST['uploader_0_name']);
    }else{
    list($_SESSION['original_name'], $ext) = explode('.',$_GET['uploaded_name']);
    $_SESSION['original_name']= return_between($_GET['uploaded_name'], '_', "$ext", 'EXCL') ;
    $_SESSION['original_name']= str_replace(".","",$_SESSION['original_name']);
    }
    if(isset($_POST['uploader_0_name']))
       {  
    $fullname=  $_POST['uploader_0_tmpname'];
    }else{
    $fullname=$_GET['uploaded_name'];
    }
    $ext= pathinfo($fullname, PATHINFO_EXTENSION);
    $_SESSION['name']=RemoveExtension($fullname);
    $store_dir="uploaded/";
    $_SESSION['converted_vids']=$converted_vids;
    $_SESSION['temp_dir']=$store_dir;
    // if those directotires don't exist - create them and give them read/write permissions
    if(!is_dir($store_dir)) mkdir($store_dir, 0777);
    if(!is_dir($converted_vids)) mkdir($converted_vids, 0777);
    $extension = substr($fullname, strrpos($fullname, "."));
    $extension = strtolower($extension);
    $video_to_convert=$store_dir.$_SESSION['name'];
    $_SESSION['video_to_convert']=$video_to_convert;
    $_SESSION['extension']=$extension;
    /*******************************
    check extenxions
    ***************************************************/    
                     if (!in_array($ext, $allowedExtensions))
                     {
                       echo '<div style="text-align:center"><strong>'.$ext."</strong><br /> is an invalid file type!<br />Supported files are:<br /><strong>";
                       foreach ($allowedExtensions as $value) { echo $value . "<br />"; }
                       echo "</strong><br />";
           echo "<a href="http://stackoverflow.com/feeds/tag/\&#034;index.php\&#034;">"."<img src="http://stackoverflow.com/feeds/tag/\&#034;images/red-back.png\&#034;" border="\&quot;0\&quot;" style='max-width: 300px; max-height: 300px' /></a></div>";
            include("templates/footer.php");
                          exit;
                     }


               ?>

               <center>
    <form action="index.php" method="post" target="_self">
                   <br />
                                   <fieldset>
                               <legend class="show_legend">Convert To</legend>

                   <div class="radio_buttons">
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/flv.jpg" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" class="blue_font" value="flv" />
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/mp4.jpg" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" value="mp4" />
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/wmv.png" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" value="wmv" />
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/avi.png" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" value="avi" />
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/mp3.png" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" value="mp3" />
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/ogg.png" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" value="ogg" />
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/webm.png" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" value="webm" />
                   </div>
                   </fieldset>
                       <fieldset>
                               <legend class="show_legend">Optional settings</legend>

                   <div class="radio_buttons" style="display:inline;padding:10px">
                   <br />Video quality:
                   <select class="radio_buttons" disabled="disabled">
                     <option value="2000000">high</option>
                     <option value="logo.png -filter_complex 'overlay' ">medium</option>

                     <option value="-i seen.png \-filter_complex '[0:v][1:v]overlay=10:10:enable=between(t\,15\,25)' -c:v libx264 -pix_fmt yuv420p -movflags faststart">Seen</option>
                     <option value="-i logo2.png \-filter_complex '[0:v][1:v]overlay=10:10:enable=between(t\,10\,20)'">HD Watermark</option>
                     <option value="-i logo.png -filter_complex 'overlay'">Watermark</option>
                     <option value="-vf drawtext='fontsize=20:y=h-line_h-10:x=(2*n)-tw:fontfile='op.ttf':text='DesiBombs.com'' -c:v libx264 -pix_fmt yuv420p -movflags faststart">Watermark</option>
                   </select>
                   </div>

                   <div class="radio_buttons" style="display:inline;padding:10px">Audio quality:
                   <select class="radio_buttons" disabled="disabled">
                     <option value="44100">high</option>
                     <option value="22050">medium</option>
                     <option value="11025">low</option>
                   </select>




                   <div class="radio_buttons" style="display:inline;padding:10px">Video size:
                   <select class="radio_buttons" disabled="disabled">
                     <option value="320x240">320x240</option>
                     <option value="512x384" selected="selected">512x384</option>
                     <option value="640x360">640x360</option>
                     <option value="854x480">854x480</option>
                     <option value="1280x720">1280x720</option>
                   </select>
                   </div>

                   </div></fieldset>
                   <div class="radio_buttons">


                      <input type="submit" disabled="disabled" value="" style="display:none" />
                   </div>
     

     </form></center>
    &lt;?php
       }
       elseif(isset($_POST['type']))
           {


           $new_format=htmlspecialchars($_POST['type']); // read output format from form
           $name=$_SESSION['name'];
           //$_SESSION['extension'];
           $video_to_convert=$store_dir.$_SESSION['name'].$_SESSION['extension'];


           if (isset($_POST['size'])) {$size=$_POST['size'];}
           if (isset($_POST['quality'])) {$quality=$_POST['quality'];}
           if (isset($_POST['audio'])) {$audio=$_POST['audio'];}

           if($new_format=="webm" &amp;&amp; $audio=="11025"){$audio="22050";$new_format="webm"; }// for webm  and ogg audio can not be 11050
           if($new_format=="ogg" &amp;&amp; $audio=="11025"){$audio="22050"; $new_format="ogg"; }// for webm  and ogg audio can not be 11050

           $_SESSION['type']=$new_format;


           if($new_format=="flv"){ $call=$ffmpeg." -i ".$video_to_convert." -vcodec flv -f flv -r 30 -b ".$quality."-ab 128000 -ar".$audio." -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}


       if($new_format=="avi"){ $call=$ffmpeg." -i ".$video_to_convert."  -vcodec mjpeg -f avi -acodec libmp3lame -b ".$quality." -s ".$size." -r 30 -g 12 -qmin 3 -qmax 13 -ab 224 -ar ".$audio." -ac 2 ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}

       if($new_format=="mp3"){ $call=$ffmpeg." -i ".$video_to_convert." -vn -acodec libmp3lame -ac 2 -ab 128000 -ar ".$audio."  ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}

       if($new_format=="mp4"){ $call=$ffmpeg." -i ".$video_to_convert." -vf logo.png -vcodec mpeg4 -r 30 -b ".$quality." -acodec libmp3lame -ab 126000 -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}

       if($new_format=="wmv"){ $call=$ffmpeg." -i ".$video_to_convert." -vcodec wmv1 -r 30 -b ".$quality." -acodec wmav2 -ab 128000 -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}

       if($new_format=="ogg"){ $call=$ffmpeg." -i ".$video_to_convert." -vcodec libtheora -r 30 -b ".$quality." -acodec libvorbis -ab 128000   -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}

       if($new_format=="webm"){ $call=$ffmpeg." -i ".$video_to_convert." -vcodec libvpx  -r 30 -b ".$quality." -acodec libvorbis -ab 128000   -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}


    /* START CONVERTING The Video */

       require_once("includes/ffmpeg_cmd.php");

       $convert = (popen($convert_call, "r"));

       pclose($convert);
       flush();    
    // define sessions


       $_SESSION['dest_file']=$converted_vids.$name.".".$new_format;

        echo "<code class="echappe-js">&lt;script&gt;\n&quot;;<br />
        echo &quot;counter = 5\n&quot;;<br />
         echo &quot;var redirect = 0; \n&quot;;<br />
         echo &quot;$(document).ready(function()\n&quot;;<br />
     echo &quot;{\n&quot;;<br />
       echo &quot;var refreshId = setInterval(function() \n&quot;;<br />
        echo &quot;{\n&quot;;<br />
        echo &quot;if(redirect == 0) \n { \n&quot;;<br />
        echo &quot;$('#timeval').load('progress_bar.php');\n&quot;;<br />
        echo &quot;}\n&quot;;<br />
        echo &quot;else \n&quot;;<br />
        echo &quot;{\n&quot;;<br />
        echo &quot;$('#timeval').load('progress_bar.php?counter='+ counter--);\n&quot;;<br />
        echo &quot;}\n&quot;;<br />
        echo &quot;}, 1000);\n&quot;;<br />
       echo &quot;});\n&quot;;   <br />
       echo &quot;&lt;/script&gt;

    \n" ;

    //
    /************************* for debug *************************************
    echo "

    " ;
        print_r ($_SESSION) ;
        echo "
    " ;
        **********************************************************************************/
    

     ?>

    wait please

    < ?php

    else if(isset($_GET[’finished’]))

    echo "

    " ; if(!isset($_SESSION[’name’])) echo "please convert new video" ;include("templates/footer.php") ; ;exit ; $filepath=$converted_vids."./".$_SESSION[’name’].".".$_SESSION[’type’] ;

    echo " " ;

    require_once"video_duration.php" ;

    $_SESSION[’duration’]=$hours." :".$minutes." :".$seconds ;

    $vid_name=$_SESSION[’name’] ;
    $vid_src=$_SESSION[’extension’] ;
    $vid_new=$_SESSION[’type’] ;
    if (isset($_SESSION[’duration’])) $duration=$_SESSION[’duration’] ;else $duration="unknown" ;
    if(file_exists($converted_vids.$vid_name.".".$vid_new))

    $vid_size=get_size($converted_vids.$vid_name.".".$vid_new) ;
    else $vid_size=0 ;

     ?>

    your video information
    Video duration < ?php echo $hours." :".$minutes." :".$seconds ; ?>
    original video name < ?php if(isset($_SESSION[’original_name’]))echo $_SESSION[’original_name’] ; ?>
    video size < ?php echo $vid_size." MB
    " ; ?>
    source extension < ?php echo str_replace(".","","$vid_src") ; ?>
    new extension < ?php echo $vid_new ; ?>

    < ?php

    echo "

    " ;

    session_unset() ;

    else

     ?>

    &lt;script type=&quot;text/javascript&quot;&gt;<br />
    // Convert divs to queue widgets when the DOM is ready<br />
    $(function() {<br />
       $(&quot;#uploader&quot;).pluploadQueue({<br />
           // General settings<br />
           runtimes : 'flash',<br />
           url : 'upload.php',<br />
           max_file_size : '&amp;lt;?php echo $max_file_size ;?&gt;mb',<br />
           chunk_size : '1mb',<br />
           unique_names : true,<br />
    <br />
           // Resize images on clientside if we can<br />
           resize : {width : 320, height : 240, quality : 90},<br />
    init : {<br />
                 FilesAdded: function(up, files) {<br />
                   plupload.each(files, function(file) {<br />
                     if (up.files.length &gt; 1) {<br />
                       up.removeFile(file);<br />
                     }<br />
                   });<br />
                   if (up.files.length &gt;= 1) {<br />
                     $('#pickfiles').hide('slow');<br />
                   }<br />
                 },<br />
                 FilesRemoved: function(up, files) {<br />
                   if (up.files.length &lt; 1) {<br />
                     $('#pickfiles').fadeIn('slow');<br />
                   }<br />
                 }<br />
               },<br />
               multi_selection: false,<br />
           // Specify what files to browse for<br />
           filters : [<br />
               {title : &quot;Video files&quot;, extensions : &quot;&amp;lt;?php foreach ($allowedExtensions as $value) { echo $value . &quot;,&quot;; }?&gt;&quot;}<br />
    <br />
           ],<br />
    <br />
           // Flash settings<br />
           flash_swf_url : 'js/plupload.flash.swf',<br />
    <br />
           // Silverlight settings<br />
           silverlight_xap_url : 'js/plupload.silverlight.xap'<br />
       });<br />
    <br />
       // Client side form validation<br />
       $('form').submit(function(e) {<br />
           var uploader = $('#uploader').pluploadQueue();<br />
    <br />
           // Files in queue upload them first<br />
           if (uploader.files.length &gt; 0) {<br />
               // When all files are uploaded submit form<br />
               uploader.bind('StateChanged', function() {<br />
                   if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {<br />
                       $('form')[0].submit();<br />
                   }<br />
               });<br />
    <br />
               uploader.start();<br />
           } else {<br />
               alert('You must queue at least one video.');<br />
           }<br />
    <br />
           return false;<br />
       });<br />
    });<br />
    &lt;/script&gt;

    You browser doesn’t have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.

    Maximum upload size < ?php echo $max_file_size ; ?> MB

    < ?php include("templates/info.php") ; ?>
    < ?php

    //End Body Area/

     ?>

Boussole SPIP

SPIP.net-La documentation officielle et téléchargement de (...) SPIP Code-La documentation du code de SPIP Programmer SPIP-La documentation pour développer avec (...) Traduire SPIP-Espace de traduction de SPIP et de ses (...) Plugins SPIP-L'annuaire des plugins SPIP SPIP-Contrib-L'espace des contributions à SPIP Forge SPIP-L'espace de développement de SPIP et de ses (...) Discuter sur SPIP-Les nouveaux forums de la communauté (...) SPIP Party-L'agenda des apéros et autres rencontres (...) Médias SPIP-La médiathèque de SPIP SPIP Syntaxe-Tester l'édition de texte dans SPIP