
Recherche avancée
Autres articles (94)
-
Qu’est ce qu’un éditorial
21 juin 2013, parEcrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
Vous pouvez personnaliser le formulaire de création d’un éditorial.
Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...) -
Contribute to translation
13 avril 2011You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
MediaSPIP is currently available in French and English (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette 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.
Sur d’autres sites (7424)
-
discord.py music bot can't play next song
6 décembre 2020, par borkI'm making a discord music bot using ffmpeg and youtube-dl. I have a premade playlist of urls that would play the list of songs once a user chooses it.

this is my code for playing the audio

ydl_opts = {
 'format': 'bestaudio', 
 'noplaylist':'True',
 'youtube_include_dash_manifest': False
 }
FFMPEG_OPTIONS = {
 'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
 'options': '-vn'
 }

songs = url[playlist]
dur_min = 0
pre_dur_sec = 0
with YoutubeDL(ydl_opts) as ydl:
 for i in songs:
 info = ydl.extract_info(i, download = False)
 dur = info['duration']
 playlist_songs.append(info)

playlist_songs_copy = playlist_songs.copy()
for i in playlist_songs_copy:
 info = playlist_songs.pop(0)
 URL = info['formats'][0]['url']
 player = FFmpegPCMAudio(URL, **FFMPEG_OPTIONS)
 q.append(player)
 q_playlist.append(playlist)

if not voice.is_playing():
 source = q.pop(0) 
 playlist = q_playlist.pop(0)
 dur_min = duration_min.pop(0)
 dur_sec = duration_sec.pop(0) 
 voice.play(source, after = lambda e: play_next(ctx, source)) 
 voice.is_playing()
 await ctx.send(f'```nim\n*Now Playing:*\nplaylist {playlist}: {name[playlist]}\n\n{content[playlist]}\n\ntotal duration: {dur_min}:{dur_sec}```')



and this is my code for playing the next song


def play_next(ctx, source):
 voice = get(client.voice_clients, guild = ctx.guild)
 if len(q) >= 1:
 try:
 del combine_q[0]
 source = q.pop(0)
 playlist = q_playlist.pop(0)
 dur_min = duration_min.pop(0)
 dur_sec = duration_sec.pop(0)

 except:
 pass

 voice.play(source, after = lambda e: play_next(ctx, source))
 try:
 asyncio.run_coroutine_threadsafe(ctx.send(f'```nim\n*Now Playing:*\nplaylist {playlist}: {name[playlist]}\n\n{content[playlist]}\n\ntotal duration: {dur_min}:{dur_sec}```'), client.loop)
 
 except:
 asyncio.run_coroutine_threadsafe(ctx.send('```nim\nPlaying the next song...```'), client.loop)
 
 else:
 time.sleep(30) 
 if not voice.is_playing():
 asyncio.run_coroutine_threadsafe(voice.disconnect(), client.loop)
 asyncio.run_coroutine_threadsafe(ctx.send("```nim\nNo more songs in queue.```"),client.loop)
 voice.is_paused()



Up till today, it's been working fine. But I was using the bot just now and instead of playing the song and sending the message "Playing the next song..." as usual, it just stopped and spammed the message for about 30 times before it disconnected. When I checked the logs, it showed

socket.send() raised exception

, which was also spammed in the terminal. When I tried making the bot reconnect, it joined my voice channel but didn't respond to any commands and would keep making the discord "connecting" noise. It wouldn't even leave with my .leave command unless I completely turned it off via the script.

The same connecting problem would continue even after I reran the script and would only stop after I restarted my VS Code which is really odd...


After some testing I found out that as of now, the bot is only able to play two songs before breaking. I really need help as this just happened randomly and I'm unable to find anything online about the problem.


-
how to use ffmpeg in laravel 8.x project
1er décembre 2020, par user14698698so i just installed ffmpeg package in my laravel 8 project using


composer require pbmedia/laravel-ffmpeg



i also publish the file when added class in app.php file as documentation says, but i don't know how can i use this


i want to use this here


use FFMpeg;

public function videoUpload(Request $request){
 $files=$request->file('files');
 
 $newVideo = FFMpeg::fromDisk('videos')
 ->open($files)
 ->save('small_steve.mkv');

 return view('admin.Post.video',compact('newVideo'));
 }

// config/app.php

'providers' => [
 ...
 ProtoneMedia\LaravelFFMpeg\Support\ServiceProvider::class,
 ...
];

'aliases' => [
 ...
 'FFMpeg' => ProtoneMedia\LaravelFFMpeg\Support\FFMpeg::class
 ...
];



// composer.json


"pbmedia/laravel-ffmpeg": "^7.4"



//config/laravel-ffmpeg.php


<?php

return [
 'ffmpeg' => [
 'binaries' => env('FFMPEG_BINARIES', 'ffmpeg'),
 'threads' => 12,
 ],

 'ffprobe' => [
 'binaries' => env('FFPROBE_BINARIES', 'ffprobe'),
 ],

 'timeout' => 3600,

 'enable_logging' => true,

 'set_command_and_error_output_on_exception' => false,
];



when i try to use ffmpeg in my controller it shows


//error
//if i use FFMpeg/FFMpeg ;




Call to undefined method FFMpeg\FFMpeg::fromDisk()




//or if i used FFMpeg ;




unable to load FFMpeg ;




please help me out


-
electron fluent-ffmpeg mergeToFile() command promise not triggering
12 septembre 2020, par MartinI am trying to use fluent-ffmpeg with my electron app to concatenate multiple audio files together with an image in a video. So if i have three files :


song1.mp3 1:00
song2.mp3 0:30
song3.mp3 2:00
front.jpg


I could create
output.mp4
which would be 3:30 seconds long, and play each file one after the other in order. With front.jpg set as the background image.

I am trying to create the concatenated audio file first for this video, then I can just render a vid with two inputs ; image and the 3:30second long concatenated audio file. But I'm having difficulty getting my electron app to wait for the ffmpeg job to run and complete.


I know how to do all of these ffmpeg jobs on the command-line, but I've been following this guide for how to package ffmpeg into an electron app that can run on mac/win10/linux environments. I'm developing it on win10 right now.
gur.com/LtykP.png


I have a button :

<button>FULLALBUM</button>


that when I click runs the
fullAlbum()
function that callscombineMp3FilesOrig
to run the actual ffmpeg job :

async function fullAlbum(uploadName) {
 //document.getElementById("buttonId").disabled = true;

 //get table
 var table = $(`#upload_${uploadNumber}_table`).DataTable()
 //get all selected rows
 var selectedRows = table.rows( '.selected' ).data()
 //get outputFile location
 var path = require('path');
 var outputDir = path.dirname(selectedRows[0].audioFilepath)
 //create outputfile
 var timestamp = new Date().getUTCMilliseconds();
 let outputFilepath = `${outputDir}/output-${timestamp}.mp3` 

 
 console.log('fullAlbum() button pressed: ', timestamp)

 await combineMp3FilesOrig(selectedRows, outputFilepath, '320k', timestamp);
 //document.getElementById("buttonId").disabled = false;

 console.log(`fullAlbum() /output-${timestamp}.mp3 should be created now`)
}

function combineMp3FilesOrig(selectedRows, outputFilepath, bitrate, timestamp) {
 console.log(`combineMp3FilesOrig(): ${outputFilepath}`)
 
 //begin get ffmpeg info
 const ffmpeg = require('fluent-ffmpeg');
 //Get the paths to the packaged versions of the binaries we want to use
 const ffmpegPath = require('ffmpeg-static').replace('app.asar','app.asar.unpacked');
 const ffprobePath = require('ffprobe-static').path.replace('app.asar','app.asar.unpacked');
 //tell the ffmpeg package where it can find the needed binaries.
 ffmpeg.setFfmpegPath(ffmpegPath);
 ffmpeg.setFfprobePath(ffprobePath);
 //end set ffmpeg info

 //create ffmpeg command
 console.log(`combineMp3FilesOrig(): create command`)
 const command = ffmpeg();
 //set command inputs
 command.input('C:\\Users\\marti\\Documents\\martinradio\\uploads\\CharlyBoyUTurn\\5. Akula (Club Mix).flac')
 command.input('C:\\Users\\marti\\Documents\\martinradio\\uploads\\CharlyBoyUTurn\\4. Civilian Barracks.flac')

 return new Promise((resolve, reject) => {
 console.log(`combineMp3FilesOrig(): command status logging`)
 command.on('progress', function(progress) {
 console.info(`Processing : ${progress.percent} % done`);
 })
 .on('codecData', function(data) {
 console.log('codecData=',data);
 })
 .on('end', function() {
 console.log('file has been converted succesfully; resolve() promise');
 resolve();
 })
 .on('error', function(err) {
 console.log('an error happened: ' + err.message, ', reject()');
 reject(err);
 })
 console.log(`combineMp3FilesOrig(): add audio bitrate to command`)
 command.audioBitrate(bitrate)
 console.log(`combineMp3FilesOrig(): tell command to merge inputs to single file`)
 command.mergeToFile(outputFilepath);
 console.log(`combineMp3FilesOrig(): end of promise`)
 });
 console.log(`combineMp3FilesOrig(): end of function`)
}



When I click my button once, my console.logs show the promise is entered, the command is created, but the function just ends without waiting for a resolve() ;
Waiting a couple minutes doesnt change anything.




If I press the button again :




A new command gets created, reaches the end of the promise, but this time actually starts, and triggers the previous command to start. Both jobs then run and their files are rendered at the correct length (12:08) and the correct quality (320k)


Is there something with my promise I need to fix involving async functions and promises in an electron app ? I tried editing my ffmpeg command to include


command.run()


At the end of my promise to ensure it gets triggered ; but that leads to an err in console saying
Uncaught (in promise) Error: No output specified
because apparently in fluent-ffmpegcommand.mergeToFile(outputFilepath);
isnt good enough and I need to include.output(outputFilepath)
as well. If I changecommand.run()
tocommand.output(outputFilepath).run()
, when i click my button, the ffmpeg job gets triggered and rendered perfectly fine. EXCEPT THAT THE FILE IS ALWAYS 128kbps

So I'm trying to figure out why my included code block, my ffmpeg command doesn't run the first time when its created.