Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (104)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

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

Sur d’autres sites (11224)

  • FFMpeg Command work in command line, but not in python script

    20 février 2015, par Fooldj

    Okay, kind of a weird problem. But I’m not sure whether it’s python, ffmpeg, or some stupid thing I’m doing wrong.

    I’m trying to take a video, and take 1 frame a second, and output that frame to an image. Right now, if i use the command line with ffmpeg :

    ffmpeg -i test.avi -r 1 -f image2 image-%3d.jpeg -pix_fmt rgb24 -vcodec rawrvideo

    It outputs about 10 images, the images look fine, awesome. Now I have this code (right now some code from some github, as I wanted stuff that i was relatively sure would work, and mine is allll convoluted)

    import subprocess as sp
    import numpy as np
    import re
    import cv2
    import time

    FFMPEG_BIN = r'ffmpeg.exe'
    INPUT_VID = 'test.avi'

    def getInfo():
       command = [FFMPEG_BIN,'-i', INPUT_VID, '-']
       pipe = sp.Popen(command, stdout=sp.PIPE, stderr=sp.PIPE)
       pipe.stdout.readline()
       pipe.terminate()
       infos = pipe.stderr.read()
       infos_list = infos.split('\r\n')
       res = re.search(' \d+x\d+ ',infos)
       res = [int(x) for x in res.group(0).split('x')]
       return res
    res = getInfo()
    command = [ FFMPEG_BIN,
           '-i', INPUT_VID,
           '-f', 'image2pipe',
           '-pix_fmt', 'rgb24',
           '-vcodec', 'rawvideo', '-']
    pipe = sp.Popen(command, stdout = sp.PIPE, bufsize=10**8)
    n = 0
    im2 = []
    try:
       mog = cv2.BackgroundSubtractorMOG2(120,2,True)
       while True:
           raw_image = pipe.stdout.read(res[0]*res[1]*3)
           # transform the byte read into a numpy array
           image =  np.fromstring(raw_image, dtype='uint8')
           image = image.reshape((res[1],res[0],3))
           rgbImg = image.copy()

           fname = ('_tmp%03d.png'%time.time())
           cv2.imwrite(fname, rgbImg)
           # throw away the data in the pipe's buffer.
           #pipe.stdout.flush()
           n += 1
           print n
    except:
       print 'done',n
       pipe.kill()
       cv2.destroyAllWindows()

    When I run this, I get 10 images, but they all have a Blue Tint ! I cannot for the life of me figure out why. I’ve done tons of searches, I’ve tried quite a few different codecs (usually just messes things up worse). The media info for the video file is here :

    General
    Complete name                            : test.avi
    Format                                   : AVI
    Format/Info                              : Audio Video Interleave
    File size                                : 85.0 KiB
    Duration                                 : 133ms
    Overall bit rate                         : 5 235 Kbps

    Video
    ID                                       : 0
    Format                                   : JPEG
    Codec ID                                 : MJPG
    Duration                                 : 133ms
    Bit rate                                 : 1 240 Kbps
    Width                                    : 640 pixels
    Height                                   : 480 pixels
    Display aspect ratio                     : 4:3
    Frame rate                               : 30.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:2
    Bit depth                                : 8 bits
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 0.135
    Stream size                              : 20.1 KiB (24%)

    Any suggestions ? It seems like it should be an RGB mixup...just not sure where at...

  • How to Kill ffmpeg process in node.js

    8 février 2017, par Sanjay

    I am using node.js code that convert Axis Ipcamera live stream into mp4 using FFMPEG

    var childProcess=require('child_process');
    var childArguments = [];
    var child=[];
    var cmd='ffmpeg -i rtsp://172.24.22.117:554/axis-media/media.amp -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -preset slower -crf 18 -vf "scale=trunc(in_w/2)*2:trunc(in_h/2)*2"'+' '+__dirname+'/uploads/ouput.mp4';

     child=childProcess.exec(      
           cmd,
           childArguments,
           {            
               env: process.env,
               silent:true
           },  function (err, stdout, stderr) {
               if (err) {
                   throw err;
               }
               console.log(stdout);

           });    

           //    here generate events for listen child process (works properly)
       // Listen for incoming(stdout) data
       child.stdout.on('data', function (data) {
           console.log("Got data from child: " + data);
       });

       // Listen for any errors:
       child.stderr.on('data', function (data) {
           console.log('There was an error: ' + data);
       });

       // Listen for exit event
       child.on('exit', function(code) {
           console.log('Child process exited with exit code ' + code);
           child.stdout.pause();
           child.kill();
       });

    my above code works perfectly. It gives the output as I want, but I am not able to kill(stop) the ffmpeg command. I am using the code below for stopping the process, but in background it still continues.

    child.kill("SIGTERM");

    I also used following commands : child.kill(’SIGUSR1’) ; child.kill("SIGHUP") ; child.kill("SIGINT") ;child.kill(’SIGUSR2’) ; for killing this process but it not works.

    Currently I forcefully kill the node application to stop ffmpeg command and generate mp4 file. I do not want this.
    But I want commands that stop ffmpeg process and generate mp4 file, without killing the node application.

  • Error : Package : perl-Git-1.8.2.1-1.el5.x86_64 (epel) Requires : perl(:MODULE_COMPAT_5.8.8)

    23 décembre 2014, par P C SAS3

    error in loading github lib tool

    i have tried to load the following dependencies to load ffmpeg from source when i try to run the following command i am getting errors as below

    yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: mirrors.viethosting.vn
    * epel: ftp.cuhk.edu.hk
    * extras: mirrors.viethosting.vn
    * updates: mirrors.vinahost.vn
    base                                                     | 3.7 kB     00:00    
    epel                                                     | 3.7 kB     00:00    
    epel/primary_db                                          | 3.7 MB     00:18    
    extras                                                   | 3.4 kB     00:00    
    updates                                                  | 3.4 kB     00:00    
    updates/primary_db                                       | 1.5 MB     00:16    
    vz-base                                                  |  951 B     00:00    
    vz-updates                                               |  951 B     00:00    
    Setting up Install Process
    Package autoconf-2.63-5.1.el6.noarch already installed and latest version
    Package automake-1.11.1-4.el6.noarch already installed and latest version
    Package gcc-4.4.7-11.el6.x86_64 already installed and latest version
    Package gcc-c++-4.4.7-11.el6.x86_64 already installed and latest version
    Package 1:make-3.81-20.el6.x86_64 already installed and latest version
    Package 1:pkgconfig-0.23-9.1.el6.x86_64 already installed and latest version
    Package zlib-devel-1.2.3-29.el6.x86_64 already installed and latest version
    Resolving Dependencies
    --> Running transaction check
    ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed
    --> Processing Dependency: perl-Git = 1.8.2.1-1.el5 for package: git-1.8.2.1-1.el5.x86_64
    --> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.2.1-1.el5.x86_64
    --> Processing Dependency: perl(Git) for package: git-1.8.2.1-1.el5.x86_64
    --> Processing Dependency: perl(Error) for package: git-1.8.2.1-1.el5.x86_64
    --> Processing Dependency: libssl.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64
    --> Processing Dependency: libexpat.so.0()(64bit) for package: git-1.8.2.1-1.el5.x86_64
    --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64
    --> Processing Dependency: libcrypto.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64
    ---> Package libtool.x86_64 0:2.2.6-15.5.el6 will be installed
    ---> Package nasm.x86_64 0:2.07-7.el6 will be installed
    --> Running transaction check
    ---> Package compat-expat1.x86_64 0:1.95.8-8.el6 will be installed
    ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed
    --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64
    ---> Package openssl098e.x86_64 0:0.9.8e-18.el6_5.2 will be installed
    ---> Package perl-Error.noarch 1:0.17015-4.el6 will be installed
    ---> Package perl-Git.x86_64 0:1.8.2.1-1.el5 will be installed
    --> Processing Dependency: perl(:MODULE_COMPAT_5.8.8) for package: perl-Git-1.8.2.1-1.el5.x86_64
    ---> Package perl-TermReadKey.x86_64 0:2.30-13.el6 will be installed
    --> Finished Dependency Resolution
    Error: Package: perl-Git-1.8.2.1-1.el5.x86_64 (epel)
              Requires: perl(:MODULE_COMPAT_5.8.8)
    Error: Package: git-1.8.2.1-1.el5.x86_64 (epel)
              Requires: libcurl.so.3()(64bit)
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest

    now i went into some solution on net which asked to check with disablerepo to rpmforge it also throw the following error

    # yum --disablerepo=rpmforge install git
    Loaded plugins: fastestmirror


    Error getting repository data for rpmforge, repository not found

    kindly help so that i can install all the dependencies so that i may not face any problem while configuring ffmpge