Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (52)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Submit enhancements and plugins

    13 avril 2011

    If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
    You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone.

Sur d’autres sites (8703)

  • Moviepy/FFMPEG error while writing file : Permission denied

    26 février 2024, par rodinaxcvi

    I am using Power Automate to try to run this powershell script "python3 %Directory%%FileName%" :

    


    What my code is supposed to do :

    


      

    1. Download a video from youtube
    2. 


    3. Put small clips from a folder in bottom left
    4. 


    5. Overwrite audio from downloaded Youtube video with new audio from a folder in the same directory (I am replacing the video's audio with an .mp3 of someone narrating something)
    6. 


    


    ERROR CODE :

    


    OSError: \[Errno 32\] Broken pipe

MoviePy error: FFMPEG encountered the following error while writing file combined_video_1TEMP_MPY_wvf_snd.mp3:

b'combined_video_1TEMP_MPY_wvf_snd.mp3: Permission denied\\r\\n'


    


    Code Snippet that seems to be throwing up error (NOT FULL CODE) :

    


    # Combine ad clips with main video footage
def combine_videos(main_video_path, ad_video_paths, output_path, bottom_videos_folder, custom_audio_path):
    main_clip = VideoFileClip(main_video_path).subclip(0, 60)  # Keep the original aspect ratio

    main_clip = main_clip.resize(width=1920)  # Resize based on width
    if main_clip.size[1] > 1080:
        main_clip = main_clip.resize(height=1080)  # Resize based on height if it's still too tall

    main_clip_x = (1920 - main_clip.size[0]) / 2
    main_clip_y = (1080 - main_clip.size[1]) / 2
    main_clip = main_clip.set_position((main_clip_x, main_clip_y))

    ad_clip = concatenate_to_duration(ad_video_paths, 60, bottom_videos_folder)  # Assuming 60 seconds for the ad clip
    ad_clip = ad_clip.resize(width=250)  # Resize the ad clip
    ad_clip = ad_clip.set_position(("left", "bottom"))  # Position the ad clip at the bottom right

    custom_audio = AudioFileClip(custom_audio_path)

    # Specify the output directory for the audio file
    output_audio_directory = "C:/Temp/AIContentCreator"
    output_audio_path = os.path.join(output_audio_directory, "custom_audio.mp3")

    # Write the custom audio to the specified directory
    custom_audio.write_audiofile(output_audio_path)

    main_clip = main_clip.set_audio(custom_audio)

    final_clip = CompositeVideoClip([main_clip, ad_clip], size=(1920, 1080))
    final_clip.write_videofile(output_path, fps=30)

    main_clip.close()
    ad_clip.close()
    custom_audio.close()

## SAVE PATHS ##
# Video Folder Paths
save_path = r"C:\Temp\Videos\YoutubeVideo"
bottom_videos_folder = r"C:\Temp\Videos\BottomVideo"
custom_audio_path = r"C:\Temp\AIContentCreator\GPTContentCreation\output.mp3"  # Existing audio file path

# Download videos from a playlist
playlist_url1 = ''
videos_playlist1 = download_playlist(playlist_url1, save_path)

# Prepare bottom videos
bottom_videos = list_videos_in_folder(bottom_videos_folder)

# Combine each pair of videos and export 
combined_video_counter = 1  
for main_video in videos_playlist1:
    shuffled_ads = random.sample(bottom_videos, len(bottom_videos))
    ad_video_paths = [os.path.join(bottom_videos_folder, ad) for ad in shuffled_ads[:5]]  # Adjust number as needed

    combined_video_path = r'C:\Temp\Videos\TiktokVideos\combined_video_{combined_video_counter}.mp4'
    
    # Call the combine_videos function with the existing custom_audio_path
    combine_videos(main_video, ad_video_paths, combined_video_path, bottom_videos_folder, custom_audio_path)
    
    combined_video_counter += 1
`


    


    What I've tried :

    


      

    • Setting all related folders to full access
    • 


    • Setting full directory paths in my code
    • 


    • Running Power Automate and CMD as administrator
    • 


    • Moving files to a different folder like /Temp to see if permission error still consists
    • 


    


    Reoccurring problems :

    


      

    • I am not sure where MoviePy is writing "b'combined_video_1TEMP_MPY_wvf_snd.mp3". Could it be trying to place that file in another directory with out proper permissions ?

      


    • 


    • Whenever I try to de-select read-only on TiktokVideos folder and refresh it, "Read-only" is still on. Keeps doing this.

      


    • 


    


  • aaccoder : rewrite PNS implementation

    6 septembre 2015, par Rostislav Pehlivanov
    aaccoder : rewrite PNS implementation
    

    This commit rewrites the PNS implementation and significantly
    improves sonic quality.

    The previous implementation marked an incredibly big amount
    of SFBs to predict when there was no need for this and this
    resulted in quite a large amount of artifacts. Also the
    quantization was incorrect (av_clip(4+log2f(...))) which
    led to 3x the intensity for PNS values leading to even more
    artifacts.

    This commit rewrites the PNS search function and introduces
    a major change : the PNS values are synthesized and are compared
    to the current coefficients in addition to passing through
    the revised checks to see whether PNS can be used.

    This decreases distortions and makes the current PNS implementation
    mainly focused on replacing any low-power non-zero bands as well
    as adding any zeroed bands back.

    The current encoder’s performance is enough (especially with
    IS) so PNS isn’t really required except to fill in the occasional
    few bands as well as extend any zeroed high frequency, so this
    combination which is already enabled by default works
    to get as much quality as it can within the bits allowed.

    Signed-off-by : Rostislav Pehlivanov <atomnuker@gmail.com>

    • [DH] libavcodec/aaccoder.c
  • Ruby - Threads and Dir[] arrays

    17 mars 2016, par Lewis909

    I have built a ruby script that creates folders, moves a file into that new folder and then invokes a system() call to trigger FFMPEG. I have now turned this into 4 threads so that I can do 4 concurrent transcodes at a time.

    Here is an example with 2 threads (minus folder structure creation and file move functions) :

    def transcode_process_1

    Dir["path/file/source/*.mxf"].each do |f|

      random_folder = #code for random folder creation

      file_move = #code to move .mxf file to random_folder for processing

      system("FFMPEG -i #{random_folder} command 2> /path/file/#{random_filename}.txt")

      sleep(2)

    end
    end

    def transcode_process_2

    sleep(3)

    Dir["path/file/source/*.mxf"].each do |f|

      random_folder = #code for random folder creation

      file_move = #code to move .mxf file to random_folder for processing

      system("FFMPEG -i #{random_folder} command 2> /path/file/#{random_filename}.txt")

      sleep(4)

    end
    end

    transcode_thread_1 = Thread.new{transcode_process_1()}
    transcode_thread_2 = Thread.new{transcode_process_2()}

    transcode_thread_1.join
    transcode_thread_2.join

    This iterates through the Dir "path/file/source/" and processes any.mxf files it finds. The issue I am having is that when both threads are running they are adding the same files into the array. This results in FFMPEG stating it cannot locate the file (this is because another thread has processed it and moved it to the temp folder) and creating superfluous folders and log files, basically just making it messy.

    My question is how would I go about making sure transcode_thread_2 does not process files that transcode_thread_1 has added to it array ? Is there a way I can get the function to check that the file in the array is still exists ? If it does then carry out the process, if not move on to the next file ?

    Thanks