Recherche avancée

Médias (91)

Autres articles (41)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

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

Sur d’autres sites (7528)

  • Imageio python converts GIF to MP4 incorrectly

    1er juin 2018, par Apurva Koti

    I am writing a function to speed up/down a given GIF (or .gifv) file, and save the resulting animation as an .mp4 file.

    I’m using the python imageio package (and its ffmpeg plugin) to do this - download the raw binary data from the gif, write each frame to an mp4, and set the fps of the mp4 to whatever.

    My code is -

    def changespeed(vid, mult):
       vid = vid.replace('.gifv', '.gif')
       data = urllib2.urlopen(vid).read()
       reader = imageio.get_reader(data, 'gif')
       dur = (float(reader.get_meta_data()['duration']))
       oldfps = 1000.0 / (10 if dur == 0 else dur)


       writer = imageio.get_writer('output.mp4', fps=(oldfps*mult), quality=8.0)

       for frame in reader:
           writer.append_data(frame)
       writer.close()

    The problem is, at times the output colors will be heavily corrupted, and there doesn’t seem to be any predictability. This happens with some gifs and doesn’t happen with others. I have tried setting a high quality parameter in the writer but this doesn’t help.

    Here is an example of a problematic GIF -

    Input : https://i.imgur.com/xFezNYK.gif

    Output : https://giant.gfycat.com/MelodicShimmeringBarb.mp4

    I can see this issue locally in output.mp4, so the issue isn’t with uploading to Gfycat.

    Is there anything I can do to avoid this behavior ? Thanks.

  • Cannot stream properly on YouTube using ffmpeg with Python

    1er mars 2018, par Francesco

    I have a few problems related to sending ffmpeg stream to YouTube.
    1. If I comment out "time.sleep(sleep_time)" the stream goes 3x fast(basing on what ?) ;
    2. If I uncomment the ’-r’ args the stream lags ;
    3. If I don’t add the background music the stream doesn’t start on YouTube, the problem persists if I uncomment the ’-an’ args.
    4. When the background music ends the stream stops working on YouTube.

    frame = cv2.imread('STATIC_IMAGE.jpg')
    fps = 25
    sleepTime = 1 / fps

    height, width, channels = frame.shape

    command = [
       'ffmpeg',

       #OpenCV image.
       #'-re',
       #'-threads', '0',
       '-f', 'rawvideo', #image2pipe
       '-vcodec','rawvideo',
       '-s', str(width) + 'x' + str(height),
       '-pixel_format', 'bgr24',
       #'-r', str(fps),
       #'-an',
       '-i', '-',

       #Background music
       #'-stream_loop', '-1',
       #'-re',
       #'-r', str(fps),
       '-i', 'music.mp3',

       #Output (actual stream)
       #'-r', str(fps),
       #'-crf', '25',
       #'-g', '39',
       #'-g', '2',
       #'-ac', '2',
       #'-c:a', 'aac',
       #'-b:a', '128k',
       #'-ar', '44100',
       #'-an',
       #'-b:v', '300k',
       #'-c:v', 'libx264',
       #'-bufsize', '600k',
       #'-maxrate', '300k',
       #'-qmin', '32',
       #'-qmax', '64',
       #'-vcodec', 'libx264',
       #'-pixel_format', 'yuv420p',
       '-vcodec', 'h264',
       '-pixel_format', 'h264',
       '-f', 'flv',
       'rtmp://a.rtmp.youtube.com/live2/STREAM_KEY'
    ]

    import subprocess as sp
    proc = sp.Popen(command, stdin=sp.PIPE, shell=False)

    while True:
       proc.stdin.write(frame.tostring())

       time.sleep(sleepTime)

    Any idea of why these problems happen ?
    May the "while True" be the problem ?

  • FFmpeg GPU build runs slower in Java Runtime

    22 mars 2018, par Raju

    I am writing a Java utility within which I am executing GPU based FFmpeg command (mentioned below). I am using Java Runtime.getRuntime().exec() to achieve this. But the command in Java runtime runs much (4-5 times) slower than executing the same in Linux terminal.

    I couldn’t find the bottleneck in what I am trying to achieve. What is the best way to run an FFmpeg command in Java code ? Any suggestion, guidelines here will be very helpful.

    GPU based FFmpeg command :

    /opt/FFmpeg_GPU/ffmpeg -y -hwaccel cuvid -c:v h264_cuvid -hwaccel_output_format nv12 -vsync 0 -copyts -i sample.mov -map 0 -acodec copy -dn -sn  -vf hwdownload,format=nv12,drawtext=fontfile=/opt/fonts/arial.ttf:text=sample-watermark:fontcolor=white:fontsize=25:box=1:boxcolor=black@0.2:boxborderw=5:x=(w-text_w)/2:y=(h-text_h)/2,format=nv12,hwupload -vcodec h264_nvenc -vprofile main -b:v 1000k -minrate 1000k -maxrate 1000k -bufsize 2000k -sc_threshold 0 -g 50 -keyint_min 50 -cbr 1 -bf 0 -force_key_frames 0 sample.mp4

    Java Code snippet :

    String ffmpegCmd = "/opt/FFmpeg_GPU/ffmpeg -y -hwaccel cuvid -c:v h264_cuvid -hwaccel_output_format nv12 -vsync 0 -copyts -i sample.mov -map 0 -acodec copy -dn -sn  -vf hwdownload,format=nv12,drawtext=fontfile=/opt/fonts/arial.ttf:text=sample-watermark:fontcolor=white:fontsize=25:box=1:boxcolor=black@0.2:boxborderw=5:x=(w-text_w)/2:y=(h-text_h)/2,format=nv12,hwupload -vcodec h264_nvenc -vprofile main -b:v 1000k -minrate 1000k -maxrate 1000k -bufsize 2000k -sc_threshold 0 -g 50 -keyint_min 50 -cbr 1 -bf 0 -force_key_frames 0 sample.mp4"

    Process process = Runtime.getRuntime().exec(ffmpegCmd);
    process.waitFor();