Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (24)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

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

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

  • Issues with Discord JS Music Bot

    5 décembre 2020, par Thresio

    I am in the process of creating a Discord bot with JS, giving it management, auto role, etc. I just got to the music section of it and I can't quite figure out whats wrong.

    



    I believe I have installed FFmpeg correctly, as I have access to it from within the terminal. I have also used npm to bring ytdl-core and opusscript into my program.

    



    What this should do is make the bot join the chat, then play the Youtube link. Currently, I am not error checking the second argument as I just wanted to get it working initially. I have implemented several different instances of .toString() and String() however it always gives the same error listed below.

    



    . The program still throws this error :

    



    TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object

C:\Users\Thresio's PC\Desktop\Discord Bot\node_modules\opusscript\build\opusscript_native_wasm.js:8
var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var
key;for(key in Module){if(Module.hasOwnProperty(key))
{moduleOverrides[key]=Module[key]}}Module["arguments"]=
[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow) {throw
toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var 
ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var 
ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof 
importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof 
process.versions==="object"&&typeof 
process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONM
ENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var
scriptDirectory="";function locateFile(path){i
abort(TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type 
string. Received type object). Build with -s ASSERTIONS=1 for more info. 


    



    Here is my code for calling play :

    



    case 'play':

            function play(connection, message){
                var server = servers[message.guild.id];

                server.dispatcher = connection.playStream(ytdl(server.queue[0], {filter: 'audioonly'}));

                server.queue.shift();

                server.dispatcher.on('end', function(){
                    if(server.queue[0]){
                        play(connection, message);
                    }else {
                        connection.disconnect();
                    }
                })
            }

            if(!args[1]){
                message.channel.send('You need to provide a link!');
                return;
            }

            if(!message.member.voiceChannel){
                message.channel.send('You must be in a voice channel to play music!');
                return;
            }

            if(!servers[message.guild.id]) servers[message.guild.id] = {
                queue: []
            }

            var server = servers[message.guild.id];

            server.queue.push(args[1]);

            if(!message.guild.voiceConnection) message.member.voiceChannel.join().then(function(connection){
                play(connection, message);
            })
            break;


    



    If anyone could assist with this, I would be very grateful.

    



    EDIT : I unfortunately never figured out my main issue, but I have now found code that works (unlike mine :/).
For anyone else having this issue, I suggest using the code found here.
Works like a charm !

    


  • VP8 for Real-time Video Applications

    15 février 2011, par noreply@blogger.com (John Luther)

    With the growing interest in videoconferencing on the web platform, it’s a good time to explore the features of VP8 that make it an exceptionally good codec for real-time applications like videoconferencing.

    VP8 Design History & Features

    Real-time applications were a primary use case when VP8 was designed. The VP8 encoder has features specifically engineered to overcome the challenges inherent in compressing and transmitting real-time video data.

    • Processor-adaptive encoding. 16 encoder complexity levels automatically (or manually) adjust encoder features such as motion search strategy, quantizer optimizations, and loop filtering strength.
    • Encoder can be configured to use a target percentage of the host CPU.
      Ability to measure the time taken to encode each frame and adjust encoder complexity dynamically to keep the encoding time per frame constant
    • Robust error recovery (packet retransmission, forward error correction, recovery frame/new keyframe requests)
    • Temporal scalability (i.e., a single video bitstream that can degrade as needed depending on a participant’s available bandwidth)
    • Highly efficient decoding performance on low-power devices. Conventional video technology has grown to a state of complexity where dedicated hardware chips are needed to make it work well. With VP8, software-based solutions have proven to meet customer needs without requiring specialized hardware.

    For a more information about real-time video features in VP8, see the slide presentation by WebM Project engineer Paul Wilkins (PDF file).

    Commercially Available Products

    Millions of people around the world have been using VP7/8 for video chat for years. VP8 is deployed in some of today’s most popular consumer videoconferencing applications, including Skype (group video calling), Sightspeed, ooVoo and Logitech Vid. All of these vendors are active WebM project supporters. VP8’s predecessor, VP7, has been used in Skype video calling since 2005 and is supported in the new Skype app for iPhone. Other real-time VP8 implementations are coming soon, including ooVoo, and VP8 will play a leading role in Google’s plans for real-time applications on the web platform.

    Real-time applications will be extremely important as the web platform matures. The WebM community has made significant improvements in VP8 for real-time use cases since our launch and will continue to do so in the future.

    John Luther is Product Manager of the WebM Project.

  • FFmpeg with S3 and AWS lambda

    19 mai 2023, par Hemant Rawat
    import boto3
import subprocess
import os
import re

s3_client = boto3.client('s3')

def lambda_handler(event, context):
    try:
        input_bucket_name = event['input_bucket_name']
        output_bucket_name = event['output_bucket_name']
        input_file_name = event['input_file_name']
        output_file_name = event['output_file_name']
        start_time = event['start_time']
        end_time = event['end_time']
        padding_image_file  = event['padding_image_file']
        video_scale = event['video_scale']
        video_overlay_x = event['video_overlay_x']
        video_overlay_y = event['video_overlay_y']
        subtitles_file = event['subtitles_file']

        input_file = '/tmp/' + input_file_name
        trimmed_file = '/tmp/trimmed_' + input_file_name
        output_file = '/tmp/' + output_file_name

        s3_client.download_file(input_bucket_name, input_file_name, input_file)

    except Exception as e:
        print(f'Error during initial setup: {e}')
        return

    try:
        trim_video(input_file, trimmed_file, start_time, end_time)
    except Exception as e:
        print(f'Error during trimming video: {e}')
        return

    try:
        add_subtitles_with_padding(trimmed_file, padding_image_file, video_scale, video_overlay_x, video_overlay_y, subtitles_file, output_file)
    except Exception as e:
        print(f'Error during adding subtitles and padding: {e}')
        return

    if os.path.isfile(trimmed_file):
        os.remove(trimmed_file)

    if not os.path.isfile(output_file):
        print(f'Output file not found: {output_file}')
        return

    try:
        s3_client.upload_file(output_file, output_bucket_name, output_file_name)
    except Exception as e:
        print(f'Error during upload: {e}')
        return

def execute_command(cmd):
    process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
    stdout, stderr = process.communicate()
    
    if process.returncode != 0:
        raise Exception(f'Error executing {cmd}: {stderr.decode()}')
    
    return stdout.decode()


def trim_video(input_file, output_file, start_time, end_time):
    cmd = [
        '/opt/ffmpeglib/ffmpeg', '-i', input_file, '-ss', start_time, '-to', end_time, '-c', 'copy', output_file
    ]

    try:
        result = subprocess.run(cmd, capture_output=True, text=True)
        result.check_returncode()
        print(f'Successfully trimmed {input_file} and saved the result to {output_file}')
    except subprocess.CalledProcessError as e:
        print(f'Error during trimming video: {e.stderr}')
        raise


def add_subtitles_with_padding(input_file, padding_image_file, video_scale, video_overlay_x, video_overlay_y, subtitles_file, output_file):
    cmd = [
        '/opt/ffmpeglib/ffmpeg', '-i', input_file, '-i', padding_image_file, '-filter_complex', 
        f"[0:v]scale=iw/{video_scale}:ih/{video_scale},setsar=1[main];\
        [1:v]scale=720:1280[pad];\
        [pad][main]overlay={video_overlay_x}:{video_overlay_y},\
        subtitles={subtitles_file}:force_style='Alignment=2,OutlineColour=&H100000000,BorderStyle=3,Outline=1,Shadow=0,Fontsize=10,MarginL=2,MarginV=20'",
        '-c:v', 'libx264', '-crf', '1', '-preset', 'medium', '-b:v', '1M', '-c:a', 'aac', '-b:a', '256k', '-movflags', '+faststart', '-y', output_file
    ]

    try:
        result = subprocess.run(cmd, capture_output=True, text=True)
        result.check_returncode()
        print(f'Successfully processed {input_file} and saved the result to {output_file}')
    except subprocess.CalledProcessError as e:
        print(f'Error during adding subtitles and padding: {e.stderr}')
        raise



    


    I'm getting this error can anybody help I'have been stuck in this for a week now and still not getting the solution right now i'm stuck at this error :-

    


    


    Error during initial setup : An error occurred (403) when calling the
HeadObject operation : Forbidden END RequestId :
29caa5b4-fbe0-4e45-af4f-7bde42393235

    


    


    Even though i have provided all the necessary permission from the IAM role.