
Recherche avancée
Médias (1)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (64)
-
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...) -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)
Sur d’autres sites (15424)
-
openCV save frames from RTSP non blocking
1er janvier 2020, par Jacob nighForI am building an app that records frames from IP camera through RTSP.
My engine is in charge to save a video in mp4 with Opencv VideoWriter working well.
What I am looking for is to create a startRecord and a stopRecord class method that will respectively start and stop recording according to a trigger (it could be an argument that I pass to the thread).
Is anyone know what the best way to do that kind of stuff ?Here is my class :
from threading import Thread
import cv2
import time
import multiprocessing
import threading
class RTSPVideoWriterObject(object):
def __init__(self, src=0):
# Create a VideoCapture object
self.capture = cv2.VideoCapture(src)
# Start the thread to read frames from the video stream
self.thread = Thread(target=self.update, args=())
self.thread.daemon = True
self.thread.start()
def update(self):
# Read the next frame from the stream in a different thread
while True:
if self.capture.isOpened():
(self.status, self.frame) = self.capture.read()
def endRecord(self):
self.capture.release()
self.output_video.release()
exit(1)
def startRecord(self,endRec):
self.frame_width = int(self.capture.get(3))
self.frame_height = int(self.capture.get(4))
self.codec = cv2.VideoWriter_fourcc(*'mp4v')
self.output_video = cv2.VideoWriter('fileOutput.mp4', self.codec, 30, (self.frame_width, self.frame_height))
while True:
try:
self.output_video.write(self.frame)
if endRec:
self.endRecord()
except AttributeError:
pass
if __name__ == '__main__':
rtsp_stream_link = 'rtsp://foo:192.5545....'
video_stream_widget = RTSPVideoWriterObject(rtsp_stream_link)
stop_threads = False
t1 = threading.Thread(target = video_stream_widget.startRecord, args =[stop_threads])
t1.start()
time.sleep(15)
stop_threads = TrueAs you can see in the main I reading frames and store them in a separate thread. Then I am starting to record (record method is with an infinite loop so blocking) and then after 15 sec, I am trying to pass a ’stop_record’ argument to stop recording properly.
A part of the code comes from Storing RTSP stream as video file with OpenCV VideoWriter
Is someone have an idea ?
I read a lot that OpenCV can be very tricky for multithreadingN.
-
Revision 223bf29307 : libyuv : update to r1305 MIPS build fixes https://code.google.com/p/webm/issues
3 mars 2015, par JohannChanged Paths :
Modify /third_party/libyuv/README.libvpx
Modify /third_party/libyuv/include/libyuv/compare.h
Modify /third_party/libyuv/include/libyuv/convert.h
Modify /third_party/libyuv/include/libyuv/convert_argb.h
Modify /third_party/libyuv/include/libyuv/convert_from.h
Modify /third_party/libyuv/include/libyuv/convert_from_argb.h
Delete /third_party/libyuv/include/libyuv/format_conversion.h
Modify /third_party/libyuv/include/libyuv/row.h
Modify /third_party/libyuv/include/libyuv/scale.h
Modify /third_party/libyuv/include/libyuv/scale_row.h
Modify /third_party/libyuv/include/libyuv/version.h
Modify /third_party/libyuv/include/libyuv/video_common.h
Modify /third_party/libyuv/source/compare.cc
Modify /third_party/libyuv/source/compare_neon.cc
Add /third_party/libyuv/source/compare_neon64.cc
Modify /third_party/libyuv/source/compare_posix.cc
Modify /third_party/libyuv/source/compare_win.cc
Modify /third_party/libyuv/source/convert.cc
Modify /third_party/libyuv/source/convert_argb.cc
Modify /third_party/libyuv/source/convert_from.cc
Modify /third_party/libyuv/source/convert_from_argb.cc
Modify /third_party/libyuv/source/convert_to_argb.cc
Modify /third_party/libyuv/source/convert_to_i420.cc
Modify /third_party/libyuv/source/cpu_id.cc
Delete /third_party/libyuv/source/format_conversion.cc
Modify /third_party/libyuv/source/mjpeg_validate.cc
Modify /third_party/libyuv/source/planar_functions.cc
Modify /third_party/libyuv/source/rotate.cc
Modify /third_party/libyuv/source/rotate_argb.cc
Modify /third_party/libyuv/source/rotate_neon.cc
Add /third_party/libyuv/source/rotate_neon64.cc
Modify /third_party/libyuv/source/row_any.cc
Modify /third_party/libyuv/source/row_common.cc
Modify /third_party/libyuv/source/row_mips.cc
Modify /third_party/libyuv/source/row_neon.cc
Modify /third_party/libyuv/source/row_neon64.cc
Modify /third_party/libyuv/source/row_posix.cc
Modify /third_party/libyuv/source/row_win.cc
Modify /third_party/libyuv/source/scale.cc
Modify /third_party/libyuv/source/scale_argb.cc
Modify /third_party/libyuv/source/scale_common.cc
Modify /third_party/libyuv/source/scale_neon.cc
Modify /third_party/libyuv/source/scale_neon64.cc
Modify /third_party/libyuv/source/scale_posix.cc
Modify /third_party/libyuv/source/scale_win.cc
Modify /third_party/libyuv/source/video_common.cc
libyuv : update to r1305MIPS build fixes
https://code.google.com/p/webm/issues/detail?id=957
Change-Id : I9d53900af36d783c369b5dff27a7479cb94fd16b
-
Why are rectangular boxes ([]) showing instead of text in burned subtitles when using ffmpeg/MoviePy on Google Colab ?
14 mai, par LavishI'm working on a Python script that adds subtitles to a video using MoviePy and burns/hardcodes them directly onto the video. The subtitles contain Hindi text, and I’ve specified a custom font that supports Devanagari (Hindi) script.


