Recherche avancée

Médias (91)

Autres articles (76)

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

  • Handling "NullReferenceException" when executing "ffmpeg.exe" process in C# [duplicate]

    1er juillet 2023, par FrostDream

    I'm trying to execute the "ffmpeg.exe" process in my C# application to process media files. However, I'm encountering a "NullReferenceException" when running the code. I've tried various approaches, including using a try-catch block, but the exception still persists. Here's the relevant code snippet :

    


    bool isValidMedia = true;

try
{
    Process process = new Process();
    process.StartInfo.FileName = "ffmpeg.exe";
    process.StartInfo.Arguments = $"-i \"{file}\" -f null -";
    process.StartInfo.UseShellExecute = false;
    process.StartInfo.RedirectStandardOutput = true;
    process.StartInfo.CreateNoWindow = true;
    process.OutputDataReceived += (sender, e) =>
    {
        if (!string.IsNullOrEmpty(e.Data))
        {
            int startIndex = e.Data.IndexOf("samples=") + 8;
            button.Width = int.Parse(e.Data.Substring(startIndex, e.Data.IndexOf(" ") - startIndex)) / zoom * 100;
        }
        else
        {
            isValidMedia = false;
        }
    };

    process.Start();
    process.BeginOutputReadLine();
    process.WaitForExit();
}
catch
{
    isValidMedia = false;
}

if (!isValidMedia)
{
    MessageBox.Show("Not a valid media.");
    return;
}



    


    I suspect that the issue may be related to the asynchronous execution of the event handler or the initialization of the ProcessStartInfo object. Can anyone please help me identify the cause of the "NullReferenceException" and provide guidance on how to resolve it ? Thank you in advance for your assistance.

    


  • avcodec/cbs : Add specialization for ff_cbs_(read|write)_unsigned()

    1er juillet 2022, par Andreas Rheinhardt
    avcodec/cbs : Add specialization for ff_cbs_(read|write)_unsigned()
    

    These functions allow not only to read and write unsigned values,
    but also to check ranges and to emit trace output which can be
    beautified when processing arrays (indices like "[i]" are replaced
    by their actual numbers).

    Yet lots of callers actually only need something simpler :
    Their range is only implicitly restricted by the amount
    of bits used and they are not part of arrays, hence don't
    need this beautification.

    This commit adds specializations for these callers ;
    this is very beneficial size-wise (it reduced the size
    of .text by 23312 bytes here), as a call is now cheaper.

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

    • [DH] libavcodec/cbs.c
    • [DH] libavcodec/cbs_av1.c
    • [DH] libavcodec/cbs_h2645.c
    • [DH] libavcodec/cbs_internal.h
    • [DH] libavcodec/cbs_mpeg2.c
    • [DH] libavcodec/cbs_vp9.c
  • 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;