Recherche avancée

Médias (91)

Autres articles (56)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP 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 (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP 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 (...)

Sur d’autres sites (10450)

  • Why is the ffmpeg process in discordpy terminating without playing anything ?

    18 janvier 2024, par Bummbumm6

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

    


      

    1. Reinstalling discord, pynacl, even pytube and moviepy.
    2. 


    3. Using a local copy of ffmpeg on replit, see line 36.
    4. 


    5. Adding the intents that were described in a different thread.
    6. 


    


    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 ?

    


  • Parse dynamic mpd file with Media Source Extensions

    17 février 2023, par FrankC

    I 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

    


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

    &#xA;

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

    &#xA;

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

    &#xA;

    THANKS A LOT

    &#xA;

  • FileNotFoundError when extracting audio from recently saved video using FFMPEG"

    3 août 2023, par Peter Long

    Scenario : I'm using this tool to record tiktok live. I write another script to call the main.pytool because I want to add some additional options, for example, to extract the audio of the live video that is recorded

    &#xA;

    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

    &#xA;

    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

    &#xA;

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

    &#xA;

    I try with this

    &#xA;

    import os&#xA;import subprocess&#xA;import time&#xA;from moviepy.editor import VideoFileClip&#xA;&#xA;def main():&#xA;    # Command to run main.py and record the video&#xA;    cmd = &#x27;python main.py -user ryzebenny -output "C:\\Users\\Administrator\\Desktop\\tiktok" -ffmpeg -duration 30 --auto-convert&#x27;&#xA;    subprocess.run(cmd, shell=True)&#xA;&#xA;    # Wait for the video file to appear in the folder&#xA;    wait_for_video("C:\\Users\\Administrator\\Desktop\\tiktok")&#xA;&#xA;    # Extract audio from recorded video&#xA;    video_filename = find_latest_file("C:\\Users\\Administrator\\Desktop\\tiktok", ".mp4")&#xA;    if video_filename:&#xA;        video_path = os.path.join("C:\\Users\\Administrator\\Desktop\\tiktok", video_filename)&#xA;        audio_filename = video_filename.replace(".mp4", ".mp3")&#xA;        audio_path = os.path.join("C:\\Users\\Administrator\\Desktop\\tiktok", audio_filename)&#xA;&#xA;        video_clip = VideoFileClip(video_path)&#xA;        audio_clip = video_clip.audio&#xA;        audio_clip.write_audiofile(audio_path)&#xA;        audio_clip.close()&#xA;        video_clip.close()&#xA;        print(f"Audio extraction completed: {audio_filename}")&#xA;    else:&#xA;        print("No video files found.")&#xA;&#xA;def wait_for_video(directory):&#xA;    max_wait_time = 60  # Maximum time to wait in seconds&#xA;    start_time = time.time()&#xA;    while time.time() - start_time &lt; max_wait_time:&#xA;        if find_latest_file(directory, ".mp4"):&#xA;            break&#xA;        time.sleep(1)&#xA;&#xA;def find_latest_file(directory, extension):&#xA;    list_of_files = [f for f in os.listdir(directory) if f.endswith(extension) and os.path.isfile(os.path.join(directory, f))]&#xA;    if list_of_files:&#xA;        return max(list_of_files, key=os.path.getctime)&#xA;    return None&#xA;&#xA;if __name__ == "__main__":&#xA;    main()&#xA;

    &#xA;

    but i get this error

    &#xA;

    [*] 2023-08-03 15:57:09 - INFO - START RECORDING FOR 30 SECONDS&#xA;[*] 2023-08-03 15:57:09 - INFO - [PRESS &#x27;q&#x27; TO STOP RECORDING]&#xA;[*] 2023-08-03 15:57:31 - INFO - FINISH: C:\Users\Administrator\Desktop\tiktok\TK_ryzebenny_2023.08.03_15-57-09_flv.mp4&#xA;&#xA;Traceback (most recent call last):&#xA;  File "C:\Users\Administrator\Desktop\tiktok\TikTok-Live-Recorder\run_main.py", line 45, in <module>&#xA;    main()&#xA;  File "C:\Users\Administrator\Desktop\tiktok\TikTok-Live-Recorder\run_main.py", line 12, in main&#xA;    wait_for_video("C:\\Users\\Administrator\\Desktop\\tiktok")&#xA;  File "C:\Users\Administrator\Desktop\tiktok\TikTok-Live-Recorder\run_main.py", line 34, in wait_for_video&#xA;    if find_latest_file(directory, ".mp4"):&#xA;       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "C:\Users\Administrator\Desktop\tiktok\TikTok-Live-Recorder\run_main.py", line 41, in find_latest_file&#xA;    return max(list_of_files, key=os.path.getctime)&#xA;           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "<frozen genericpath="genericpath">", line 65, in getctime&#xA;FileNotFoundError: [WinError 2] The system cannot find the file specified: &#x27;TK_ryzebenny_2023.08.03_15-57-09.mp4&#x27;&#xA;</frozen></module>

    &#xA;

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

    &#xA;