Recherche avancée

Médias (91)

Autres articles (75)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (9151)

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

  • avutil/x86/pixelutils : Empty MMX state in ff_pixelutils_sad_8x8_mmxext

    1er novembre 2023, par Andreas Rheinhardt
    avutil/x86/pixelutils : Empty MMX state in ff_pixelutils_sad_8x8_mmxext
    

    We currently mostly do not empty the MMX state in our MMX
    DSP functions ; instead we only do so before code that might
    be using x87 code. This is a violation of the System V i386 ABI
    (and maybe of other ABIs, too) :
    "The CPU shall be in x87 mode upon entry to a function. Therefore,
    every function that uses the MMX registers is required to issue an
    emms or femms instruction after using MMX registers, before returning
    or calling another function." (See 2.2.1 in [1])
    This patch does not intend to change all these functions to abide
    by the ABI ; it only does so for ff_pixelutils_sad_8x8_mmxext, as this
    function can by called by external users, because it is exported
    via the pixelutils API. Without this, the following fragment will
    assert (on x86/x64) :
    uint8_t src1[8 * 8], src2[8 * 8] ;
    av_pixelutils_sad_fn fn = av_pixelutils_get_sad_fn(3, 3, 0, NULL) ;
    fn(src1, 8, src2, 8) ;
    av_assert0_fpu() ;

    [1] : https://raw.githubusercontent.com/wiki/hjl-tools/x86-psABI/intel386-psABI-1.1.pdf

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

    • [DH] libavutil/x86/pixelutils.asm
  • From Python, piping images to FFMPEG process with audio input, "-shortest" flag causes output file to contain only 1 frame of video and entire audio

    7 novembre 2023, par b_yang

    From Python, I run FFMPEG and write images to its stdin via pipe, the FFMPEG process has an audio file as input too. Everything works fine like this :

    &#xA;

    cmd = [&#x27;ffmpeg&#x27;, &#x27;-hide_banner&#x27;, &#x27;-y&#x27;, &#x27;-loglevel&#x27;, &#x27;error&#x27;, &#x27;-f&#x27;, &#x27;rawvideo&#x27;, &#xA;&#x27;-pix_fmt&#x27;, &#x27;bgr24&#x27;, &#x27;-video_size&#x27;, &#x27;720x1280&#x27;, &#x27;-r&#x27;, &#x27;30.0&#x27;, &#x27;-an&#x27;, &#x27;-i&#x27;, &#x27;-&#x27;,&#xA;&#x27;-i&#x27;, &#x27;audio.aac&#x27;, &#x27;-acodec&#x27;, &#x27;copy&#x27;, &#xA;&#x27;-crf&#x27;, &#x27;14&#x27;, &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;, &#x27;output.mp4&#x27;]&#xA;proc = subprocess.Popen(cmd, **popen_params)&#xA;

    &#xA;

    Because the audio duration might be longer than the video duration, I added a '-shortest' flag (before '-crf') :

    &#xA;

    cmd = [&#x27;ffmpeg&#x27;, &#x27;-hide_banner&#x27;, &#x27;-y&#x27;, &#x27;-loglevel&#x27;, &#x27;error&#x27;, &#x27;-f&#x27;, &#x27;rawvideo&#x27;, &#xA;&#x27;-pix_fmt&#x27;, &#x27;bgr24&#x27;, &#x27;-video_size&#x27;, &#x27;720x1280&#x27;, &#x27;-r&#x27;, &#x27;30.0&#x27;, &#x27;-an&#x27;, &#x27;-i&#x27;, &#x27;-&#x27;,&#xA;&#x27;-i&#x27;, &#x27;audio.aac&#x27;, &#x27;-acodec&#x27;, &#x27;copy&#x27;, &#xA;&#x27;-shortest&#x27;, &#x27;-crf&#x27;, &#x27;14&#x27;, &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;, &#x27;output.mp4&#x27;]&#xA;proc = subprocess.Popen(cmd, **popen_params)&#xA;

    &#xA;

    However, with the '-shortest' flag, the resulting output.mp4 contains the entire audio, but only 1 frame of video data. What is going on here ?

    &#xA;