Recherche avancée

Médias (3)

Mot : - Tags -/collection

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)

  • WebRTC books – a brief review

    30 décembre 2013, par silvia

    I just finished reading Rob Manson’s awesome book “Getting Started with WebRTC” and I can highly recommend it for any Web developer who is interested in WebRTC.

    Rob explains very clearly how to create your first video, audio or data peer-connection using WebRTC in current Google Chrome or Firefox (I think it also now applies to Opera, though that wasn’t the case when his book was published). He makes available example code, so you can replicate it in your own Web application easily, including the setup of a signalling server. He also points out that you need a ICE (STUN/TURN) server to punch through firewalls and gives recommendations for what software is available, but stops short of explaining how to set them up.

    Rob’s focus is very much on the features required in a typical Web application :

    • video calls
    • audio calls
    • text chats
    • file sharing

    In fact, he provides the most in-depth demo of how to set up a good file sharing interface I have come across.

    Rob then also extends his introduction to WebRTC to two key application areas : education and team communication. His recommendations are spot on and required reading for anyone developing applications in these spaces.

    Before Rob’s book, I have also read Alan Johnson and Dan Burnett’s “WebRTC” book on APIs and RTCWEB protocols of the HTML5 Real-Time Web.

    Alan and Dan’s book was written more than a year ago and explains that state of standardisation at that time. It’s probably a little out-dated now, but it still gives you good foundations on why some decisions were made the way they are and what are contentious issues (some of which still remain). If you really want to understand what happens behind the scenes when you call certain functions in the WebRTC APIs of browsers, then this is for you.

    Alan and Dan’s book explains in more details than Rob’s book how IP addresses of communication partners are found, how firewall holepunching works, how sessions get negotiated, and how the standards process works. It’s probably less useful to a Web developer who just wants to implement video call functionality into their Web application, though if something goes wrong you may find yourself digging into the details of SDP, SRTP, DTLS, and other cryptic abbreviations of protocols that all need to work together to get a WebRTC call working.

    Overall, both books are worthwhile and cover different aspects of WebRTC that you will stumble across if you are directly dealing with WebRTC code.

  • "Invalid or unexpected token" error when trying to execute ffmpeg build on lambda

    4 janvier 2019, par almarc

    I have a node.js script that uses ffmpeg to convert mp4 downloaded from YT to mp3 and save to Amazon S3. Uploading using the serverless framework. The "ffmpeg" file is included in the main directory (with .yml), downloaded from here :
    https://johnvansickle.com/ffmpeg/

    The code :

    'use strict'
    process.env.PATH = process.env.PATH + ':/tmp/'
    process.env['FFMPEG_PATH'] = '/tmp/ffmpeg';
    const BIN_PATH = process.env['LAMBDA_TASK_ROOT']
    process.env['PATH'] = process.env['PATH'] + ':' + BIN_PATH;

    module.exports.download_mp3 = function (event, context, callback)
    {
     require('child_process').exec('cp /var/task/ffmpeg /tmp/.; chmod 755
     /tmp/ffmpeg;', function (error, stdout, stderr) {
     if (error)
     {
       console.log('An error occured', error);
       callback(null, null)
     }
     else
     {
       var ffmpeg = require('ffmpeg');
       const aws = require('aws-sdk')
       const s3 = new aws.S3()
       const ytdl = require('ytdl-core');

       function uploadFromStream(s3) {
         const stream = require('stream')
         var pass = new stream.PassThrough();

         var params = {Bucket: "some-bucket", Key: "some-key", Body: pass};
         s3.upload(params, function(err, data) {
           console.log(err, data);
         });
         console.log("Should be finished")
         callback(null)
       }

       let stream = ytdl("some-video-id", {
         quality: 'highestaudio',
         filter: 'audioonly'
       });

       ffmpeg(stream)
         .audioBitrate(128)
         .format('mp3')
         .on('error', (err) => console.error(err))
         .pipe(uploadFromStream(s3), {
           end: true
       });
     }})
    }

    When triggered, the function writes an error in logs :

    2019-01-04T14:50:54.525Z    21da4d49-1030-11e9-b901-0dc32b691a16    
    /var/task/ffmpeg:1
    (function (exports, require, module, __filename, __dirname) { ELF
    ^

    SyntaxError: Invalid or unexpected token
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at /var/task/download.js:17:18

    It’s, most definetely, an error in the "ffmpeg" file I’ve mentioned above (link provided). But I don’t know what’s the exact issue, I followed the first answer here : https://stackoverflow.com/questions/47882810/lambda-not-connecting-to-ffmpeg to include the ffmpeg build.

  • FFmpeg transcoding on Lambda results in unusable (static) audio

    17 mai 2020, par jmkmay

    I'd like to move towards serverless for audio transcoding routines in AWS. I've been trying to setup a Lambda function to do just that ; execute a static FFmpeg binary and re-upload the resulting audio file. The static binary I'm using is here.

    



    The Lambda function I'm using in Python looks like this :

    



    import boto3

s3client = boto3.client('s3')
s3resource = boto3.client('s3')

import json
import subprocess 

from io import BytesIO

import os

os.system("cp -ra ./bin/ffmpeg /tmp/")
os.system("chmod -R 775 /tmp")

def lambda_handler(event, context):

    bucketname = event["Records"][0]["s3"]["bucket"]["name"]
    filename = event["Records"][0]["s3"]["object"]["key"]

    audioData = grabFromS3(bucketname, filename)

    with open('/tmp/' + filename, 'wb') as f:
        f.write(audioData.read())

    os.chdir('/tmp/')

    try:
        process = subprocess.check_output(['./ffmpeg -i /tmp/joe_and_bill.wav /tmp/joe_and_bill.aac'], shell=True, stderr=subprocess.STDOUT)
        pushToS3(bucketname, filename)
        return process.decode('utf-8')
    except subprocess.CalledProcessError as e:
        return e.output.decode('utf-8'), os.listdir()


def grabFromS3(bucket, file):

    obj = s3client.get_object(Bucket=bucket, Key=file)
    data = BytesIO(obj['Body'].read())

    return(data)

def pushToS3(bucket, file):

    s3client.upload_file('/tmp/' + file[:-4] + '.aac', bucket, file[:-4] + '.aac')

    return


    



    You can listen to the output of this here. WARNING : Turn your volume down or your ears will bleed.

    



    The original file can be heard here.

    



    Does anyone have any idea what might be causing the encoding errors ? It doesn't seem to be an issue with the file upload, since the md5 on the Lambda fs matches the MD5 of the uploaded file.

    



    I've also tried building the static binary on an Amazon Linux instance in EC2, then zipping and porting it into the Lambda project, but the same issue persists.

    



    I'm stumped ! :(