
Recherche avancée
Autres articles (105)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar 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 ;
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs
Sur d’autres sites (11017)
-
Transcode to ogg or webm, writing the file as it goes
22 juillet 2020, par Mark SmithI need to transcode files (
mp3
,flac
,m4a
and others) toogg
orwebm
. (This is because I need them to play on Firefox 60.9 which does not support most of these, andflac
s are too large. I cannot update the browser.)

ffmpeg
can do the transcoding, but when transcoding toogg
orwebm
, depending on the exact configuration, either 0 bytes or a few kB is written immediately, and then nothing more until the transcoding is complete (even using-flush_packets 1
) — hence I cannot start playing the audio.

By comparison, if I transcode to
mp3
, the file is written progressively and I can start playing immediately.

Is it possible to transcode to
ogg
orwebm
in such a way that the file is written as the transcoding happens, and I can start playing it (almost) immediately ?

Configurations I have tried :


ffmpeg -i orig.m4a -c:a libvorbis -flush_packets 1 vorbis.ogg
ffmpeg -i orig.m4a -c:a libopus -flush_packets 1 opus.ogg
ffmpeg -i orig.m4a -c:a libvorbis -flush_packets 1 vorbis.webm
ffmpeg -i orig.m4a -c:a libopus -flush_packets 1 opus.webm



This is running on Debian (Raspian stretch, specifically) and I would like to do it without adding dependencies from outside of the Debian/Raspian archives, if possible. Sticking with
ffmpeg
would be my ideal choice but will consider others.

-
Moviepy/FFMPEG error while writing file : Permission denied
26 février 2024, par rodinaxcviI am using Power Automate to try to run this powershell script "python3 %Directory%%FileName%" :


What my code is supposed to do :


- 

- Download a video from youtube
- Put small clips from a folder in bottom left
- 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)








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.








-
ffmpeg in "streaming mode" suddenly stops writing output file and resumes after several minutes
29 juin 2018, par EliAI’m using ffmpeg to convert chunks of media in webm format to a wav file in a "continuous stream" mode.
Using a python wrapper, I’m feeding ffmpeg a webm chunk (let’s say 1 chunk each second) and ffmpeg continuously writes the output wav (then, in a separate thread I’m reading this wav file and pass the new data forward).
This works well most of the time, but some times, I get this weird behavior :
- after some chunks are processed and output to the wav file, ffmpeg stops writing to the output file (the file stops growing but ffmpeg keeps getting the webm chunks)
- this can go on like this for several minutes, and then ffmpeg resumes writing to the wav file
- eventually, the complete wav file is written successfully, but this causes huge delays in the streaming process.
Looking at CPU and memory usage, this doesn’t seem to be the issue.
Any ideas as to what could cause ffmpeg to stop streaming for several minutes and then resume ?
This can happen after 30 seconds, after 3 minutes or after an hour of streaming media chunks and the time it takes ffmpeg to resume also varies.In my python code, I’m basically opening a
subprocess.Popen()
process and write to the process’stdin
to feed ffmpeg the media chunks.So my code looks something like :
ffmpeg_proc = subprocess.Popen('ffmpeg -y -f webm -i - -ac 1 -ar 16000 -f wav /tmp/out.wav', shell=True, stdin=subprocess.PIPE)
for chunk in chunks:
ffmpeg_proc.stdin.write(chunk)I’m using
python 3.6
andffmpeg version 2.8.14-0ubuntu0.16.04.1
Thanks in advance !