
Recherche avancée
Autres articles (51)
-
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 (...) -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (6810)
-
Writing frames from camera using skvideo.io.FFmpegWriter
28 juin 2018, par Liam DeaconI’m trying to finely control the video encoding of camera image frames captured on the fly using
skvideo.io.FFmpegWriter
andcv2.VideoCapture
, e.g.from skvideo import io
import cv2
fps = 60
stream = cv2.VideoCapture(0) # 0 is for /dev/video0
print("fps: {}".format(stream.set(cv2.CAP_PROP_FPS, fps)))
stream.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
stream.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)
print("bit_depth: {}".format(stream.set(cv2.CAP_PROP_FORMAT, cv2.CV_8U)))
video = io.FFmpegWriter('/tmp/test_ffmpeg.avi',
inputdict={'-r': fps, '-width': 1920, '-height': 1080},
outputdict={'-r': fps, '-vcodec': 'libx264', '-pix_fmt': 'h264'}
)
try:
for i in range(fps*10): # 10s of video
ret, frame = stream.read()
video.writeFrame(frame)
finally:
stream.release()
try:
video.close()
except:
passHowever, I get the following exception (in Jupyter notebook) :
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in <module>()
18 while range(fps*10):
19 ret, frame = stream.read()
---> 20 video.writeFrame(frame)
21 except BaseException as err:
22 raise err
/usr/local/lib/python3.6/site-packages/skvideo/io/ffmpeg.py in writeFrame(self, im)
446 T, M, N, C = vid.shape
447 if not self.warmStarted:
--> 448 self._warmStart(M, N, C)
449
450 # Ensure that ndarray image is in uint8
/usr/local/lib/python3.6/site-packages/skvideo/io/ffmpeg.py in _warmStart(self, M, N, C)
412 cmd = [_FFMPEG_PATH + "/" + _FFMPEG_APPLICATION, "-y"] + iargs + ["-i", "-"] + oargs + [self._filename]
413
--> 414 self._cmd = " ".join(cmd)
415
416 # Launch process
TypeError: sequence item 3: expected str instance, int found
</module>Changing this to
video.writeFrame(frame.tostring())
results inValueError: Improper data input
, leaving me stumped.How should I go about writing each frame (as returned by OpenCV) to my FFmpegWriter instance ?
EDIT
The code works fine if I remove
inputdict
andoutputdict
from theio.FFmpegWriter
call, however this defeats the purpose for me as I need fine control over the video encoding (I am experimenting with lossless/near-lossless compression of the raw video captured from the camera and trying to establish the best compromise in terms of compression vs fidelity for my needs). -
Convert .heic to .jpg using ffmpeg ?
19 novembre 2018, par Ketan ChauhanUsing MP4Box :
MP4Box -info IMG_5915.HEIC
I get :
prof colour profile not supported
prof colour profile not supported
Root Meta type : "pict" - 52 resource item(s)
Primary Item - ID 49
Item #1 - ID 1 - Name :
..
.
Item #49 - ID 49 - Name :
Item #50 - ID 50 - Name : Item #51 - ID 51 - Name :
File has no movie (moov) - static data container
Then if I extract all of these :
for i in
seq 51
; do MP4Box -dump-item $i:path=item$i.hevc
IMG_5915.HEIC ; doneThen if i continue, and convert these tiles to jpeg with ffmpeg it convert one tile to jpeg i.e it creates 51 HEVC tiles.
ffmpeg -i item1.hevc -frames:v 1 -vsync vfr -q:v 1 -an image1.jpg
How can I combine these tiles into a single jpg file ?
-
How to encode HEVC tile in JPEG ?
3 juillet 2018, par Ketan ChauhanI am trying to convert HEIF file into a JPEG file, I extract HEIC images tiles using MP4Box but when convert these tiles into JPEG using FFMPEG I get this :
SAKATA-INX:desktop stellar$ MP4Box -dump-item 1:path=item1.hevc
still_rear.HEICICC colour profile not supported ICC colour profile not supported
SAKATA-INX:desktop stellar$ ffmpeg -i item1.hevc -frames:v 1 -vsync
vfr -q:v 1 -an test.jpgffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers built
with Apple LLVM version 9.1.0 (clang-902.0.39.1)configuration : —prefix=/usr/local/Cellar/ffmpeg/4.0 —enable-shared
—enable-pthreads —enable-version3 —enable-hardcoded-tables —enable-avresample —cc=clang —host-cflags= —host-ldflags= —enable-gpl —enable-libmp3lame —enable-libx264 —enable-libx265 —enable-libxvid —enable-opencl —enable-videotoolbox —disable-lzmalibavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
[hevc @ 0x7fc56e808e00] Format hevc detected only with low score of 1,
misdetection possible ![hevc @ 0x7fc56f800000] No start code is found.
[hevc @ 0x7fc56f800000] missing picture in access unit
[AVBSFContext @ 0x7fc56e505e00] No start code is found.
item1.hevc : could not find codec parameters
Input #0, hevc, from ’item1.hevc’ :
Duration : N/A, bitrate : N/A
Stream #0:0: Video: hevc, none, 1200k tbn
Output #0, image2, to ’test.jpg’ :
Output file #0 does not contain any stream
Could any one tell me how I can do this ?