Recherche avancée

Médias (91)

Autres articles (79)

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

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

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

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

  • 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 (11638)

  • Why is audio bitrate value of ffprobe output higher ?

    9 mars 2023, par 19xlr95

    When I check audio bitrate of my video via OS file details, media players or ffprobe -i my_video.mp4, I get the bitrate is 128 kbps. And I want to get more detailed meta information of the video by ffprobe -loglevel 0 -print_format json -show_format -show_streams my_video.mp4. However audio bitrate value of the output is 128615 bps.

    


    I thought it should be 128000 not 128615. Or 128 x 1024 = 131072. I wonder why it is not one of the values that I assumed. Also how can I safely say that this 128615 bps is 128 kbps ?

    


    Below is the detailed meta information for my video.

    


    {
    "streams": [
        {
            "index": 0,
            "codec_name": "aac",
            "codec_long_name": "AAC (Advanced Audio Coding)",
            "profile": "LC",
            "codec_type": "audio",
            "codec_tag_string": "mp4a",
            "codec_tag": "0x6134706d",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "initial_padding": 0,
            "id": "0x1",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/48000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 965760,
            "duration": "20.120000",
            "bit_rate": "128615",
            "nb_frames": "946",
            "extradata_size": 2,
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0
            },
            "tags": {
                "creation_time": "2023-02-20T09:00:58.000000Z",
                "language": "deu",
                "handler_name": "Core Media Audio",
                "vendor_id": "[0][0][0][0]"
            }
        },
        {
            "index": 1,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
            "codec_tag_string": "avc1",
            "codec_tag": "0x31637661",
            "width": 1080,
            "height": 1920,
            "coded_width": 1080,
            "coded_height": 1920,
            "closed_captions": 0,
            "film_grain": 0,
            "has_b_frames": 0,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "9:16",
            "pix_fmt": "yuv420p",
            "level": 42,
            "color_range": "tv",
            "color_space": "bt709",
            "color_transfer": "bt709",
            "color_primaries": "bt709",
            "chroma_location": "left",
            "field_order": "progressive",
            "refs": 1,
            "is_avc": "true",
            "nal_length_size": "4",
            "id": "0x2",
            "r_frame_rate": "50/1",
            "avg_frame_rate": "50/1",
            "time_base": "1/50000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 1006000,
            "duration": "20.120000",
            "bit_rate": "20958903",
            "bits_per_raw_sample": "8",
            "nb_frames": "1006",
            "extradata_size": 35,
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0
            },
            "tags": {
                "creation_time": "2023-02-20T09:00:58.000000Z",
                "language": "und",
                "handler_name": "Core Media Video",
                "vendor_id": "[0][0][0][0]"
            }
        }
    ],
    "format": {
        "filename": "my_video.mp4",
        "nb_streams": 2,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.000000",
        "duration": "20.120000",
        "size": "53309460",
        "bit_rate": "21196604",
        "probe_score": 100,
        "tags": {
            "major_brand": "mp42",
            "minor_version": "1",
            "compatible_brands": "isommp41mp42",
            "creation_time": "2023-02-20T09:00:58.000000Z"
        }
    }
}


    


    I checked 1 kbps is 1000 bps and assumed 128 kbps of the audio bitrate should be 128000 bps. But it is 128615 bps when I run ffprobe.

    


  • 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

    


    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&#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;

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

    &#xA;

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

    &#xA;

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

    &#xA;

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

    &#xA;

    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 :

    &#xA;

      &#xA;
    1. Reinstalling discord, pynacl, even pytube and moviepy.
    2. &#xA;

    3. Using a local copy of ffmpeg on replit, see line 36.
    4. &#xA;

    5. Adding the intents that were described in a different thread.
    6. &#xA;

    &#xA;

    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 ?

    &#xA;