
Recherche avancée
Médias (3)
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (60)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Soumettre améliorations et plugins supplémentaires
10 avril 2011Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)
Sur d’autres sites (6294)
-
How to compile ffmpeg4.4 with OpenCV3.4.13 to work in Android Studio4.2.1 (Java) [closed]
8 juin 2021, par FabFinally opencv is working in my Android Studio project (solved with help of https://www.youtube.com/watch?v=-0Yx1UzozzQ). But theres is no Video I/O information visible so I guess i didnt connected ffmpeg correctly in my project and it isnt used at all !?


My steps so far :


- 

-
ffmpeg download : https://www.videohelp.com/software/ffmpeg


-
added ffmpeg to path like explained here :
https://soundartifacts.com/how-to/186-how-to-install-ffmpeg-on-windows-10-amp-add-ffmpeg-to-windows-path.html#video
. Powershell shows that ffmpeg is installed.


-
when printing Core.getBuildInformation() in the project I see that the Video I/O section is empty and I assume there has to be some information about FFMPEG etc...see picture :
enter image description here










- 

- I dont get any error messages. I try to VideoCapture.open("somestring") and return value is always false.




I know there are a lot of similar questions but I cant identify which one really addresses my issue.
Really appreciate your help. Thanks, Fabian


-
-
Discord Bot can't play audio from YouTube all of a sudden
22 mars 2023, par Aidan TweedyLast night my Discord bot stopped working out of the blue. The bot had been working perfectly for months until this point - no code changes occurred and it was running in a Docker container on my home server. Then last night, my
!play <url></url>
command stopped working. The bot would join the voice channel, but not actually play anything. Then it would need to be manually disconnected from the voice channel in order for it to do anything again. After the first play fails, and I try again I get this error message :

[youtube] crOZk88eCcg: Downloading webpage
 [youtube] crOZk88eCcg: Downloading android player API JSON
 [youtube] Extracting URL: https://www.youtube.com/watch?v=crOZk88eCcg&ab_channel=0foofighter0
 [youtube] crOZk88eCcg: Downloading webpage
 [youtube] crOZk88eCcg: Downloading android player API JSON
 [2023-03-22 00:27:59] [ERROR ] discord.ext.commands.bot: Ignoring exception in command play
 Traceback (most recent call last):
 File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/core.py", line 190, in wrapped
 ret = await coro(*args, **kwargs)
 File "/usr/src/app/./main.py", line 180, in play
 voice.play(player, after=lambda e: print(f'Player error: {e}') if e else None)
 File "/usr/local/lib/python3.10/dist-packages/discord/voice_client.py", line 600, in play
 raise ClientException('Not connected to voice.')
 discord.errors.ClientException: Not connected to voice.
 
 The above exception was the direct cause of the following exception:
 
 Traceback (most recent call last):
 File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/bot.py", line 1347, in invoke
 await ctx.command.invoke(ctx)
 File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/core.py", line 986, in invoke
 await injected(*ctx.args, **ctx.kwargs) # type: ignore
 File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/core.py", line 199, in wrapped
 raise CommandInvokeError(exc) from exc
 discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Not connected to voice.
 [2023-03-22 00:27:59] [INFO ] discord.player: ffmpeg process 12 has not terminated. Waiting to terminate...
 [2023-03-22 00:27:59] [INFO ] discord.player: ffmpeg process 12 should have terminated with a return code of -9.



My first instinct was that ffmpeg was borking somehow, since it has been difficult to get working in the past. However I'm not sure how ffmpeg could've stopped working, since the bot never went down between working and not working. That leads me to believe it could be a change on Youtube/Discord's side ?


For context, here is a snippet of my
!play
code :

@client.command(pass_context = True)
async def play(ctx):
 url = ctx.message.content.split("!play ",1)[1]
 voice = discord.utils.get(client.voice_clients)
 if (ctx.author.voice):
 if voice == None:
 channel = ctx.message.author.voice.channel
 voice = await channel.connect()

 # Youtube Magic
 ydl_opts = {
 'format': 'worstaudio/worst',
 'postprocessors': [{
 'key': 'FFmpegExtractAudio',
 'preferredcodec': 'mp3',
 'preferredquality': '192',
 }],
 }

 if "http" not in url:
 yt = YoutubeSearch(url, max_results=1).to_json()
 print(yt)
 yt_id = str(json.loads(yt)['videos'][0]['id'])
 yt_channel = str(json.loads(yt)['videos'][0]['channel']).strip().replace(" ", "")
 url = 'https://www.youtube.com/watch?v='+yt_id+"&ab_channel="+yt_channel

 with yt_dlp.YoutubeDL(ydl_opts) as ydl:
 song_info=ydl.extract_info(url, download=False)
 for file in os.listdir("./"):
 if file.endswith(".mp3"):
 os.rename(file, "song.mp3")

 voice.stop()

 embed_trk = discord.Embed(
 title="Now playing",
 color=ctx.author.color,
 )
 video_title = song_info.get('title', None)
 video_channel = song_info.get('uploader', None)
 embed_trk.add_field(name="Track title", value=video_title, inline=False)
 embed_trk.add_field(name="Channel", value=video_channel, inline=False)

 await ctx.send(embed=embed_trk)
 player = await YTDLSource.from_url(url, loop=client.loop, stream=True)
 voice.play(player, after=lambda e: print(f'Player error: {e}') if e else None)
 while voice.is_playing():
 await asyncio.sleep(1)
 
 await request_record(ctx, video_title)

 else:
 await ctx.send("You must be in a voice channel to run this command")



-
FFmpeg with yt-dlp in an android environment
7 janvier, par Pastorii am currently working on an android application that initially needs to install a youtube video, here's what am using in my development environment : android studio, chaquopy, python (yt-dlp) and gradle groovy for builds, now i am facing a problem with yt-dlp and the error states the following : "ERROR : You have requested merging of multiple formats but ffmpeg is not installed. Aborting due to —abort-on-error", now clearly yt-dlp requires ffmpeg to work properly and i have looked into it and found FFmpegKit i got the latest android archive and i included it in my build, and it builds but yt-dlp still produces the same error, i don't really understand how the packages and environment works all that well but any help on this would be appreciated 👍


NOTE : gradle builds perfectly fine i don't even get warnings it's just the yt-lp error during video download.


// build.gradle (project level)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
 alias(libs.plugins.android.application) apply false
 id("com.chaquo.python") version "16.0.0" apply false
}



