
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (45)
-
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 (...) -
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...)
Sur d’autres sites (4975)
-
syncing a video file with audio using ffmpeg is returning a video without audio
31 juillet 2019, par abboodWhen I attempt to sync a .mov video with an .m4a audio file using ffmpeg like so
ffmpeg -ss 00:00:2 -i test.m4a -i test.mov -c:v copy -c:a aac -strict experimental output.mp4
it works like a charm. But right now I’ve recorded a usability test video using adobe XD, and it returned an .mp4 (MPEG-4) video and I manually recorded the audio using quicktimre returning a .m4a audio file.
Trying to merge them using ffmpeg is returning a video without any audio :
ffmpeg -i video.mp4 -i audio.m4a -c:v copy -c:a aac -strict experimental output.mp4
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1_1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gpl --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-opencl --enable-videotoolbox
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2019-07-31T14:43:18.000000Z
com.apple.quicktime.make: Apple
com.apple.quicktime.model: MacBookPro15,1
com.apple.quicktime.software: Mac OS X 10.14.5 (18F203)
com.apple.quicktime.creationdate: 2019-07-31T17:43:17+0300
Duration: 00:03:46.05, start: 0.000000, bitrate: 498 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 374x812 [SAR 1:1 DAR 187:406], 390 kb/s, 60 fps, 60 tbr, 6k tbn, 12k tbc (default)
Metadata:
creation_time : 2019-07-31T14:43:18.000000Z
handler_name : Core Media Video
encoder : H.264
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, stereo, fltp, 0 kb/s (default)
Metadata:
creation_time : 2019-07-31T14:43:18.000000Z
handler_name : Core Media Audio
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'audio.m4a':
Metadata:
major_brand : M4A
minor_version : 0
compatible_brands: M4A mp42isom
creation_time : 2019-07-31T14:47:26.000000Z
iTunSMPB : 00000000 00000840 00000000 00000000009DFBC0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Duration: 00:03:54.78, start: 0.047891, bitrate: 225 kb/s
Stream #1:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 224 kb/s (default)
Metadata:
creation_time : 2019-07-31T14:47:26.000000Z
handler_name : Core Media Audio
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[aac @ 0x7fb5a4806a00] Too many bits 16384.000000 > 12288 per frame requested, clamping to max
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
com.apple.quicktime.creationdate: 2019-07-31T17:43:17+0300
com.apple.quicktime.make: Apple
com.apple.quicktime.model: MacBookPro15,1
com.apple.quicktime.software: Mac OS X 10.14.5 (18F203)
encoder : Lavf58.20.100
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 374x812 [SAR 1:1 DAR 187:406], q=2-31, 390 kb/s, 60 fps, 60 tbr, 12k tbn, 6k tbc (default)
Metadata:
creation_time : 2019-07-31T14:43:18.000000Z
handler_name : Core Media Video
encoder : H.264
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, stereo, fltp, 96 kb/s (default)
Metadata:
creation_time : 2019-07-31T14:43:18.000000Z
handler_name : Core Media Audio
encoder : Lavc58.35.100 aac
frame=13563 fps=0.0 q=-1.0 Lsize= 10903kB time=00:03:46.08 bitrate= 395.1kbits/s speed= 916x
video:10699kB audio:10kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.805767%How can I get around this limitation ?
-
Having trouble obtaining the time from RTP Timestamps obtained through OpenCV
24 août 2019, par Fr0styI am finding it a bit difficult trying to understand whether or not the hack around with FFmpeg and OpenCV really provided a RTP timestamp. My last post helped a little bit but got me stuck in trying to validate the timestamps obtained through this work around by modifying ffmpeg and opencv.
FFmpeg version : 4.1.0
OpenCV version : 3.4.1import cv2
import time
from datetime import datetime, date
uri = 'rtsp://admin:password@192.168.1.66:554/Streaming/Channels/101'
cap = cv2.VideoCapture(uri)
'''One is the offset between the two epochs. Unix uses an epoch located at 1/1/1970-00:00h (UTC) and NTP uses 1/1/1900-00:00h.
This leads to an offset equivalent to 70 years in seconds (there are 17 leap years between the two dates so the offset is'''
time_offset = 2208988800 # (70*365 + 17)*86400 = 2208988800 (in seconds)
# offset = 3775484294
days = 43697
pdat = "1900-01-01 00:00:00:00"
mdat = "2019-08-23 22:02:44:00" # str(datetime.now()) + str(datetime.now().time())
pdate = datetime.strptime(pdat, "%Y-%m-%d %H:%M:%S:%f").date()
mdate = datetime.strptime(mdat, "%Y-%m-%d %H:%M:%S:%f").date()
delta = (mdate - pdate).days
offset = delta * 86400
def time_delta(s):
return (s - time_offset)
while True:
frame_exists, curr_frame = cap.read()
if frame_exists:
seconds = cap.getRTPTimeStampSeconds()
fraction = cap.getRTPTimeStampFraction()
timestamp = cap.getRTPTimeStampTs()
unix_offset = seconds - time_offset
msec = int((int(fraction) / 0xFFFFFFFF) * 1000.0)
ts = float(str(unix_offset) + "." + str(msec))
# print("Timestamp per Frame:%i" % timestamp)
print((datetime.fromtimestamp(float(ts) + offset)))
cap.release()My Output :
On August 23, 2019 at 22:02
...
2019-08-23 13:59:52.781000
2019-08-23 13:59:52.726000
2019-08-23 13:59:52.671000
2019-08-23 13:59:52.616000
2019-08-23 13:59:52.561000
2019-08-23 13:59:52.506000
2019-08-23 13:59:52.451000
2019-08-23 13:59:52.396000
2019-08-23 13:59:52.342000
2019-08-23 13:59:52.287000
2019-08-23 13:59:52.232000
2019-08-23 13:59:52.177000
2019-08-23 13:59:52.122000
2019-08-23 13:59:52.067000
2019-08-23 13:59:52.012000
2019-08-23 13:59:53.570000
2019-08-23 13:59:53.020000
2019-08-23 13:59:53.847000
2019-08-23 13:59:53.792000I’ve noticed how the time increments weirdly (that’s not suppose to happen in the real, current time), such as the last two lines and a few others in between in the output. A bit flabbergasted as to what went wrong. Also trying this out on multiple IP cameras, with each showing a different timestamp probably related to when they were turned on.
-
FFMPEG Incredibly Slow On Windows Server 2016
1er août 2019, par Ben GardnerI have a t2.small (2GB RAM, 1 vCPU) Amazon EC2 instance running a process using FFMPEG. It runs just fine ( 30 fps) on my computer (i7, 12GB RAM), but at around 2 fps on the server. Here’s the command :
rescale_command = f'ffmpeg -i {srcVideo} -filter_complex \"scale={owidth}:{oheight}, setsar=1:1, pad={dim[0]}:{dim[1]}:{oofx}:{oofy}\" {destVideo}'
I’ve tried uninstalling and reinstalling ffmpeg/ffprobe
Edited per llogan’s request, I’ve also discovered that it’s relatively speedy towards the beginning (I’m rescaling 100 times over the course of the program) and slows down towards the end.
It utilizes 100% of the CPU even from the beginning, though.
Example command/output :
ffmpeg -i media/8-1-2019/hi/dl-107.mp4 -filter_complex "scale=607:1080, setsar=1:1, pad=1920:1080:656:0" media/8-1-2019/hi/sl-107.mp4
ffmpeg version 3.2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.100 / 57. 64.100
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'media/8-1-2019/hi/dl-107.mp4':
Metadata:
minor_version : 512
major_brand : isom
compatible_brands: isomiso2avc1mp41
comment : vid:v09044ce0000bks3802jqrog167l3rf0
encoder : Lavf58.20.100
Duration: 00:00:15.12, start: 0.000000, bitrate: 1046 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 540x960 [SAR 1:1 DAR 9:16], 972 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s (default)
Metadata:
handler_name : SoundHandler
[Parsed_setsar_1 @ 00000000023ac840] num:den syntax is deprecated, please use num/den or named options instead
[Parsed_setsar_1 @ 00000000023ad2c0] num:den syntax is deprecated, please use num/den or named options instead
[libx264 @ 00000000023ad800] using SAR=1/1
[libx264 @ 00000000023ad800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 00000000023ad800] profile High, level 4.0
[libx264 @ 00000000023ad800] 264 - core 148 r2721 72d53ab - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'media/8-1-2019/hi/sl-107.mp4':
Metadata:
minor_version : 512
major_brand : isom
compatible_brands: isomiso2avc1mp41
comment : vid:v09044ce0000bks3802jqrog167l3rf0
encoder : Lavf57.56.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc (default)
Metadata:
encoder : Lavc57.64.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc57.64.100 aac
Stream mapping:
Stream #0:0 (h264) -> scale (graph 0)
pad (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 453 fps=3.6 q=29.0 Lsize= 3016kB time=00:00:15.01 bitrate=1645.7kbits/s speed=0.12x
video:2763kB audio:237kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.576820%
[libx264 @ 00000000023ad800] frame I:6 Avg QP:20.93 size: 38467
[libx264 @ 00000000023ad800] frame P:118 Avg QP:23.12 size: 11624
[libx264 @ 00000000023ad800] frame B:329 Avg QP:25.19 size: 3725
[libx264 @ 00000000023ad800] consecutive B-frames: 1.8% 2.6% 4.6% 90.9%
[libx264 @ 00000000023ad800] mb I I16..4: 16.4% 76.7% 6.9%
[libx264 @ 00000000023ad800] mb P I16..4: 2.3% 5.8% 0.9% P16..4: 9.8% 3.8% 1.6% 0.0% 0.0% skip:75.7%
[libx264 @ 00000000023ad800] mb B I16..4: 0.4% 0.7% 0.1% B16..8: 9.5% 1.6% 0.3% direct: 0.6% skip:86.8% L0:43.0% L1:50.8% BI: 6.2%
[libx264 @ 00000000023ad800] 8x8 transform intra:67.4% inter:78.3%
[libx264 @ 00000000023ad800] coded y,uvDC,uvAC intra: 32.5% 40.1% 9.4% inter: 2.7% 3.9% 0.1%
[libx264 @ 00000000023ad800] i16 v,h,dc,p: 50% 25% 6% 19%
[libx264 @ 00000000023ad800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 38% 11% 27% 3% 3% 5% 3% 6% 3%
[libx264 @ 00000000023ad800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 43% 11% 12% 5% 7% 9% 4% 7% 3%
[libx264 @ 00000000023ad800] i8c dc,h,v,p: 62% 11% 22% 5%
[libx264 @ 00000000023ad800] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 00000000023ad800] ref P L0: 64.4% 14.3% 16.1% 5.2%
[libx264 @ 00000000023ad800] ref B L0: 90.6% 7.5% 2.0%
[libx264 @ 00000000023ad800] ref B L1: 97.7% 2.3%
[libx264 @ 00000000023ad800] kb/s:1496.84
[aac @ 0000000000628120] Qavg: 754.761