Recherche avancée

Médias (1)

Mot : - Tags -/pirate bay

Autres articles (52)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (8265)

  • I am using ffmpeg java library to convert captured screenshots to video. Video output is blurry

    2 octobre 2020, par dark prince

    I am using ffmpeg java library to convert captured screenshots to video. Video which is generated as output is blurry.

    


    I am using bit rate as 9000, frames per sec as 25 and video size as that of desktop screen size.

    


    Any suggestions on how to solve this issue.

    


    P.S. I cannot use ffmpeg.exe and command line due to certain restrictions and hence I am opting for ffmpeg java library.

    


    Any suggestions on the issue or suggestions on any better approach will be helpful.

    


        import java.awt.AWTException;&#xA;    import java.awt.Dimension;&#xA;    import java.awt.FlowLayout;&#xA;    import java.awt.Rectangle;&#xA;    import java.awt.Robot;&#xA;    import java.awt.Toolkit;&#xA;    import java.awt.event.ActionEvent;&#xA;    import java.awt.event.ActionListener;&#xA;    import java.awt.image.BufferedImage;&#xA;    import java.io.File;&#xA;    import java.io.IOException;&#xA;    import java.util.Date;&#xA;    &#xA;    import javax.imageio.ImageIO;&#xA;    import javax.swing.JButton;&#xA;    import javax.swing.JFrame;&#xA;    import javax.swing.JLabel;&#xA;    import javax.swing.JOptionPane;&#xA;    &#xA;    import org.bytedeco.javacpp.avcodec;&#xA;    import org.bytedeco.javacv.FFmpegFrameRecorder;&#xA;    import org.bytedeco.javacv.OpenCVFrameConverter;&#xA;    &#xA;    public class ScreenRecorder{&#xA;    &#xA;        public static boolean videoComplete=false;&#xA;        public static String inputImageDir="inputImgFolder"&#x2B;File.separator;&#xA;        public static String inputImgExt="png";&#xA;        public static String outputVideo="recording.mp4"; &#xA;        public static int counter=0;&#xA;        public static int imgProcessed=0;&#xA;        public static FFmpegFrameRecorder recorder=null;&#xA;        public static int videoWidth=1920;&#xA;        public static int videoHeight=1080;&#xA;        public static int videoFrameRate=3;&#xA;        public static int videoQuality=0; // 0 is the max quality&#xA;        public static int videoBitRate=9000;&#xA;        public static String videoFormat="mp4";&#xA;        public static int videoCodec=avcodec.AV_CODEC_ID_MPEG4;&#xA;        public static Thread t1=null;&#xA;        public static Thread t2=null;&#xA;        public static JFrame frame=null;&#xA;        public static boolean isRegionSelected=false;&#xA;        public static int c1=0;&#xA;        public static int c2=0;&#xA;        public static int c3=0;&#xA;        public static int c4=0;&#xA;        &#xA;        &#xA;        public static void main(String[] args) {&#xA;            &#xA;            try {&#xA;                if(getRecorder()==null)&#xA;                {&#xA;                    System.out.println("Cannot make recorder object, Exiting program");&#xA;                    System.exit(0);&#xA;                }&#xA;                if(getRobot()==null)&#xA;                {&#xA;                    System.out.println("Cannot make robot object, Exiting program");&#xA;                    System.exit(0);&#xA;                }&#xA;                File scanFolder=new File(inputImageDir);&#xA;                scanFolder.delete();&#xA;                scanFolder.mkdirs();&#xA;                &#xA;                createGUI();&#xA;            } catch (Exception e) {&#xA;                System.out.println("Exception in program "&#x2B;e.getMessage());&#xA;            }&#xA;        }&#xA;        &#xA;        public static void createGUI()&#xA;        {&#xA;            frame=new JFrame("Screen Recorder");&#xA;            JButton b1=new JButton("Select Region for Recording");&#xA;            JButton b2=new JButton("Start Recording");&#xA;            JButton b3=new JButton("Stop Recording");&#xA;            JLabel l1=new JLabel("<br />If you dont select a region then full screen recording <br /> will be made when you click on Start Recording");&#xA;            l1.setFont (l1.getFont ().deriveFont (20.0f));&#xA;            b1.addActionListener(new ActionListener() {&#xA;                @Override&#xA;                public void actionPerformed(ActionEvent e) {&#xA;                    try {&#xA;                        JOptionPane.showMessageDialog(frame, "A new window will open. Use your mouse to select the region you like to record");&#xA;                        new CropRegion().getImage();&#xA;                    } catch (Exception e1) {&#xA;                        // TODO Auto-generated catch block&#xA;                        System.out.println("Issue while trying to call the module to crop region");&#xA;                        e1.printStackTrace();&#xA;                    } &#xA;                }&#xA;            });&#xA;            b2.addActionListener(new ActionListener() {&#xA;                @Override&#xA;                public void actionPerformed(ActionEvent e) {&#xA;                    counter=0;&#xA;                    startRecording();&#xA;                }&#xA;            });&#xA;            b3.addActionListener(new ActionListener() {&#xA;                @Override&#xA;                public void actionPerformed(ActionEvent e) {&#xA;                    stopRecording();&#xA;                    System.out.print("Exiting...");&#xA;                    System.exit(0);&#xA;                }&#xA;            });&#xA;            &#xA;            frame.add(b1);&#xA;            frame.add(b2);&#xA;            frame.add(b3);&#xA;            frame.add(l1);&#xA;            frame.setLayout(new FlowLayout(0));&#xA;            frame.setVisible(true);&#xA;            frame.setSize(1000, 170);&#xA;            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);&#xA;        }&#xA;        &#xA;        public static void startRecording()&#xA;        {&#xA;            t1=new Thread()&#xA;            {&#xA;                public void run() {&#xA;                    try {&#xA;                        takeScreenshot(getRobot());&#xA;                    } catch (Exception e) {&#xA;                        JOptionPane.showMessageDialog(frame, "Cannot make robot object, Exiting program "&#x2B;e.getMessage());&#xA;                        System.out.println("Cannot make robot object, Exiting program "&#x2B;e.getMessage());&#xA;                        System.exit(0);&#xA;                    }&#xA;                }&#xA;            };&#xA;            &#xA;            t2=new Thread()&#xA;            {&#xA;                public void run() {&#xA;                    prepareVideo();&#xA;                }&#xA;            };&#xA;            &#xA;            t1.start();&#xA;            t2.start();&#xA;            System.out.println("Started recording at "&#x2B;new Date());&#xA;        }&#xA;        &#xA;        public static Robot getRobot() throws Exception&#xA;        {&#xA;            Robot r=null;&#xA;            try {&#xA;                r = new Robot();&#xA;                return r;&#xA;            } catch (AWTException e) {&#xA;                JOptionPane.showMessageDialog(frame, "Issue while initiating Robot object "&#x2B;e.getMessage());&#xA;                System.out.println("Issue while initiating Robot object "&#x2B;e.getMessage());&#xA;                throw new Exception("Issue while initiating Robot object");&#xA;            }&#xA;        }&#xA;        &#xA;        public static void takeScreenshot(Robot r)&#xA;        {&#xA;            Dimension size = Toolkit.getDefaultToolkit().getScreenSize();&#xA;            Rectangle rec=new Rectangle(size);&#xA;            if(isRegionSelected)&#xA;            {&#xA;                rec=new Rectangle(c1, c2, c3-c1, c4-c2);&#xA;            }&#xA;            while(!videoComplete)&#xA;            {&#xA;            counter&#x2B;&#x2B;;&#xA;            BufferedImage img = r.createScreenCapture(rec);&#xA;            try {&#xA;                ImageIO.write(img, inputImgExt, new File(inputImageDir&#x2B;counter&#x2B;"."&#x2B;inputImgExt));&#xA;            } catch (IOException e) {&#xA;                JOptionPane.showMessageDialog(frame, "Got an issue while writing the screenshot to disk "&#x2B;e.getMessage());&#xA;                System.out.println("Got an issue while writing the screenshot to disk "&#x2B;e.getMessage());&#xA;                counter--;&#xA;            }&#xA;            }&#xA;        }&#xA;        &#xA;        public static void prepareVideo()&#xA;        {&#xA;            File scanFolder=new File(inputImageDir);&#xA;            while(!videoComplete)&#xA;            {&#xA;                File[] inputFiles=scanFolder.listFiles();&#xA;                try {&#xA;                    getRobot().delay(500);&#xA;                } catch (Exception e) {&#xA;                }&#xA;                //for(int i=0;i/imgProcessed&#x2B;&#x2B;;&#xA;                    addImageToVideo(inputFiles[i].getAbsolutePath());&#xA;                    //String imgToAdd=scanFolder.getAbsolutePath()&#x2B;File.separator&#x2B;imgProcessed&#x2B;"."&#x2B;inputImgExt;&#xA;                    //addImageToVideo(imgToAdd);&#xA;                    //new File(imgToAdd).delete();&#xA;                    inputFiles[i].delete();&#xA;                }&#xA;            }&#xA;            &#xA;            File[] inputFiles=scanFolder.listFiles();&#xA;            for(int i=0;i/ maximum quality&#xA;             recorder.start();&#xA;             }&#xA;             catch(Exception e)&#xA;             {&#xA;                 JOptionPane.showMessageDialog(frame, "Exception while starting the recorder object "&#x2B;e.getMessage());&#xA;                 System.out.println("Exception while starting the recorder object "&#x2B;e.getMessage());&#xA;                 throw new Exception("Unable to start recorder");&#xA;             }&#xA;             return recorder;&#xA;        }&#xA;        &#xA;        public static OpenCVFrameConverter.ToIplImage getFrameConverter()&#xA;        {&#xA;            OpenCVFrameConverter.ToIplImage grabberConverter = new OpenCVFrameConverter.ToIplImage();&#xA;            return grabberConverter;&#xA;        }&#xA;        &#xA;        public static void addImageToVideo(String imgPath)&#xA;        {&#xA;            try {&#xA;                getRecorder().record(getFrameConverter().convert(cvLoadImage(imgPath)));&#xA;            } catch (Exception e) {&#xA;                JOptionPane.showMessageDialog(frame, "Exception while adding image to video "&#x2B;e.getMessage());&#xA;                System.out.println("Exception while adding image to video "&#x2B;e.getMessage());&#xA;            }&#xA;        }&#xA;        &#xA;        public static void stopRecording()&#xA;        {&#xA;            try {&#xA;                videoComplete=true;&#xA;                System.out.println("Stopping recording at "&#x2B;new Date());&#xA;                t1.join();&#xA;                System.out.println("Screenshot thread complete");&#xA;                t2.join();&#xA;                System.out.println("Video maker thread complete");&#xA;                getRecorder().stop();&#xA;                System.out.println("Recording has been saved successfully at "&#x2B;new File(outputVideo).getAbsolutePath());&#xA;                JOptionPane.showMessageDialog(frame, "Recording has been saved successfully at "&#x2B;new File(outputVideo).getAbsolutePath());&#xA;            } catch (Exception e) {&#xA;                System.out.println("Exception while stopping the recorder "&#x2B;e.getMessage());&#xA;            }&#xA;        }&#xA;    }&#xA;

    &#xA;

    Imagepanel.java

    &#xA;

    import java.awt.Dimension;&#xA;import java.awt.Graphics;&#xA;import java.awt.Image;&#xA;import javax.swing.ImageIcon;&#xA;import javax.swing.JPanel;&#xA;&#xA;class ImagePanel&#xA;  extends JPanel&#xA;{&#xA;  private Image img;&#xA;  &#xA;  public ImagePanel(String img)&#xA;  {&#xA;    this(new ImageIcon(img).getImage());&#xA;  }&#xA;  &#xA;  public ImagePanel(Image img)&#xA;  {&#xA;    this.img = img;&#xA;    Dimension size = new Dimension(img.getWidth(null), img.getHeight(null));&#xA;    &#xA;    setPreferredSize(size);&#xA;    setMinimumSize(size);&#xA;    setMaximumSize(size);&#xA;    setSize(size);&#xA;    setLayout(null);&#xA;  }&#xA;  &#xA;  public void paintComponent(Graphics g)&#xA;  {&#xA;    g.drawImage(this.img, 0, 0, null);&#xA;  }&#xA;}&#xA;

    &#xA;

    CropRegion.java

    &#xA;

    import java.awt.AWTException;&#xA;import java.awt.Dimension;&#xA;import java.awt.FlowLayout;&#xA;import java.awt.Graphics;&#xA;import java.awt.Rectangle;&#xA;import java.awt.Robot;&#xA;import java.awt.Toolkit;&#xA;import java.awt.event.MouseEvent;&#xA;import java.awt.event.MouseListener;&#xA;import java.awt.event.MouseMotionListener;&#xA;import java.awt.image.BufferedImage;&#xA;import java.io.IOException;&#xA;import javax.swing.JFrame;&#xA;import javax.swing.JLabel;&#xA;import javax.swing.JOptionPane;&#xA;&#xA;&#xA;public class CropRegion implements MouseListener,&#xA;        MouseMotionListener {&#xA;&#xA;    int drag_status = 0;&#xA;    int c1;&#xA;    int c2;&#xA;    int c3;&#xA;    int c4;&#xA;    JFrame frame=null;&#xA;    static int counter=0;&#xA;    JLabel background=null;&#xA;&#xA;    &#xA;    public void getImage() throws AWTException, IOException, InterruptedException {&#xA;        Dimension size = Toolkit.getDefaultToolkit().getScreenSize();&#xA;        Robot robot = new Robot();&#xA;        BufferedImage img = robot.createScreenCapture(new Rectangle(size));&#xA;        ImagePanel panel = new ImagePanel(img);&#xA;        frame=new JFrame();&#xA;        frame.add(panel);&#xA;        frame.setLocation(0, 0);&#xA;        frame.setSize(size);&#xA;        frame.setLayout(new FlowLayout());&#xA;        frame.setUndecorated(true);&#xA;        frame.setVisible(true);&#xA;        frame.addMouseListener(this);&#xA;        frame.addMouseMotionListener(this);&#xA;        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);&#xA;    }&#xA;&#xA;    public void draggedScreen() throws Exception {&#xA;        ScreenRecorder.c1=c1;&#xA;        ScreenRecorder.c2=c2;&#xA;        ScreenRecorder.c3=c3;&#xA;        ScreenRecorder.c4=c4;&#xA;        ScreenRecorder.isRegionSelected=true;&#xA;        JOptionPane.showMessageDialog(frame, "Region Selected.Please click on Start Recording button to record the selected region.");&#xA;        frame.dispose();&#xA;    }&#xA;&#xA;    public void mouseClicked(MouseEvent arg0) {&#xA;    }&#xA;&#xA;    public void mouseEntered(MouseEvent arg0) {&#xA;    }&#xA;&#xA;    public void mouseExited(MouseEvent arg0) {&#xA;    }&#xA;&#xA;    public void mousePressed(MouseEvent arg0) {&#xA;        paint();&#xA;        this.c1 = arg0.getX();&#xA;        this.c2 = arg0.getY();&#xA;    }&#xA;&#xA;    public void mouseReleased(MouseEvent arg0) {&#xA;        paint();&#xA;        if (this.drag_status == 1) {&#xA;            this.c3 = arg0.getX();&#xA;            this.c4 = arg0.getY();&#xA;            try {&#xA;                draggedScreen();&#xA;            } catch (Exception e) {&#xA;                e.printStackTrace();&#xA;            }&#xA;        }&#xA;    }&#xA;&#xA;    public void mouseDragged(MouseEvent arg0) {&#xA;        paint();&#xA;        this.drag_status = 1;&#xA;        this.c3 = arg0.getX();&#xA;        this.c4 = arg0.getY();&#xA;    }&#xA;&#xA;    public void mouseMoved(MouseEvent arg0) {&#xA;    }&#xA;&#xA;    public void paint() {&#xA;        Graphics g = frame.getGraphics();&#xA;        frame.repaint();&#xA;        int w = this.c1 - this.c3;&#xA;        int h = this.c2 - this.c4;&#xA;        w *= -1;&#xA;        h *= -1;&#xA;        if (w &lt; 0) {&#xA;            w *= -1;&#xA;        }&#xA;        g.drawRect(this.c1, this.c2, w, h);&#xA;    }&#xA;}&#xA;

    &#xA;

  • Revision ccba289f8d : Fast computation path for forward transform and quantization This commit enable

    30 mai 2014, par Jingning Han

    Changed Paths :
     Modify /vp9/common/vp9_rtcd_defs.pl


     Modify /vp9/encoder/vp9_block.h


     Modify /vp9/encoder/vp9_context_tree.h


     Modify /vp9/encoder/vp9_dct.c


     Modify /vp9/encoder/vp9_encodeframe.c


     Modify /vp9/encoder/vp9_encodemb.c


     Modify /vp9/encoder/vp9_encodemb.h


     Modify /vp9/encoder/vp9_pickmode.c


     Modify /vp9/encoder/vp9_quantize.c


     Modify /vp9/encoder/vp9_quantize.h


     Modify /vp9/encoder/x86/vp9_dct_sse2.c



    Fast computation path for forward transform and quantization

    This commit enables a fast path computational flow for forward
    transformation. It checks the sse and variance of prediction
    residuals and decides if the quantized coefficients are all
    zero, dc only, or more. It then selects the corresponding coding
    path in the forward transformation and quantization stage.

    It is currently enabled in rtc coding mode. Will do it for rd
    coding mode next.

    In speed -6, the runtime for pedestrian_area 1080p at 1000 kbps
    goes down from 14234 ms to 13704 ms, i.e., about 4% speed-up.
    Overall coding performance for rtc set is changed by -0.18%.

    Change-Id : I0452da1786d59bc8bcbe0a35fdae9f623d1d44e1

  • FFSERVER - streaming an ASF video as Webm output

    30 mai 2014, par Emmanuel Brunet

    I’m trying to stream an IP webcam ASF live stream to a ffserver to output a webm video format. The server starts successfully but the ffserver commands used to feed the ffserver fails and generates a core dump.

    Input stream

    $ ffprobe http://account:password@webcam/videostream.asf

    Input #0, asf, from 'http://admin:alpha1237@webcam/videostream.asf':
     Duration: N/A, start: 0.000000, bitrate: 32 kb/s
       Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc), 640x480, 25 tbr, 1k tbn, 1k tbc
       Stream #0:1: Audio: adpcm_ima_wav ([17][0][0][0] / 0x0011), 8000 Hz, 1 channels, s16p, 32 kb/s

    ffserver configuration

    my ffserver configuration is :

    Port 8091
    RTSPPort 554
    BindAddress 192.168.1.62
    MaxHTTPConnections 1000
    MaxClients 100
    MaxBandwidth 1000
    CustomLog -

    <feed>
           File /tmp/webcam.ffm
           FileMaxSize 500M
           ACL allow localhost
           ACL allow 192.168.0.0 192.168.255.255

    </feed>

    <stream>              # Output stream URL definition
      Feed webcam.ffm              # Feed from which to receive video
      Format webm

      # Audio settings
      AudioCodec vorbis
      AudioBitRate 64             # Audio bitrate

      # Video settings
      VideoCodec libvpx
      VideoSize 640x480           # Video resolution
      VideoFrameRate 25           # Video FPS
      AVOptionVideo flags +global_header  # Parameters passed to encoder
                                          # (same as ffmpeg command-line parameters)
      AVOptionVideo cpu-used 0
      AVOptionVideo qmin 10
      AVOptionVideo qmax 42
      AVOptionVideo quality good
      AVOptionAudio flags +global_header
      PreRoll 15
      StartSendOnKey
      # VideoBitRate 32            # Video bitrate
    </stream>

    <stream>
           Format status
           # Only allow local people to get the status
           ACL allow localhost
           ACL allow 192.168.0.0 192.168.255.255
    </stream>

    ffmpeg feed

    I run the following command that fails

    $ ffmpeg  -i http://account:password@webcam/videostream.asf http://192.168.1.62:8091/webcam.ffm
    http://192.168.1.62:8091/webcam.ffm
    Input #0, asf, from 'http://account:password@webcam/videostream.asf':
     Duration: N/A, start: 0.000000, bitrate: 32 kb/s
       Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc), 640x480, 25 tbr, 1k tbn, 1k tbc
       Stream #0:1: Audio: adpcm_ima_wav ([17][0][0][0] / 0x0011), 8000 Hz, mono, s16p, 32 kb/s
    [swscaler @ 0x36a80c0] deprecated pixel format used, make sure you did set range correctly
    Segmentation fault

    I tryed

    $ ffmpeg  -i http://account:password@webcam/videostream.asf -pix_fmt yuv420p  http://192.168.1.62:8091/webcam.ffm

    But it raises the same error.

    Thanks for your help

    Edit

    For an easy testing (I thought), I tried to publish the whole ASF stream as is, meaning connecting the ASF webcam output stream to the ffserver that outputs ASF format too.
    And thus with mirrored encoding so I changed the ffserver configuration to

    ...
    <stream>
       Feed webcam.ffm
       Format asf
       VideoFrameRate 25
       VideoSize 640X480
       VideoBitRate 256
       VideoBufferSize 1000
       VideoGopSize 30
       AudioBitRate 32
       StartSendOnKey
    </stream>
    ...

    And the output is now :

    Input #0, asf, from 'http://admin:alpha1237@webcam/videostream.asf':
     Duration: N/A, start: 0.000000, bitrate: 32 kb/s
       Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc), 640x480, 1k tbr, 1k tbn, 1k tbc
       Stream #0:1: Audio: adpcm_ima_wav ([17][0][0][0] / 0x0011), 8000 Hz, mono, s16p, 32 kb/s
    [swscaler @ 0x3d620c0] deprecated pixel format used, make sure you did set range correctly
    Output #0, ffm, to 'http://192.168.1.62:8091/webcam.ffm':
     Metadata:
       creation_time   : now
       encoder         : Lavf55.40.100
       Stream #0:0: Audio: wmav2, 22050 Hz, mono, fltp, 32 kb/s
       Metadata:
         encoder         : Lavc55.64.100 wmav2
       Stream #0:1: Video: msmpeg4v3 (msmpeg4), yuv420p, 640x480, q=2-31, 256 kb/s, 1k fps, 1000k tbn, 1k tbc
       Metadata:
    Stream mapping:
     Stream #0:1 -> #0:0 (adpcm_ima_wav -> wmav2)
     Stream #0:0 -> #0:1 (mjpeg -> msmpeg4)
    Press [q] to stop, [?] for help
    Segmentation fault

    I can’t even forward the stream.