
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (56)
-
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...) -
Use, discuss, criticize
13 avril 2011, parTalk 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. -
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)
Sur d’autres sites (5093)
-
Python Discord music bot stops playing a couple of minutes into any song
9 mars 2023, par knewbyI am trying to put together a Python Discord music bot as a fun little project. Outside of the required discord library I'm currently using the YouTube API to search for videos and parse the URL (not shown in code), yt-dlp which is a fork of yt_download that is still maintained to get the info from the YT URL, and FFMPEG to play the song obtained from yt-dlp through the bot. My play command seems to work as the 1st YT video result will start to play, but roughly 30-90 seconds into the audio, it stops playing. I get this message in the console :


2023-02-23 14:54:44 IN discord.player ffmpeg process 4848 successfully terminated with return code of 0.


So there is no error for me to go off of. I've included the full output from the console below...


-----------------------------------
groovy-jr#6741 is up and running
-----------------------------------
2023-02-23 14:53:23 INFO discord.voice_client Connecting to voice...
2023-02-23 14:53:23 INFO discord.voice_client Starting voice handshake... (connection attempt 1)
2023-02-23 14:53:24 INFO discord.voice_client Voice handshake complete. Endpoint found us-south1655.discord.media
2023-02-23 14:54:44 INFO discord.player ffmpeg process 4848 successfully terminated with return code of 0. <= AUDIO STOPS



I'm currently developing this project on a Windows 11 machine, but I've had the issue running it on my Ubuntu machine as well. I am just hosting the bot directly from the VSCode terminal for development.


I've been trying to do research on this problem, the problem is I can't find many recent information for the issue. There was another post that talked about a similar problem and had an answer suggesting the following FFMPEG options be used which I tried to no avail.


FFMPEG_OPTIONS = {
 'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
 'options': '-vn',
 }



I'll include the problem file below :


import discord
from discord.ext import commands
from discord import FFmpegPCMAudio
import responses
import youtubeSearch as YT
import yt_dlp

async def send_message(message, user_message, is_private = False):
 try:
 response = responses.handle_response(user_message)
 await message.author.send(response) if is_private else await message.channel.send(response)
 except Exception as e:
 print(e)

def run_discord_bot():
 intents = discord.Intents.default()
 intents.message_content = True

 TOKEN = 'xxxxxx'
 client = commands.Bot(command_prefix = '-', intents=intents)

 @client.event
 async def on_ready():
 print('-----------------------------------')
 print(f'{client.user} is up and running')
 print('-----------------------------------')

 @client.command(name='play', aliases=['p'], pass_context = True)
 async def play(ctx, *, search_term:str = None):
 if ctx.author.voice:
 voice = None
 if search_term == None:
 await ctx.send('No song specified.')
 return
 if not ctx.voice_client:
 channel = ctx.message.author.voice.channel
 voice = await channel.connect()
 else:
 voice = ctx.guild.voice_client
 
 url = YT.singleSearch(search_term)
 
 YTDLP_OPTIONS = {
 'format': 'bestaudio/best',
 'extractaudio': True,
 'audioformat': 'mp3',
 'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s',
 'restrictfilenames': True,
 'noplaylist': True,
 'nocheckcertificate': True,
 'ignoreerrors': False,
 'logtostderr': False,
 'quiet': True,
 'no_warnings': True,
 'default_search': 'ytsearch',
 'source_address': '0.0.0.0',
 }

 =====> FFMPEG_OPTIONS = {
 'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
 'options': '-vn',
 }

 with yt_dlp.YoutubeDL(YTDLP_OPTIONS) as ydl:
 info = ydl.extract_info(url, download=False)
 playUrl = info['url']

 source = FFmpegPCMAudio(playUrl, options=FFMPEG_OPTIONS)
 voice.play(source)
 else:
 await ctx.send('You must be in a voice channel to play a song!')
 return

 @client.command(pass_context = True)
 async def leave(ctx):
 if ctx.voice_client:
 await ctx.guild.voice_client.disconnect()
 else:
 await ctx.send("I'm not in a voice channel!")

 @client.command(pass_context = True)
 async def pause(ctx):
 voice = discord.utils.get(client.voice_clients, guild = ctx.guild)
 if voice.is_playing():
 voice.pause()
 else:
 await ctx.send('No audio playing...')

 @client.command(pass_context = True)
 async def resume(ctx):
 voice = discord.utils.get(client.voice_clients, guild = ctx.guild)
 if voice.is_paused():
 voice.resume()
 else:
 await ctx.send('No audio paused...')

 @client.command(pass_context = True)
 async def stop(ctx):
 voice = discord.utils.get(client.voice_clients, guild = ctx.guild)
 voice.stop()

 client.run(TOKEN)