// build.gradle (app level)
plugins {
 alias(libs.plugins.android.application)
 id("com.chaquo.python")
}

chaquopy {
 defaultConfig {
 buildPython("C:/Program Files/Python313/python.exe")
 buildPython("C:/Program Files/Python313/python.exe", "-3.8")
 }
 sourceSets {
 getByName("main") {
 srcDir("src/main/assets/python") // Tell Chaquopy to look here
 }
 }
}

android {
 namespace 'com.example.ytrans'
 compileSdk 34

 defaultConfig {
 applicationId "com.example.ytrans"
 minSdk 24
 targetSdk 34
 versionCode 1
 versionName "1.0"

 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

 ndk {
 // On Apple silicon, you can omit x86_64.
 abiFilters "arm64-v8a", "x86_64"
 }

 python {
 version "3.8"
 buildPython "C:/Program Files/Python313/python.exe"
 pip {
 install "yt-dlp" // This will install yt-dlp via pip
 }
 }

 }

 buildTypes {
 release {
 minifyEnabled false
 proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
 }
 }
 compileOptions {
 sourceCompatibility JavaVersion.VERSION_11
 targetCompatibility JavaVersion.VERSION_11
 }
}

dependencies {
 implementation libs.appcompat
 implementation libs.material
 implementation libs.activity
 implementation libs.constraintlayout
 testImplementation libs.junit
 androidTestImplementation libs.ext.junit
 androidTestImplementation libs.espresso.core
 implementation files("libs/ffmpeg-kit-full-6.0-2.LTS.aar")
}






// java code
 public static void downloadVideo(String video_url, String output_path)
 {

 Python py = Python.getInstance();
 PyObject pyObj = py.getModule("yt_dlp_script"); // Import yt-dlp
 try {
 pyObj.callAttr("download", video_url, output_path);
 Log.i("VideoDownloader", "Video downloaded successfully!");
 } catch (Exception e) {
 Log.e("VideoDownloader", "Error downloading video: " + e.getMessage());
 }
 }



# python script
import yt_dlp

def download(video_url, output_path):
 ydl_opts = {
 'outtmpl': output_path, # specify the output file path
 'merge_output_format': 'mp4',
 }

 with yt_dlp.YoutubeDL(ydl_opts) as ydl:
 ydl.download([video_url]) # Download the video