The code works perfectly fine on my local machine, the subtitles appear correctly with Hindi characters. However, when I run the same code on Google Colab, the subtitles display as rectangular boxes (something like this -> [][][]) instead of proper characters.


Things I've tried :


- 

- Ensured the font used supports Hindi (I'm using NotoSansDevanagari-Regular.ttf renamed as font.ttf).
- Uploaded the font to Colab and specified the full path correctly.
- Verified that the text is passed as a proper Unicode string.








Here's the code snippet :


def add_subtitles(video_path, subtitles_path, output_path):
 """Adds subtitles using FFmpeg with proper path escaping."""
 # Convert to absolute paths and normalize
 
 video_path = os.path.abspath(video_path)
 subtitles_path = os.path.abspath(subtitles_path)
 output_path = os.path.abspath(output_path)


 # Subtitle path
 font_path = "input_files/font.ttf"
 font_path = os.path.abspath(font_path).replace("\\", "\\\\")
 subtitles_path_escaped = os.path.abspath(subtitles_path).replace("\\", "\\\\")
 
 # Escape backslashes in paths
 subtitles_path = subtitles_path.replace("\\", "\\\\")
 # Remove all files in final_videos
 [os.remove(os.path.join(base_dir, "final_videos", f)) for f in os.listdir(os.path.join(base_dir, "final_videos")) if os.path.isfile(os.path.join(base_dir, "final_videos", f))]

 os.makedirs(os.path.dirname(output_path), exist_ok=True)
 escaped_path = subtitles_path.replace(':', '\\:').replace('\\', '\\\\')

 cmd = [
 "ffmpeg",
 "-i", video_path,
 "-vf", f"subtitles={escaped_path}:force_style='FontFile={font_path}'",
 "-c:v", "libx264",
 "-c:a", "copy",
 "-preset", "fast",
 "-crf", "22",
 output_path
]


 # Debug: Print the exact command being executed
 print("Executing:", " ".join(cmd))
 try:
 subprocess.run(cmd, check=True, capture_output=True, text=True)
 print(f"✅ Success! Output saved to: {output_path}")
 except subprocess.CalledProcessError as e:
 print(f"❌ FFmpeg failed with error:\n{e.stderr}")




What could be causing this issue on Colab, and how can I get non-English subtitles (like Hindi) to render properly when burning subtitles using MoviePy/ffmpeg in a Colab environment ?