
Recherche avancée
Autres articles (98)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...) -
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.
Sur d’autres sites (10854)
-
Video is cut after adding 2 watermarks with FFMPEG-KIT [closed]
7 août 2023, par dfjickI made a FFMPEG-KIT command to add 2 PNG watermarks to the video and everything went smoothly.


String ffmpegCommand = "-y -i " + videoPath +
 " -i " + watermarkImagePath +
 " -i " + userID +
 " -filter_complex " +
 "\"[0:v][1:v]overlay=x='if(lt(mod(t,10),5),10,W-w-10)':y='if(lt(mod(t,10),5),10,H-h-35)',\"" +
 "\"overlay=x='if(lt(mod(t,10),5),7,W-w-7)':y='if(lt(mod(t,10),5),165,H-h-15)'[out]\"" +
 " -map [out] -map 0:a -c:v libx264 -crf 18 -preset slow -c:a aac " + outputPath;



But for videos that are longer than 20 seconds, the results don't match the original video, sometimes the videos are only <20 seconds and at random times.


I get this error, how do I fix it ?


W/ffmpeg-kit: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb400007c5c1243f0] Packet corrupt (stream = 1, dts = 366976)
W/ffmpeg-kit: [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb400007c5c1243f0] .
E/ffmpeg-kit: [NULL @ 0xb400007c6c179400] Invalid NAL unit size (63547 > 20190).
E/ffmpeg-kit: [NULL @ 0xb400007c6c179400] missing picture in access unit with size 20194
W/ffmpeg-kit: /storage/emulated/0/DCIM/android_100394_20230807_162805_5465009.mp4: corrupt input packet in stream 1
E/ffmpeg-kit: [h264 @ 0xb400007c6c210750] Invalid NAL unit size (63547 > 20190).
E/ffmpeg-kit: [h264 @ 0xb400007c6c210750] Error splitting the input into NAL units.
E/ffmpeg-kit: Error while decoding stream #0:1: Invalid data found when processing input



I've tried to use this
-fflags +discardcorrupt
, but the result is still the same. The duration of the video that has been watermarked does not match the original video.

-
Evolution #3179 : Pouvoir désactiver l’héritage de logo entre les rubriques (via une constante)
13 mars 2014, par b bÇa me semble être une bonne idée, sans ça on est obligé de fourber à coup de :
[(#LOGO_RUBRIQUE|matchrubon#ID_RUBRIQUE\.|oui)[(#LOGO_RUBRIQUE|image_reduire150,150)]]
Reste à voir si le nom de la constante convient à tout le monde et hop commit :)
-
audio issues when merging a video with an audio file using python ffmpeg and moviepy
29 février 2024, par Stevenb123I’m trying to create a code that syncs between an audio file and a background file in terms of duration.
When creating the merged video I hear a cut or a loop sound of the last sentence for like 0.2 seconds.
I have tried to solve it in many different ways, listed below.


Has anyone solved this issue ? I saw many people having a similar problem.
I’m using Ubuntu version 20.04 and ffmpeg version 4.2.7


This is my code :


def merge_videos_with_subs(
 background_path, audio_path, subs, output_directory, output_filename
):
 try:
 # Load background video and audio
 background_clip = VideoFileClip(background_path)
 background_clip = background_clip.without_audio()
 audio_clip = AudioFileClip(audio_path)

 # Adjust video duration to match audio duration
 audio_duration = audio_clip.duration

 # If the background video is longer, trim it to match the audio duration
 if background_clip.duration > audio_duration:
 background_clip = background_clip.subclip(0, audio_duration)
 # If the audio is longer, loop the background video
 else:
 background_clip = background_clip.loop(duration=audio_duration)

 # Set audio of the background clip
 background_clip = background_clip.set_audio(audio_clip)

 # Overlay subtitles on the video
 final_clip = CompositeVideoClip(
 [background_clip, subtitles.set_pos(("center", "bottom"))]
 )

 # Ensure the output directory exists
 os.makedirs(output_directory, exist_ok=True)

 # Define the output path
 output_path = os.path.join(output_directory, output_filename)

 # Write the merged video with subtitles
 final_clip.write_videofile(
 output_path, codec="libx264", audio_codec="aac", threads=4, fps=24
 )

 # Close the clips
 final_clip.close()
 background_clip.close()
 audio_clip.close()

 print(f"Merged video with subtitles saved to: {output_path}")
 except Exception as e:
 print(f"Error merging videos: {e}")



I’ve tried changing the codec, tried cutting 0.2 seconds of the audio before and after the merge or silencing it, nothing seems to help.

When I run my code without the background subclip to match the audio it worked flawlessy.
If I let the background run until its full duration or make it loop there were no audio issues.

Looks like the issue is on the cutting part.