Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (111)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

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

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

Sur d’autres sites (4007)

  • Facebook LIVE with ffmpeg error - av_interleaved_write_frame() : Connection reset by peer

    22 décembre 2016, par above14

    I’m trying to stream to Facebook a Live Video from an Amazon EC2 instance (c4.xlarge). I installed ffmpeg and stream with a command like the following

    ffmpeg -re -f concat -i /home/ec2-user/playlist.txt -f lavfi -re -i anullsrc=channel_layout=stereo:sample_rate=44100 -s 854x480 -c:a aac -strict -2 -ar 44100 -vcodec libx264 -f flv "{rtmp_link}"

    Everything works fine. I had LIVE videos that worked for up to 2 days in a row. Sometimes, without a reason, I got one of these videos interrupted with this error message :

    av_interleaved_write_frame(): Connection reset by peer

    I haven’t been able to figure out a reason for this error yet. The funny thing is that maybe I have 3 streaming going on in the same machine at the same time, and just one of them get stopped by this message. Other times this error happens where there’s just one streaming on the EC2 instance.

    Any ideas about how to find a solution ?

    EDIT

    We have installed a newer version of FFMPEG and the error now is more detailed. We have this message

    RTMP send error 104

    I haven’t found a lot about this issue online. Does someone know what error 104 means ?

  • AWS Lambda subprocess OSError : [Errno 2] No such file or directory

    11 septembre 2016, par Lev

    I’m trying to create a lambda function that makes collection of thumbnails from a video on amazon s3 using ffmpeg. ffmpeg binary is included into fuction package.

    function code :

    # -*- coding: utf-8 -*-

    import stat
    import shutil
    import boto3
    import logging
    import subprocess as sp
    import os
    import threading

    thumbnail_prefix = 'thumb_'
    thumbnail_ext = '.jpg'
    time_delta = 1
    video_frames_path = 'media/videos/frames'

    print('Loading function')
    logger = logging.getLogger()
    logger.setLevel(logging.INFO)

    lambda_tmp_dir = '/tmp'  # Lambda fuction can use this directory.

    # ffmpeg is stored with this script.
    # When executing ffmpeg, execute permission is requierd.
    # But Lambda source directory do not have permission to change it.
    # So move ffmpeg binary to `/tmp` and add permission.
    ffmpeg_bin = "{0}/ffmpeg.linux64".format(lambda_tmp_dir)
    shutil.copyfile('/var/task/ffmpeg.linux64', ffmpeg_bin)

    os.chmod(ffmpeg_bin, 777)

    # tried also:
    # os.chmod(ffmpeg_bin, os.stat(ffmpeg_bin).st_mode | stat.S_IEXEC)

    s3 = boto3.client('s3')


    def get_thumb_filename(num):
       return '{prefix}{num:03d}{ext}'.format(prefix=thumbnail_prefix, num=num, ext=thumbnail_ext)


    def create_thumbnails(video_url):
       i = 1
       filenames_list = []
       filename = None
       while i == 1 or os.path.isfile(os.path.join(os.getcwd(), get_thumb_filename(i-1))):
           if filename:
               filenames_list.append(filename)
           time = time_delta * (i - 1)
           filename = get_thumb_filename(i)
           print(ffmpeg_bin)
           if os.path.isfile(ffmpeg_bin):
               print('ok')
           sp.call(['sudo',
                    ffmpeg_bin,
                    '-ss',
                    str(time),
                    '-i',
                    video_url,
                    '-frames:v',
                    '1',
                    get_thumb_filename(i)])
           i += 1
       print(filenames_list)
       return filenames_list


    def s3_upload_file(file_path, key, bucket, acl, content_type):
       file = open(file_path, 'r')
       s3.put_object(
           Bucket=bucket,
           ACL=acl,
           Body=file,
           Key=key,
           ContentType=content_type
       )
       logger.info("file {0} moved to {1}/{2}".format(file_path, bucket, key))


    def s3_upload_files_in_threads(filenames_list, dir_path, bucket, s3path, acl, content_type):
       for filename in filenames_list:
           if os.path.isfile(os.path.join(dir_path, filename)):
               print(os.path.join(dir_path, filename))
           t = threading.Thread(target=s3_upload_file,
                                args=(os.path.join(dir_path, filename),
                                      '{0}/{1}'.format(s3path, filename),
                                      bucket,
                                      acl,
                                      content_type)).start()


    def lambda_handler(event, context):
       bucket = event['Records'][0]['s3']['bucket']['name']
       video_key = event['Records'][0]['s3']['object']['key']
       video_name = video_key.split('/')[-1].split('.')[0]
       video_url = 'http://{0}/{1}'.format(bucket, video_key)
       filenames_list = create_thumbnails(video_url)
       s3_upload_files_in_threads(filenames_list,
                                  os.getcwd(),
                                  bucket,
                                  '{0}/{1}'.format(video_frames_path, video_name),
                                  'public-read',
                                  'image/jpeg')
       return

    during the execution I get following logs :

    Loading function

    /tmp/ffmpeg.linux64

    ok

    [Errno 2] No such file or directory: OSError
    Traceback (most recent call last):
    File "/var/task/lambda_function.py", line 112, in lambda_handler
    filenames_list = create_thumbnails(video_url)
    File "/var/task/lambda_function.py", line 77, in create_thumbnails
    get_thumb_filename(i)])
    File "/usr/lib64/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
    File "/usr/lib64/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
    File "/usr/lib64/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
    OSError: [Errno 2] No such file or directory

    When I use the same sp.call() with the same ffmpeg binary on my ec2 instance it works fine.

  • java.lang.NoClassDefFoundError : Could not initialize class on Linux (Works fine on Windows)

    26 décembre 2016, par Jake Miller

    I’m using a C++ FFmpeg wrapper for Java (org.bytedeco.javacpp). This works perfectly on a Windows machine (my development machine) but throws this error when ran on Linux (Amazon Web Services Elastic Beanstalk) :

    java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.javacpp.avutil
       at java.lang.Class.forName0(Native Method) ~[na:1.8.0_111]
       at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_111]
       at org.bytedeco.javacpp.Loader.load(Loader.java:472) ~[javacpp-1.2.1.jar!/:1.2.1]
       at org.bytedeco.javacpp.Loader.load(Loader.java:417) ~[javacpp-1.2.1.jar!/:1.2.1]
       at org.bytedeco.javacpp.avformat$AVFormatContext.<clinit>(avformat.java:2819) ~[ffmpeg-3.2.1-1.3.jar!/:1.2.1]
       at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:391) ~[javacv-1.3.jar!/:1.3]
       at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:385) ~[javacv-1.3.jar!/:1.3]
    </clinit>

    I’ve been troubleshooting for the past 2 days and have tried the following to fix the issue :

    • upgrade to Linux to 2.4
    • downgrading javacpp to 1.2.1
    • running mvn clean
    • running mvn -U
    • deleting contents of /.m2/ and redownloading dependencies
    • various combinations of dependency versions
    • git clone on a Linux VM & running mvn install there

    When looking further into the issue, I stumbled upon documentation for avformat$AVFormatContext as it’s in the stack trace posted above (6th line). The documentation for a C++ class named AVFormatContext. Whenever I attempt to view the class in Eclipse, it says Source Not Found.

    My question : could this problem possibly be caused by the C++ libraries on my Linux VM ? None of the above solutions fixed it so this is my only hypothesis as of now.

    Here’s my other Stack Overflow question regarding this subject : Java.lang.NoClassDefFoundError caused by FFmpeg when deployed on Linux as a packaged .war (Works on development machine)