
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 (53)
-
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
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 (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (7064)
-
FileNotFoundError when extracting audio from recently saved video using FFMPEG"
3 août 2023, par Peter LongScenario : I'm using this tool to record tiktok live. I write another script to call the
main.py
tool because I want to add some additional options, for example, to extract the audio of the live video that is recorded

FFMPEG is used to extract the audio. First the video is saved (with FFMPEG) and after I want to extract the audio of that video (again with FFMPEG). The path where the video is recorded and saved is
C:\Users\Administrator\Desktop\tiktok


The problem is that I see the file and it is saved, but this error is generated as output :
FileNotFoundError: [WinError 2] The system cannot find the file specified


I can't figure out why it doesn't detect the last saved video file in general


I try with this


import os
import subprocess
import time
from moviepy.editor import VideoFileClip

def main():
 # Command to run main.py and record the video
 cmd = 'python main.py -user ryzebenny -output "C:\\Users\\Administrator\\Desktop\\tiktok" -ffmpeg -duration 30 --auto-convert'
 subprocess.run(cmd, shell=True)

 # Wait for the video file to appear in the folder
 wait_for_video("C:\\Users\\Administrator\\Desktop\\tiktok")

 # Extract audio from recorded video
 video_filename = find_latest_file("C:\\Users\\Administrator\\Desktop\\tiktok", ".mp4")
 if video_filename:
 video_path = os.path.join("C:\\Users\\Administrator\\Desktop\\tiktok", video_filename)
 audio_filename = video_filename.replace(".mp4", ".mp3")
 audio_path = os.path.join("C:\\Users\\Administrator\\Desktop\\tiktok", audio_filename)

 video_clip = VideoFileClip(video_path)
 audio_clip = video_clip.audio
 audio_clip.write_audiofile(audio_path)
 audio_clip.close()
 video_clip.close()
 print(f"Audio extraction completed: {audio_filename}")
 else:
 print("No video files found.")

def wait_for_video(directory):
 max_wait_time = 60 # Maximum time to wait in seconds
 start_time = time.time()
 while time.time() - start_time < max_wait_time:
 if find_latest_file(directory, ".mp4"):
 break
 time.sleep(1)

def find_latest_file(directory, extension):
 list_of_files = [f for f in os.listdir(directory) if f.endswith(extension) and os.path.isfile(os.path.join(directory, f))]
 if list_of_files:
 return max(list_of_files, key=os.path.getctime)
 return None

if __name__ == "__main__":
 main()



but i get this error


[*] 2023-08-03 15:57:09 - INFO - START RECORDING FOR 30 SECONDS
[*] 2023-08-03 15:57:09 - INFO - [PRESS 'q' TO STOP RECORDING]
[*] 2023-08-03 15:57:31 - INFO - FINISH: C:\Users\Administrator\Desktop\tiktok\TK_ryzebenny_2023.08.03_15-57-09_flv.mp4

Traceback (most recent call last):
 File "C:\Users\Administrator\Desktop\tiktok\TikTok-Live-Recorder\run_main.py", line 45, in <module>
 main()
 File "C:\Users\Administrator\Desktop\tiktok\TikTok-Live-Recorder\run_main.py", line 12, in main
 wait_for_video("C:\\Users\\Administrator\\Desktop\\tiktok")
 File "C:\Users\Administrator\Desktop\tiktok\TikTok-Live-Recorder\run_main.py", line 34, in wait_for_video
 if find_latest_file(directory, ".mp4"):
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\Administrator\Desktop\tiktok\TikTok-Live-Recorder\run_main.py", line 41, in find_latest_file
 return max(list_of_files, key=os.path.getctime)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "<frozen genericpath="genericpath">", line 65, in getctime
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'TK_ryzebenny_2023.08.03_15-57-09.mp4'
</frozen></module>


Instead, I expect that once I save the video (in .mp4) the audio of that video will be extracted afterwards


-
Parse dynamic mpd file with Media Source Extensions
17 février 2023, par FrankCI just started learning about adaptive streaming, and currently I'm working on a project that needs showing a live video. In order to control some of the elements in mpd file, I determined to use MSE instead of dash.js. I refer to the code at the following URL :https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/samples/dn551368(v=vs.85)
But I found out that there is no "Initialization" tag or "range" attribute in my mpd file. I don't find any relative attribute as well. By the way I'm use nginx-rtmp + ffmpeg to generate dash file.
So here is my dash file looks like


<?xml version="1.0"?>
 
 <period start="PT0S">
 
 
 
 <segmenttimeline>
 <s t="0" d="10000"></s>
 <s t="10000" d="10000"></s>
 <s t="20000" d="5000"></s>
 <s t="25000" d="10000"></s>
 </segmenttimeline>
 
 
 
 </period>




My question is :
1.Did I have any missing parameters in using ffmpeg or nginx-rtmp resulting in losting tag in mpd file ?
2.Or there is other way to setup "Initialization"/"range" attribute and let my program work ?
3.I also curious about why my mpd file doesn't have a baseURL element ?


※My mpd file works fine with dash.js, I can see the video properly


THANKS A LOT


-
Why is the ffmpeg process in discordpy terminating without playing anything ?
18 janvier 2024, par Bummbumm6I'm making a discord bot for playing music (ik very unoriginal) and everytime I try to play music, it gives this error :


2023-02-18 12:31:54 INFO discord.player ffmpeg process 4024 has not terminated. Waiting to terminate...
2023-02-18 12:31:54 INFO discord.player ffmpeg process 4024 should have terminated with a return code of -9.



It is in the voice chat and didn't play anything. Here's my code if you need it :


print("defining functions")
import discord, pytube, os, threading
from moviepy import editor
from discord.ext.commands import Bot
intents=discord.Intents.default()
intents.message_content = True
intents.voice_states = True
bot = Bot("b!",intents=intents)
check = False
token = "redacted"
@bot.command()
async def play(ctx, arg):
 await ctx.send("Downloading...")
 try:
 yt = pytube.YouTube(arg)
 print("STREAM: "+str(yt.streams.filter(only_audio=True,mime_type="audio/webm",type="audio",abr="160kbps")))
 def download(yt):
 print("DOWNLOADING STREAM TO AUDIO.WEBM")
 yt.streams.filter(only_audio=True,mime_type="audio/webm",type="audio",abr="160kbps").order_by("abr").first().download(filename="audio.webm")
 print("EXPORTING TO MP3")
 editor.AudioFileClip("audio.webm").write_audiofile("audio.webm"[:-5] + ".mp3")
 os.remove("audio.webm")
 print("DONE")
 thread = threading.Thread(target=download, args=(yt,))
 thread.start()
 thread.join()
 try:
 channel = ctx.author.voice.channel
 try:
 vc = await channel.connect()
 except Exception:
 ctx.send("already in vc, one sec")
 except Exception:
 pass
 vc.play(discord.FFmpegPCMAudio(source="audio.mp3", executable="./ffmpeg"))
 except Exception:
 pass
bot.run(token)




It worked on my computer in VS Code, but I wanted to test it on Replit and only there I got the error. I tried :


- 

- Reinstalling discord, pynacl, even pytube and moviepy.
- Using a local copy of ffmpeg on replit, see line 36.
- Adding the intents that were described in a different thread.








One thing that always happens is the exit code being -9 but the process number changing (ofc). I saw a GitHub Issue about this too which is not showing a fix so how do I fix that ?