
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (103)
-
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 -
Que fait exactement ce script ?
18 janvier 2011, parCe script est écrit en bash. Il est donc facilement utilisable sur n’importe quel serveur.
Il n’est compatible qu’avec une liste de distributions précises (voir Liste des distributions compatibles).
Installation de dépendances de MediaSPIP
Son rôle principal est d’installer l’ensemble des dépendances logicielles nécessaires coté serveur à savoir :
Les outils de base pour pouvoir installer le reste des dépendances Les outils de développements : build-essential (via APT depuis les dépôts officiels) ; (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (13953)
-
Handling multiple line subtitles of Right aligned languages(arabic) in Moviepy
24 décembre 2023, par Stanger DangerI am trying to add Arabic subtitles on a video using Moviepy. The issue I'm facing is related to alignment of Arabic text, as it progresses from right to left, instead of left to right in English language.




As text length gets more and more, Moviepy trims the words from both ends, this issue can be resolved if we break the text into multiple lines. This works well for English language but for Arabic, the first line becomes the last line because of the (Right-Left)alignment.




The text on Second line should come first on the first line at the start, while end chuck of first text towards the left corner should render on the second line, but it is getting rendered as English language, Left to right alignment.


Here is my code :


def add_subtitles(address_subtitles, address_video):
 video = VideoFileClip(address_video)
 generator = lambda txt: TextClip(txt, font='Arial', fontsize=22, color='black', stroke_width=2, method='caption', align='south', size=video.size)
 subtitles = SubtitlesClip(address_subtitles, generator)
 #print()

 result = CompositeVideoClip([video, subtitles.set_pos(('center','bottom'))])
 result.write_videofile("arabic_with_hardcoded_subtitles_3.mp4", fps=video.fps, temp_audiofile="temp-audio.m4a", remove_temp=True, codec="libx264"
 , audio_codec="aac")



-
How to embed subtitles in multiple movies in an automated way using python ?
8 juin 2023, par Ricardo MadelaThis python script identifies all movies with mp4 extension and, if they have subtitles in srt format, converts the subtitle encoding to utf-8 (without this conversion you will get error message) and starts building the movie with the subtitle embedded.


for filename in glob.glob("*.mp4"):
 print(str(filename))
 if 'wsubs' not in filename:
 for legenda in glob.glob(filename.replace(".mp4",".srt")):
 try:
 with open(legenda, 'r') as arquivo_orig:
 conteudo = arquivo_orig.read()
 with open(legenda, 'w', encoding='utf-8') as novo_arquivo:
 novo_arquivo.write(conteudo)
 except Exception as e:
 print("Já codificado")
 print(str(legenda))
 os.system('ffmpeg -i "' + str(filename) + '" -vf subtitles="' + str(legenda) + '" -maxrate 2000000 -crf 20 "' + str(filename.replace('.mp4','-wsubs.mp4')) + '"')



The end result will be a subtitled movie with the expression "wsubs" at the end of the name. The original files will be preserved.


-
Subtitles but no continuous playback, or playback with no subtitles
27 janvier 2024, par KCpremoI am using this command as part of generating a live HLS stream that ingests a separate HLS stream consisting of 4 second .ts files, translates the feed in 30 second chunks, and spits out the video with translations (in 30 second ts files). However, I have hit a roadblock.


If I use the '-copyts' flag, the livestream plays back just fine in hls.js player, but WITHOUT the subtitles burned in or included as an accessible separate track. If I remove '-copyts', the playback stops at the end of the first segment and won't progress further, but the subtitles ARE present. The subtitles are pivotal to my whole project, so I really can't do without them.


I've also tried several other methods like re-encoding the original files before processing them, creating a transparent video with the subtitles and overlaying it, using VLC, and some other workarounds, but it all seems to boil down to either subtitles with improper playback, or proper playback without subtitles.


Do you have any suggestions ?


command = [
 'ffmpeg',
 '-y',
 '-i', f'concat:{concat_string}', # Input using concat protocol
 '-vf', f"subtitles='{translation_vtt}':force_style='FontName=Arial,FontSize=24,PrimaryColour=&H00FFFFFF,Outline=1,OutlineColour=&H00000000,BackColour=&H80000000,BorderStyle=3',scale=854:480",
 '-c:v', 'libx264', # H264 video codec
 '-c:a', 'aac', # AAC audio codec
 '-b:a', '128k', # Audio bitrate
 #'-c:s', 'mov_text',
 #'-metadata:s:s:0', 'language=eng',
 '-copyts',
 '-preset', 'fast',
 output_video # Output file
 ]