I appreciate any guidance I can get !


-
Android Merging two video with different (sizes,codec,frames,aspect raito) using FFMPEG
6 septembre 2017, par Alok Kumar VermaI’m making an app which merges two or more than two video files which I’m getting from another activity. After choosing the files we pass the files to another activity where the merging happens. I’ve followed this link to do the same : AndroidWarZone FFMPEG
Here I found the way on how to merge the two files only with different qualities. The command is given below :
String[] complexCommand = {"ffmpeg","-y","-i","/storage/emulated/0/videokit/sample.mp4",
"-i","/storage/emulated/0/videokit/in.mp4","-strict","experimental",
"-filter_complex",
"[0:v]scale=640x480,setsar=1:1[v0];[1:v]scale=640x480,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1",
"-ab","48000","-ac","2","-ar","22050","-s","640x480","-r","30","-vcodec","mpeg4","-b","2097k","/storage/emulated/0/vk2_out/out.mp4"}Since I have a list of selected videos inside my array which I’m passing to the next page, I’ve done some changes in my command, like this :
private void mergeVideos() {
String savingPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/video.mp4";
ArrayList<file> fileList = mList;
List<string> filenames = new ArrayList<string>();
for (int i = 0; i < fileList.size(); i++) {
filenames.add("-i");
filenames.add(fileList.get(i).toString());
}
Log.e("Log===",filenames.toString());
String joined = TextUtils.join(", ",filenames);
Log.e("Joined====",joined);
String complexCommand[] = {"-y", joined,
"-filter_complex",
"[0:v]scale=640x480,setsar=1:1[v0];[1:v]scale=640x480,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1",
"-ab","48000","-ac","2","-ar","22050","-s","640x480","-r","30","-vcodec","mpeg4","-b","2097k", savingPath};
Log.e("RESULT====",Arrays.toString(complexCommand));
execFFmpegBinary(complexCommand); }
</string></string></file>In the log this is the the output I’m getting :
This one is for received data which I have added in the mList
E/RECEIVED DATA=====: [/mnt/m_external_sd/DCIM/Camera/VID_31610130_011933_454.mp4, /mnt/m_external_sd/DCIM/Camera/VID_23120824_054526_878.mp4]
E/RESULT====: [-y, -i, /mnt/m_external_sd/DCIM/Camera/VID_31610130_011933_454.mp4, -i, /mnt/m_external_sd/DCIM/Camera/VID_23120824_054526_878.mp4, -filter_complex, [0:v]scale=640x480,setsar=1:1[v0];[1:v]scale=640x480,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1, -ab, 48000, -ac, 2, -ar, 22050, -s, 640x480, -r, 30, -vcodec, mpeg4, -b, 2097k, /storage/emulated/0/video.mp4]Here result is the complexCommand that is going inside the exeFFMPEGBinary() but not working.
This is my exceFFMPEGBinary()
private void execFFmpegBinary(final String[] combine) {
try{
fFmpeg.execute(combine, new ExecuteBinaryResponseHandler() {
@Override
public void onFailure(String s) {
Log.d("", "FAILED with output : " + s);
}
@Override
public void onSuccess(String s) {
Log.d("", "SUCCESS with output : " + s);
Toast.makeText(getApplicationContext(),"Success!",Toast.LENGTH_SHORT)
.show();
}
@Override
public void onProgress(String s) {
Log.d("", "progress : " + s);
}
@Override
public void onStart() {
progressDialog.setMessage("Processing...");
progressDialog.show();
}
@Override
public void onFinish() {
progressDialog.dismiss();
}
});
} catch (FFmpegCommandAlreadyRunningException e) {
// do nothing for now
}
}I’ve done this and run my project, now the problem is it is not merging/concatenating anything, just a progressDialog comes up for a fraction of second and all I’m getting is this in my log :
E/FFMPEG====: ffmpef : coorect loaded
This means that ffmpeg is loading and nothing is getting implemented. I don’t get any log for onFailur, onSuccess(), onStart().
Any suggestions would help me achieve my goal. Thanks.
Note : I have done this merging with the use of Mp4Parser but there is a glitch inside it, it requires the file with same specification. So this is not my requirement.
EDITS
I did some more research and got this to concatenate, but this is not working either, here is the link : Concatenating two files
I’ve found this stuff also from a link : FFMPEG Merging/Concatenating
and found that his piece of code is working fine. But not mine.I’ve used that command also but it is not working nor giving me any log results. Except the FFMPEG Loading.
Here is the command :
complexCommand = new String[]{"-y", "-i", file1.toString(), "-i", file2.toString(), "-strict", "experimental", "-filter_complex",
"[0:v]scale=1920x1080,setsar=1:1[v0];[1:v] scale=iw*min(1920/iw\\,1080/ih):ih*min(1920/iw\\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\\,1080/ih))/2:(1080-ih*min(1920/iw\\,1080/ih))/2,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1","-ab", "48000", "-ac", "2", "-ar", "22050", "-s", "1920x1080", "-vcodec", "libx264","-crf","27","-q","4","-preset", "ultrafast", rootPath + "/output.mp4"}; -
Can ffmpeg concatenate mp3 files using the process at audio-joiner.com ?
7 juin 2020, par Ed999I have a dozen or more mp3 audio files, which I need to concatenate into a single mp3 file. The files all have the same bitrate (320 kbps) and sample rate (44.1 kHz), but all of them have differing durations.



