
Recherche avancée
Autres articles (59)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (7130)
-
avcodec/mpeg12dec : Don't initialize unused parts of ScanTable
24 février, par Andreas Rheinhardt -
Revision 33331 : simplifier les petitions : le tableau des signatures utilise les classe ...
27 novembre 2009, par cedric@… — Logsimplifier les petitions : le tableau des signatures utilise les classe generiques table.spip et autre qui lui permet d’etre par defaut dans le theme. Les class specifiques sur chaque element restent utilisables pour affiner si (...)
-
How to automate ffmpeg to split and merge parts of video, and keep the audio in sync ?
9 décembre 2024, par TreeI have a Python script that automates trimming a large video (2 hours) into smaller segments and then concatenating them without re-encoding, to keep the process fast. The script runs these ffmpeg commands :


import subprocess

# Extract chunks
segments = [(0, 300), (300, 600), (600, 900)] # example segments in seconds
for i, (start, length) in enumerate(segments):
 subprocess.run([
 "ffmpeg", "-i", "input.mp4", "-ss", str(start), "-t", str(length),
 "-c", "copy", "-reset_timestamps", "1", "-y", f"chunk_{i}.mp4"
 ], check=True)

# Create concat list
with open("list.txt", "w") as f:
 for i in range(len(segments)):
 f.write(f"file 'chunk_{i}.mp4'\n")

# Concatenate
subprocess.run([
 "ffmpeg", "-f", "concat", "-safe", "0",
 "-i", "list.txt", "-c", "copy", "-y", "merged_output.mp4"
], check=True)



All chunks come from the same source video, with identical codecs, resolution, and bitrate. Despite this, the final merged_output.mp4 sometimes has audio out of sync—especially after the first chunk.


I’ve tried using -ss before -i to cut on keyframes, but the issue persists.


Question : How can I ensure correct A/V sync in the final concatenated video when programmatically segmenting and merging via ffmpeg without fully re-encoding ? Is there a way to adjust the ffmpeg commands or process to avoid audio desynchronization ?