Recherche avancée

Médias (10)

Mot : - Tags -/wav

Autres articles (30)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (5628)

  • How to stop ffmpeg after it has finished python

    24 août 2017, par Joey B

    I have a function that finds an mp4 video in a temp folder, converts it to an mp3 in a seperate folder, called music, and then deletes the mp4 from the temp folder. It looks like such :

    import imageio
    imageio.plugins.ffmpeg.download()
    import moviepy.editor as mp

    def convert_mp4_to_mp3():
       video_file = os.listdir(os.getcwd() + '//temp')[0]
       audio_file = video_file.replace('mp4','mp3')
       clip = mp.VideoFileClip(os.getcwd() + '//temp//' + video_file)
       clip.audio.write_audiofile(os.getcwd() + '//music//' + audio_file)
       os.system("taskkill /f /im ffmpeg.win32.exe*32")
       os.remove(os.getcwd() + '//temp//' + video_file)

    The function successfully completes the conversion of mp4 to mp3 but when I try and delete the file, I get the following error :

    PermissionError: [WinError 32] The process cannot access the file because it
    is being used by another process

    Upon trying to manually delete the file, I discovered it was because "ffmpeg.win32.exe" is still running with the file open. I could not manually delete it until I killed that process.

    I tried implementing the second to last line (os.system("taskkill /f /im ffmpeg.win32.exe*32") to kill the process but I still come up with the same error.

    So my question is, is there a simple way to kill ffmpeg once I know I am done with it or is there a workaround to somehow kill it via another process ? I am working in python3.6 on a windows 7 pc. Thanks in advance for the help !

  • Discord.py, ffmpeg and pytube to play audio, but it keeps stopping early. Why ? [closed]

    15 septembre 2023, par LowEloTV

    I 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 lfgan

    I 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 :

    


      

    1. Convert "myfile.mp3" to "music.mp4" with image (works)
    2. 


    3. Add "intro.mp4" to the start of "music.mp4" and "Output.mp4" to the end (works)
    4. 


    5. 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)
    6. 


    7. Put all clips in order (unknown, probably works but part 2 and 3 wont generate so it cannot get to that step.)
    8. 


    


    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