
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 (102)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
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 (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (11257)
-
Discord.py, ffmpeg and pytube to play audio, but it keeps stopping early. Why ? [closed]
15 septembre 2023, par LowEloTVI tried to program a discord,py bot to play audio, but the audio kept cutting out in the middle.


@bot.command()
async def play(ctx, url: str):
 global ffmpeg_executable
 if discord.utils.get(ctx.guild.roles, name='music'):
 role = discord.utils.get(ctx.guild.roles, name='music')
 if role in ctx.author.roles:
 voice_client = ctx.voice_client


 if voice_client is None:
 channel = ctx.author.voice.channel
 voice_client = await channel.connect()
 print("Bot joined voice channel successfully.")


 try:
 # Fetch the audio stream URL using pytube
 yt = YouTube(url)
 audio_stream = yt.streams.filter(only_audio=True).first()


 # Play the audio stream using the VoiceProtocol
 if voice_client.is_playing():
 voice_client.stop()
 voice_client.play(discord.FFmpegPCMAudio(audio_stream.url, executable=ffmpeg_executable))
 except Exception as e:
 await ctx.reply(f"An error occurred: {str(e)}")
 else:
 await ctx.reply('You don\'t have the permission for this command!')
 else:
 await ctx.reply('This Feature is not available on this guild, ask an Admin to add it!')





I tried to program a discord,py bot to play audio, but the audio kept cutting out in the middle.


-
Inserting clips into mp4 via ffmpeg
15 septembre 2024, par lfganI am looking to create mp4 files by combining multiple static mp4s and mp3s.
I have a script already to convert mp3 to mp4 and using the album art as a static background image, and inserting the intro.
What I am having problems with is that it cannot concatenate the videos reliably, or at all for that matter.


This is the code that I currently have, it is ChatGPT, however I gave up as it seemed like it was just running in circles.


setlocal

:: Set variables
set "mp3file=myfile.mp3"
set "coverart=extracted_cover.jpg"
set "outputfile=music.mp4"
set "introfile=intro.mp4"
set "outputendfile=Outro.mp4"
set "wowfile=Wow!.mp4"

:: Step 1: Extract cover art from MP3
ffmpeg -i "%mp3file%" -an -vcodec copy "%coverart%"
if %errorlevel% neq 0 (
 echo Error: Failed to extract cover art from MP3 file.
 exit /b 1
)

:: Step 2: Convert MP3 to MP4 using the extracted cover art
ffmpeg -loop 1 -i "%coverart%" -i "%mp3file%" -c:v libx264 -tune stillimage -c:a aac -b:a 192k -shortest "%outputfile%"
if %errorlevel% neq 0 (
 echo Error: Conversion from MP3 to MP4 failed.
 exit /b 1
)

:: Step 3: Randomly generate two positions for Wow!.mp4 insertions
:: Random positions will be between 10 and 50 seconds
set /a "pos1=%random% %% 40 + 10"
set /a "pos2=%random% %% 40 + 10"

:: Ensure pos1 and pos2 are different
if %pos1% EQU %pos2% (
 set /a "pos2=%pos1%+10"
)

:: Print positions for debugging
echo Random insertion positions:
echo Position 1: %pos1%
echo Position 2: %pos2%

:: Step 4: Split the music mp4 into parts at the random positions
:: Part 1: From the beginning to pos1
ffmpeg -i "%outputfile%" -c copy -ss 0 -to %pos1% -y "part1.mp4"
if not exist "part1.mp4" (
 echo Error: Failed to create part1.mp4
 exit /b 1
)

:: Part 2: From pos1 to pos2
ffmpeg -i "%outputfile%" -c copy -ss %pos1% -to %pos2% -y "part2.mp4"
if not exist "part2.mp4" (
 echo Error: Failed to create part2.mp4
 exit /b 1
)

:: Part 3: From pos2 to the end
ffmpeg -i "%outputfile%" -c copy -ss %pos2% -y "part3.mp4"
if not exist "part3.mp4" (
 echo Error: Failed to create part3.mp4
 exit /b 1
)

:: Step 5: Concatenate the files in the required order
(
 echo file 'intro.mp4'
 echo file 'part1.mp4'
 echo file 'Wow!.mp4'
 echo file 'part2.mp4'
 echo file 'Wow!.mp4'
 echo file 'part3.mp4'
 echo file 'Outro.mp4'
) > concat_list.txt

ffmpeg -f concat -safe 0 -i concat_list.txt -c copy final_output.mp4
if %errorlevel% neq 0 (
 echo Error: Failed to concatenate the video files.
 exit /b 1
)

:: Cleanup
del part1.mp4 part2.mp4 part3.mp4 concat_list.txt "%coverart%"

echo Done! The final video is saved as final_output.mp4



exactly what it is supposed to do :


- 

- Convert "myfile.mp3" to "music.mp4" with image (works)
- Add "intro.mp4" to the start of "music.mp4" and "Output.mp4" to the end (works)
- Split "music.mp4" into 3 parts, randomly, at a minimum 10s after intro.mp4 and 10s before Outro.mp4 (can for some reason only create part 1)
- Put all clips in order (unknown, probably works but part 2 and 3 wont generate so it cannot get to that step.)










Edit :
I forgot to add the error message that I am getting. Here it is :


[out#0 @ 000002e024a6ed00] -to value smaller than -ss; aborting.
Error opening output file part2.mp4.
Error opening output files: Invalid argument
Error: Failed to create part2.mp4



-
FFMpeg command to merge 1 video and 2 audio files while also reducing volume of one audio
26 septembre 2022, par UserMI need to construct a FFMpeg using amix or any equivalent command to merge 1 video and 2 audio files while also reducing volume of one background music file (ukulele.mp3).
Refer : https://ffmpeg.org/ffmpeg-filters.html#Examples-11


//cmd works with out volume reduction of background music file
anima_buf = ("C:/ffmpeg/bin/ffmpeg -thread_queue_size 8192 -safe 0 -f concat -i %s -t %s -safe 0 -f concat -i %s -i ./music/ukulele.mp3\
-filter_complex amix=inputs=2:duration=shortest -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p -y %s" % ( anima_img_file, anima_len, anima_audio_file, anima_opvideo_file))
os.system(anima_buf)
//successful

//cmd to reduce volume of background music
 anima_buf = ("C:/ffmpeg/bin/ffmpeg -thread_queue_size 8192 -safe 0 -f concat -i %s -t %s -safe 0 -f concat -i %s -i ./music/ukulele.mp3\
 -filter_complex amix=inputs=2:duration=shortest:dropout_transition=0:weights="1 0.25":normalize=0 -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p -y %s" % ( anima_img_file, anima_len, anima_audio_file, anima_opvideo_file) )
os.system(anima_buf)
 
SyntaxError: invalid syntax mentioned at weights="1 0.25"



FFmpeg version :


ffmpeg version 2022-05-23-git-6076dbcb55-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.3.0 (Rev1, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx 
--enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame 
--enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 57. 25.100 / 57. 25.100
libavcodec 59. 28.100 / 59. 28.100
libavformat 59. 24.100 / 59. 24.100
libavdevice 59. 6.100 / 59. 6.100
libavfilter 8. 38.100 / 8. 38.100
libswscale 6. 6.100 / 6. 6.100
libswresample 4. 6.100 / 4. 6.100
libpostproc 56. 5.100 / 56. 5.100



Can someone guide me, thanks in advance