
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (23)
-
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...) -
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...) -
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 (...)
Sur d’autres sites (3556)
-
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")



-
Layout Video Recording Like Instgram/ Ticktok Feature
21 mars 2023, par Amarchand KI'm try to do record video inn different layouts like Instagram in Flutter. For this feature I used ffmpeg_kit_flutter package. I refers this solution to do this. but output video is blank, any one helps me to solve this.
the video input and output path is valid, also show the bellow error while printing,


`ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
 built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
 configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs='-L/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-gmp --enable-gnutls --enable-iconv --disable-sdl2 --disable-openssl --enable-zlib --enable-mediacodec
 libavutil 57. 28.100 / 57. 28.100
 libavcodec 59. 37.100 / 59. 37.100
 libavformat 59. 27.100 / 59. 27.100
 libavdevice 59. 7.100 / 59. 7.100
 libavfilter 8. 44.100 / 8. 44.100
 libswscale 6. 7.100 / 6. 7.100
 libswresample 4. 7.100 / 4. 7.100
 -vsync is deprecated. Use -fps_mode
 Passing a number to -vsync is deprecated, use a string argument as described in the manual.
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.tuki_taki/cache/REC1453994379216336834.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2023-03-21T07:15:58.000000Z
 com.android.version: 12
 Duration: 00:00:03.77, start: 0.000000, bitrate: 2204 kb/s
 Stream #0:0[0x1](eng): Video: h264, 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt470bg/smpte170m/bt709, progressive, left), 640x480, 2199 kb/s, 29.61 fps, 29.58 tbr, 90k tbn (default)
 Metadata:
 creation_time : 2023-03-21T07:15:58.000000Z
 handler_name : VideoHandle
 vendor_id : [0][0][0][0]
 Side data:
 displaymatrix: rotation of -90.00 degrees
 Stream #0:1[0x2](eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)
 Metadata:
 creation_time : 2023-03-21T07:15:58.000000Z
 handler_name : SoundHandle
 vendor_id : [0][0][0][0]
 Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.tuki_taki/cache/REC5972384708251368209.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2023-03-21T07:16:05.000000Z
 com.android.version: 12
 Duration: 00:00:02.84, start: 0.000000, bitrate: 2703 kb/s
 Stream #1:0[0x1](eng): Video: h264, 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt470bg/smpte170m/bt709, progressive, left), 640x480, 2801 kb/s, 29.61 fps, 29.58 tbr, 90k tbn (default)
 Metadata:
 creation_time : 2023-03-21T07:16:05.000000Z
 handler_name : VideoHandle
 vendor_id : [0][0][0][0]
 Side data:
 displaymatrix: rotation of -90.00 degrees
 Stream #1:1[0x2](eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)
 Metadata:
 creation_time : 2023-03-21T07:16:05.000000Z
 handler_name : SoundHandle
 vendor_id : [0][0][0][0]
 Stream mapping:
 Stream #0:0 (h264) -> scale:default
 Stream #0:1 (aac) -> amix
 Stream #1:0 (h264) -> scale:default
 Stream #1:1 (aac) -> amix
 hstack:default -> Stream #0:0 (mpeg4)
 amix:default -> Stream #0:1 (aac)
 Press [q] to stop, [?] for help
 Output #0, mp4, to '/data/user/0/com.example.tuki_taki/cache/output.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 com.android.version: 12
 encoder : Lavf59.27.100
 Stream #0:0: Video: mpeg4, 1 reference frame (mp4v / 0x7634706D), yuv420p(progressive), 960x640 (0x0) [SAR 1:1 DAR 3:2], q=2-31, 200 kb/s, 29.58 fps, 11360 tbn
 Metadata:
 encoder : Lavc59.37.100 mpeg4
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
 Stream #0:1: Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, delay 1024, 69 kb/s
 Metadata:
 encoder : Lavc59.37.100 aac
 frame= 1 fps=0.0 q=4.3 size= 0kB time=00:00:00.23 bitrate= 1.5kbits/s speed=3.49x 



[mpeg4 @ 0xb400007122ebac50] Invalid pts (8) <= last (8)
Error submitting video frame to the encoder
[aac @ 0xb4000071232208c0] Qavg : 9911.349
[aac @ 0xb4000071232208c0] 2 frames left in the queue on closing
Conversion failed`


I'm tried


`Future<void> onLayoutDone() async {
try {
 final String outputPath = await _getTempPath(); 
 const String filter =
 "[0:v]scale=480:640,setsar=1[l];[1:v]scale=480:640,setsar=1[r];[l][r]hstack;[0][1]amix -vsync 0 "; 
 log("left path: ${layoutVideoPathList[0]} right : ${layoutVideoPathList[1]} $outputPath"); 
 final String command =" -y -i ${layoutVideoPathList[0]} -i ${layoutVideoPathList[1]} -filter_complex$filter$outputPath -loglevel verbose"; `these paths are valid` 
 
 await FFmpegKit.execute(command).then((value) async { 
 String? error = await value.getAllLogsAsString(); 
 log(error!); 
 final ReturnCode? returnCode = await value.getReturnCode(); 
 if (returnCode != null) {
 setVideo(videoPath: outputPath); 
 layoutVideoPathList.clear(); 
 }
 });
} catch (e) {
 log("error while combine -========-=-=-=-=-=-=-=-=- $e"); 
}`
</void>


-
Discord Voice Bot cannot play the audio file
7 avril 2023, par Jakub NawrockiI tried to write a bot that will join the voice channel and play a audio at 20:00.


Currently the bot joins the channel, but immediately after that it disconnects without making a single sound with this message :


2023-04-07 17:58:01 INFO discord.player ffmpeg process 18258 has not terminated. Waiting to terminate... 2023-04-07 17:58:01 INFO discord.player ffmpeg process 18258 should have terminated with a return code of -9. 2023-04-07 17:58:01 INFO discord.voice_client The voice handshake is being terminated for Channel ID 1093533451778523241 (Guild ID 1093533451778523237) 2023-04-07 17:58:01 INFO discord.voice_client Disconnecting from voice normally, close code 1000. Audio file loaded: Audio could not be played:


Code :


import discord
import asyncio
import datetime

TOKEN = 'TOKEN HERE' 
CHANNEL_ID = CHANNEL ID HERE

client = discord.Client(intents=discord.Intents.all())

async def play_sound(voice_client):
 try:
 source = discord.FFmpegPCMAudio('audio.mp3')
 print(f"Audio file loaded: {source}")
 voice_client.play(source)
 while voice_client.is_playing():
 await asyncio.sleep(1)
 except Exception as e:
 print(f"Audio could not be played: {e}")

@client.event
async def on_ready():
 print('Bot is ready')
 now = datetime.datetime.now()
 target_time = datetime.time(hour=20, minute=00)
 if now.time() >= target_time:
 print(f"Current time: {now.time()}. Bot did not join channel.")
 return
 else:
 print(f"Current time: {now.time()}. Bot has joined at {target_time}.")
 await asyncio.sleep((datetime.datetime.combine(datetime.date.today(), target_time) - now).total_seconds())
 channel = client.get_channel(CHANNEL_ID)
 if channel is not None:
 try:
 voice_client = await channel.connect()
 print(f'{client.user} joined voice chat.')
 await asyncio.sleep(1)
 await play_sound(voice_client)
 await voice_client.disconnect()
 print(f'{client.user} left voice chat.')
 except Exception as e:

 print(f"Error during joining channel : {e}")
 else:
 print(f"Did not find a channel of ID {CHANNEL_ID}.")

client.run(TOKEN)



Any ideas ?


ffmpeg has been installed properly.