I have studied the three methods of concatenation recommended on stackoverflow (How to concatenate two MP4 files using FFmpeg). One method actually works, but when I play back the output file I find that there are noticeable audio artifacts (audible glitches) at each join point.



I've been told that this problem is caused by the input files not having identical duration. This seems likely, because I've had some successes in concatenating audio files with identical bit rate, sample rate, and duration.



I have seen, online, some much more complex scripts which are, at present, miles beyond my understanding. One solution I was directed to required a fairly deep knowledge of Python !



However, my research also included a site at audio-joiner.com - and this had the only completely successful method I've yet found, for files of non-identical duration. That site processed some of my input files, joined the multiple files into one, and the concatenated output file it produced did not have any audible glitches at the joins.



I looked into the process the site was using, hoping to get a clue as to where I've been going wrong, but the script on the site (which looks like ajax-based javascript) is too complex for me to follow.



Because the process seemed to take quite a long time, I wouldn't be too surprised to learn that the mp3 input files are being converted to some other audio format, joined, then converted back to mp3 for the output. But if so, that wouldn't put me off using the process.



Is anyone familiar with the approach being used, and can say whether it might be reproducible using ffmpeg ?



.



ADDED -



There are 7 scripts, in all, listed in the source of the relevant page :



https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.0/jquery.min.js
https://static.123apps.com/js/socket.io.js
https://static.123apps.com/js/shared_0.js
https://static.123apps.com/js/shared_1.js
https://static.123apps.com/js/ajoiner.js
https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js




.



ADDED -



The successful (javascript) function seems to be this, but it isn't obvious to me why it is succeeding (too complex for me !). Can anyone suggest what approach it is taking ? For example, is it transcoding the mp3 files to an intermediate format, and concatenating the intermediate files ?



function start_join(e){
 l("start_join():"),l(e);
 var t;
 return(t=$.parseJSON(e)) && $("#ajoiner").ajoiner("set_params",t),!0
}

function cancel_join(e){
 return l("cancel_join():"),l(e),!0
}

!function(o){
 var t={
 init:function(e){
 var t=o(this),n=o.extend({lang:{cancel:"Cancel",download:"Download"}},e);
 o(this).data("ajoiner",{o:n,tmp_i:1,pid:-1,params:{}});
 t.data("ajoiner");
 t.ajoiner("_connect"),o("body").bind("socket_connected",function(){t.ajoiner("_connect")})
 },set_params:function(e){
 var t=o(this).data("ajoiner");
 isset(e)?(e.uid=Cookies.get("uid"),t.params=e,t.params.lang_id=lang_id,t.params.host=location.hostname,t.params.hostprotocol=location.protocol,l("socket emit join:"),l(t.params),socket.emit("join",t.params)):error("set_params: params not set")
 },_connect:function(){

 var t=o(this).data("ajoiner");

 l("_connect"),socket.on("join",function(e){
 "progress"==e.message_type?(t.tmp_i,t.tmp_i++,void 0!==getObj("theSWF")&&(getObj("theSWF").set_join_progress(parseInt(e.progress_value)),l("SWF.set_join_progress("+parseInt(e.progress_value)+")")),isset(e.pid)&&(t.pid=e.pid)):"final_result"==e.message_type?(void(e.tmp_i=0)!==getObj("theSWF")&&(getObj("theSWF").join_finished(o.stringifyJSON(e)),l("SWF.join_finished('"+o.stringifyJSON(e)+"')")),last_conv_result=e):"error"==e.message_type&&l(e.error_desc)
 }
 )},_cancel_convert:function(){
 var e=o(this).data("ajoiner");
 0code>