
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (97)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
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 (8794)
-
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.
-
Alfresco fails to create video thumbnail
17 octobre 2019, par DeckardAs error log says :
Empty input file ...
It turned out that the source image forImageMagick
is zero sized. (/data/was/alfresco/tomcat/temp/Alfresco/ImageMagickContentTransformerWorker_source_8718262212685093199.jpg
). When I manually replace the source image to normal image and execute the command again, there’s no error.command: /data/was/alfresco/common/bin/convert /data/was/alfresco/tomcat/temp/Alfresco/ImageMagickContentTransformerWorker_source_8718262212685093199.jpg[0] -auto-orient -resize "100x100>" -strip -quiet /data/was/alfresco/tomcat/temp/Alfresco/ImageMagickContentTransformerWorker_target_7652060684136589026.png
So I think the source image is maybe made by
FFMPEG
by capturing some frame of the video.
And theFFMPEG
somehow failed to do it. Not sure my guess is right...But my
FFMPEG
works good asffmpeg -version
shows proper version info. AndFFMPEG
is run byroot
and the Alfresco daemon instance is run byroot
. It seems that there’s nothing wrong.Please review it. Here’s the whole Alfresco-share log :
Caused by: org.alfresco.service.cmr.repository.ContentIOException: 09160037 Content conversion failed:
reader: ContentAccessor[ contentUrl=store:///data/was/alfresco/tomcat/temp/Alfresco/ComplextTransformer_intermediate_mp4_262176879279399174.jpg, mimetype=image/jpeg, size=0, encoding=UTF-8, locale=en_US]
writer: ContentAccessor[ contentUrl=store:///data/was/alfresco/tomcat/temp/Alfresco/FailoverTransformer_intermediate_ComplexContentTransformer_5223852355212570043.png, mimetype=image/png, size=0, encoding=UTF-8, locale=en_US]
options: {use=doclib, contentReaderNodeRef=null, contentWriterNodeRef=null, sourceContentProperty=null, imageAutoOrient=true, targetContentProperty=null, commandOptions=, imageResizeOptions=ImageResizeOptions [width=100, height=100, maintainAspectRatio=true, percentResize=false, resizeToThumbnail=false, allowEnlargement=false], includeEmbedded=null}
limits: {timeoutMs=120000, pageLimit=1}
at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:350)
at org.alfresco.repo.content.transform.ComplexContentTransformer.transformInternal(ComplexContentTransformer.java:492)
at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:272)
... 32 more
Caused by: org.alfresco.service.cmr.repository.ContentIOException: 09160036 Failed to perform ImageMagick transformation:
Execution result:
os: Linux
command: /data/was/alfresco/common/bin/convert /data/was/alfresco/tomcat/temp/Alfresco/ImageMagickContentTransformerWorker_source_8718262212685093199.jpg[0] -auto-orient -resize "100x100>" -strip -quiet /data/was/alfresco/tomcat/temp/Alfresco/ImageMagickContentTransformerWorker_target_7652060684136589026.png
succeeded: false
exit code: 1
out:
err: .convert.bin: Empty input file `/data/was/alfresco/tomcat/temp/Alfresco/ImageMagickContentTransformerWorker_source_8718262212685093199.jpg' @ error/jpeg.c/JPEGErrorHandler/331.
.convert.bin: NoImageForProperty "%w" @ warning/property
at org.alfresco.repo.content.transform.magick.ImageMagickContentTransformerWorker.transformInternal(ImageMagickContentTransformerWorker.java:205)
at org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformerWorker.transform(AbstractImageMagickContentTransformerWorker.java:284)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:79)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy28.transform(Unknown Source)
at org.alfresco.repo.content.transform.ProxyContentTransformer.transformInternal(ProxyContentTransformer.java:107)
at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:272)
... 34 moreIn alfresco-global.properties :
ffmpeg.exe=/usr/local/bin/ffmpeg/ffmpeg
* Update As Robert suggested, TransFormer log level changed to debug.
But the log is too long to paste here. There’s 30,000 characters limit of body in SO which github doesn’t have.
So please refer to github issue, I pasted the log there.
https://github.com/Alfresco/share/issues/127 -
avformat_open_input crash using ffmpeg on android
2 octobre 2019, par Timmy KI am writing an Android app to capture audio streams from a USB device using ffmpeg, and mux them into an m4a file. I then open the recording file to read back the audio data. The app works fine on Samsung S8 (Android 8.0) and S9 (Android 9.0). On a Moto G5+ (Android 8.1), however the app crashes inside avformat_open_input() when I try to open the recording file ; but if I restart the app and it reads the same file with the same code, it works without crashing.
I thought maybe that I hadn’t closed the recording file properly ; or there was maybe a race condition : trying to read the file before it was written. However I have established that av_write_trailer() is called successfully and avio_closep() is called successfully before the call to avformat_open_input. I also established that the length of the file is the same just before the call to avformat_open_input() in the crash case as it is in the non-crash case.
The code that finishes the recording :
// AVFormatContext *mAvFormatContext
// ...
int ret = av_write_trailer(mAvFormatContext);
if ( ret != 0 )
{
__android_log_print(ANDROID_LOG_DEBUG, "MyTag", "failed to write trailer %s", av_err2str( ret ) );
goto fail;
}
ret = avio_close( mAvFormatContext->pb );
if ( ret < 0 )
{
__android_log_print(ANDROID_LOG_DEBUG, "MyTag", "failed to avio_close %s", av_err2str( ret ) );
goto fail;
}
avformat_free_context(mAvFormatContext);The call that causes a crash immediately after the above code, on a Moto 5G+ (but not Samsung S8/S9) :
mAvFormatContext = nullptr;
if ( (ret = avformat_open_input( &mAvFormatContext, filePath, 0, 0)) < 0 )
{
__android_log_print(ANDROID_LOG_DEBUG, "MyTag++", "Could not open input file '%s' error %s ", filePath, av_err2str(ret) );
cleanup();
return false;
}Also, when the call to avformat_open_input() does not crash, there is no output in logcat from within that call. However, I’ve noticed that in the crash case there is output of what seems to be corrupted data :
2019-09-02 09:39:14.105 19999-19999/fm.x.y D/AudioEngine: Opening '@�7���-d��@�7�' for
2019-09-02 09:39:14.106 19999-19999/fm.x.y D/AudioEngine: Setting default whitelist '<��'
2019-09-02 09:39:14.106 19999-19999/fm.x.y D/AudioEngine: Probing ���d score:-1828887548 size:-1093138844
2019-09-02 09:39:14.106 19999-19999/fm.x.y D/AudioEngine: Format ��� probed with size=-1093138756 and score=-1093138748
(crash occurs)Any advice on what to look into further to investigate this problem ? Is there something I am missing when cleaning up the muxing state before I try to open the recording file for demuxing ? For simplicity I have not included the freeing of codec contexts, AVFrames and AVPackets.