Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (68)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (12478)

  • Permission denied when trying to call ffmpeg on heroku

    1er décembre 2013, par chuck w

    I have a rails 3.1 web app on Heroku (cedar) that that allows users to post stories with photo and video attachments using the paperclip gem (3.5.1). Uploads are stored on s3. This has been working 100% for many months.

    I have recently added video transcoding and thumbnailing to my dev machine with the paperclip-ffmpeg gem (1.0.1) and ffmpeg running locally. This is also working.

    I've followed these instructions to build and install ffmpeg on heroku, and I've altered my Heroku app's path so that it reads as follows :

    PATH:   bin:vendor/ffmpeg/bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin

    and my app's LD_LIBRARY_PATH so that it reads as follows :

    LD_LIBRARY_PATH:             vendor/ffmpeg/lib:/usr/local/lib

    Finally, I've vendored ffmpeg into my app with the following structure :

    vendoring ffmpeg

    When I commit and push these changes to Heroku and POST a story that has a video I get the following output on Heroku logs :

    2013-11-30T22:51:46.711010+00:00 app[web.1]: Started POST "/stories" for 71.80.218.93 at        
    2013-11-30 22:51:46 +0000
    2013-11-30T22:51:47.023119+00:00 app[web.1]: Cocaine::ExitStatusError (Command 'ffprobe
    "/tmp/sideways video20131130-2-14w1q4j.mp4" 2>&1' returned 126. Expected 0
    2013-11-30T22:51:47.023119+00:00 app[web.1]: Here is the command output:
    2013-11-30T22:51:47.023119+00:00 app[web.1]:
    2013-11-30T22:51:47.023119+00:00 app[web.1]:   app/controllers/stories_controller.rb:11:in    
    `create'
    2013-11-30T22:51:47.023119+00:00 app[web.1]:
    2013-11-30T22:51:47.023119+00:00 app[web.1]:
    2013-11-30T22:51:47.019228+00:00 heroku[router]: at=info method=POST path=/stories    
    host=myapp.herokuapp.com fwd="71.80.218.93" dyno=web.1 connect=1ms    
    service=3130ms status=500 bytes=754
    2013-11-30T22:51:47.023119+00:00 app[web.1]:
    2013-11-30T22:51:47.023600+00:00 app[web.1]: cache: [POST /stories] invalidate, pass
    2013-11-30T22:51:47.023119+00:00 app[web.1]: sh: ffprobe: Permission denied
    2013-11-30T22:51:47.023119+00:00 app[web.1]: ):

    Also, running the console command : heroku run "ffmpeg -version" -a myapp
    returns :

    Running ffmpeg -version attached to terminal... up, run.6591
    bash: vendor/ffmpeg/bin/ffmpeg: Permission denied

    Here is my Post model paperclip set-up :

    class Post < ActiveRecord::Base

     attr_accessible :contents, :photo, :video

     belongs_to    :story, :touch => true
     belongs_to    :user, :touch => true

     has_attached_file :photo,
                       :styles => {
                         :thumb => ["100x140>", :jpg],
                         :medium => ["400x400>", :jpg],
                         :large => ["800x800>", :jpg]
                       },
                       :processors => [:thumbnail],
                       :storage => :s3,
                       :s3_credentials => "#{Rails.root.to_s}/config/s3.yml",
                       :path => "/:style/:id/:filename"

     has_attached_file :video,
                       :storage => :s3,
                       :s3_credentials => "#{Rails.root.to_s}/config/s3.yml",
                       :path => "/video/:id/:filename",
                       :styles => {
                         :thumb => { :geometry => "140x100#", :format => 'jpg', :time => 10 },
                         :medium => { :geometry => "480x360", :format => 'mp4' },
                       }, :processors => [:ffmpeg]

    Why am I getting these "permission denieds" ? Any help would be greatly appreciated !!!

  • Using ffmpeg to create video from images - Python [duplicate]

    24 mars 2017, par Harel

    This question already has an answer here :

    I’m using FFMPEG in python (using this tutorial) and my main goal is to take a screenshot and append it into an existing mp4 video(append it using the encoder, not raw appending).

    That’s the code I’m using right now, this script only writes a video of one frame(the first screenshot) and doesn’t do anything with all the other screenshots.

    command = [ FFMPEG_BIN,
       '-f', 'rawvideo',
       '-codec', 'rawvideo',
       '-s', '1920x1080', # size of one frame
       '-pix_fmt', 'rgb24',
       '-r', '24', # frames per second
       '-i', '-', # The input comes from a pipe
       '-an', # Tells FFMPEG not to expect any audio
       '-vcodec', 'mpeg4',
       'my_output_videofile.mp4' ]

    for x in range(30):
       pipe = sp.Popen(command, stdin = sp.PIPE, stderr = sp.PIPE)
       im = np.array(ImageGrab.grab()).tostring()
       pipe.communicate(input = im)
       pipe.stdin.close()
       if pipe.stderr is not None:
           pipe.stderr.close()
       pipe.wait()

    Edit :
    Apparently using Popen.communicate breaks the pipe (Thanks to Peter Wood !).

    After fixing the pipe breaking scenario I have encountered another problem, after writing 235 frames to the video the program crashes.

    The new edited script :

    command = [ FFMPEG_BIN,
       '-y',
       '-f', 'rawvideo',
       '-codec', 'rawvideo',
       '-s', '1920x1080', # size of one frame
       '-pix_fmt', 'rgb24',
       '-r', '24', # frames per second
       '-i', '-', # The input comes from a pipe
       '-an', # Tells FFMPEG not to expect any audio
       '-vcodec', 'mpeg4',
       'my_output_videofile.mp4' ]

    pipe = sp.Popen(command, stdin = sp.PIPE, stderr = sp.PIPE)

    for x in range(300):
       print x

       im = np.array(ImageGrab.grab()).tostring()
       pipe.stdin.write(im)
       pipe.stdin.flush()
  • OpenCv is giving error to play the downloaded video

    17 août 2015, par Prat_yow

    Program a code for a tiny system, which should run on Linux :
    - A routine (P) accepts strings from an unknown remote Internet source,
    which contain just an URL and a file name.
    - The URL and the file name point to a multimedia file, in our case a video
    - (P) separates the file name from the string
    - (P) checks if the file already exists on the system’s internal memory card, as
    (P) is running on a tiny Linux machine connected to a screen
    - If it does not exist, (P) downloads the video file from the given URL and
    stores it in the memory card
    - Finally, (P) opens the file and plays it as a full screen video (no external video
    player allowed !)
    - After this (P) starts from the beginning
    - There is no user action involved and nobody enters data by hand or mouse
    clicks

    I have written code in python. But when I run it it just not load the cv module. Can someone suggest if my approach is correct.? Will doing in java or other compiled language will be easy.?

    My code is :

    import os
    import urllib
    import cv
    import sys

    """
    The following program will take the url as input. Separate the file name of the video from the url
    and check if the file is present in the current memory location or not. If the same file is present
    it will indicate its presence. If the file is not present it will download the file and play it.

    urrlib: to download the video file.
    cv: For playing the video.

    """

    #NOTE Configuration of FFMPEG and OpenCV  is required.
    #NOTE Assuming that the given code is execute from the internal memory location.
    #NOTE Assuming the URL is of the form <initial part="part" of="of" the="the" url="url"></initial><filename>.<format>

    sys.path.append('/opt/ros/hydro/lib/python2.7/dist-packages')

    def myVideo(url):
       search_folder = "."
       videoFile = url.split('/')[-1].split('#')[0].split('?')[0] #stripping the name of the file.

       for root, dirs, files in os.walk(search_folder): # using the os.walk module to find the files.
           for name in files:
               #print os.path.join(name)

               """Checking the videofile in the current directory and the sub-directories"""

               if videoFile == os.path.join(name):  #checking if the file is already present in the internal memory.
                   print "The file is already present in the internal memory"
                   return -1  # Returning the confirmation that the file is present.

               else:
                   print "Downloading the file"
                   video = urllib.FancyURLopener() #downloading the file using urllib.
                   video.retrieve(url,videoFile)

                   curDir = os.getcwd()   # getting the current working directory.
                   fullVideoPath = os.path.join(curDir,videoFile)  # Making the full path of the video file.

                   """For playing the file using openCV first read the file.
                   Find the number of frames and the frame rate.
                   Finally use these parameters to display each extracted frame on the screen"""

                   vFile = cv.CaptureFromFile(fullVideoPath)
                   nFrames = int(  cv.GetCaptureProperty( vidFile, cv.CV_CAP_PROP_FRAME_COUNT ) ) #Number of frames in the video.
                   fps = cv.GetCaptureProperty( vidFile, cv.CV_CAP_PROP_FPS ) # Frame rate
                   waitPerFrameInMillisec = int( 1/fps * 1000/1 ) # Wait time between frames.

                   for f in xrange( nFrames ):
                       frameImg = cv.QueryFrame( vidFile )
                       cv.ShowImage( "My Show",  frameImg )
                       cv.WaitKey( waitPerFrameInMillisec  )

                   cv.DestroyWindow( "My Show" ) # Deleting the window once the playing is done.
                   return 1 # returning the confimation that the file was played successfully.

    if __name__ == "__main__":
       url = "http://techslides.com/demos/sample-videos/small.mp4"
       myVideo(url)
    </format></filename>