
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (33)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Gestion de la ferme
2 mars 2010, parLa ferme est gérée dans son ensemble par des "super admins".
Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
Dans un premier temps il utilise le plugin "Gestion de mutualisation" -
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 (6106)
-
How to fix grainy recoding with ffmpeg mp4 x264 ?
21 mars 2020, par teenserieI recorded the audio and video stream from a streaming with ffmpeg. when I go to re-encode the file using libx264, the video in the movements looks bad and grainy as in the image.
Where did I go wrong ?this is the code I used
ffmpeg -i input.mp4 -c:v libx264 -c:a aac output.mp4
and these are mediainfo of original file
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isom
creation_time : 2020-03-19T22:43:32.000000Z
Duration: 00:39:51.99, start: 0.000000, bitrate: 1300 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x1080 [SAR 3:2 DAR 16:9], Closed Captions, 1268 kb/s, 59.94 fps, 59.94 tbr, 90k tbn, 59.94 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(spa): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 22 kb/s (default)
Metadata:
handler_name : SoundHandlermediainfo of the file recoded
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Duration: 00:39:51.99, start: 0.000000, bitrate: 7924 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 7892 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(spa): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 22 kb/s (default)
Metadata:
handler_name : SoundHandlerHow can I recode the file without loss of quality ? (sorry for my poor english)
-
avcodec/aacenc : Avoid 0 lambda
28 mai 2021, par Michael Niedermayer -
Losing audio quality when merging multiple videos with FFmpeg
30 mai 2021, par CharlyI am trying to merge multiple videos (a few seconds each) into one, using FFmpeg.


Merging all at once


I first tried merging all videos with one FFmpeg command, but it only seems to work with up to a certain amount of videos. On my Raspberry Pi 4 (2BG RAM), it worked for 16 videos and broke (ran out of memory ?) while merging 36 videos (command and ouput below)


ffmpeg -i 1Rbrdn1Xp.mp4 -i G7eYqdFPb.mp4 -i -Xo-6ABm3.mp4 -i 6As9IlqbW.mp4 -i tz9tVKFA-.mp4
-i MS6DHZoJE.mp4 -i CeJYs99-G.mp4 -i Hsv5X48IC.mp4 -i Gm_DtjNU4.mp4 -i PZytbInZL.mp4
-i qsIJuvKO2.mp4 -i c5wxGk_Fx.mp4 -i j4K1qA7ih.mp4 -i AIpVWuhGV.mp4 -i yiLk0snSh.mp4
-i q1zmytaXZ.mp4 -i VRwQvLxaW.mp4 -i 0_3yLrokH.mp4 -i fW28LPQsk.mp4 -i La6WsGeE8.mp4
-i FlroQnCHq.mp4 -i c7SiL_qSU.mp4 -i aaGTUMJXD.mp4 -i hvXYBaCSM.mp4 -i CMDaFrWM4.mp4
-i _YAGDRyQN.mp4 -i RQXyshs_o.mp4 -i 96pKlIZxW.mp4 -i HVOOeCUYG.mp4 -i pJFxq7BTx.mp4
-i VxMJQqbK5.mp4 -i mkgbViPTI.mp4 -i zrjj93b5c.mp4 -i AL9oG1F36.mp4 -i IsUnC0NPb.mp4
-i Qhj2bhab9.mp4 -y -filter_complex concat=n=36:v=1:a=1 -vsync 2 kn-dQSN-v.mp4



ffmpeg version 4.1.6-1~deb10u1+rpt1 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 8 (Raspbian 8.3.0-6+rpi1)
(...)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1Rbrdn1Xp.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.20.100
 Duration: 00:00:08.08, start: 0.000000, bitrate: 602 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 533 kb/s, 57.62 fps, 60 tbr, 15360 tbn, 120 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 64 kb/s (default)
 Metadata:
 handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'G7eYqdFPb.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.20.100
 Duration: 00:00:21.00, start: 0.000000, bitrate: 310 kb/s
 Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 229 kb/s, 59.09 fps, 60 tbr, 15360 tbn, 120 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 72 kb/s (default)
 Metadata:
 handler_name : SoundHandler
(...)
Stream mapping:
 Stream #0:0 (h264) -> concat:in0:v0
 Stream #0:1 (aac) -> concat:in0:a0
 Stream #1:0 (h264) -> concat:in1:v0
 Stream #1:1 (aac) -> concat:in1:a0
(...)
 concat:out:v0 -> Stream #0:0 (libx264)
 concat:out:a0 -> Stream #0:1 (aac)
Press [q] to stop, [?] for help
[libx264 @ 0x17cb5e0] using SAR=1/1 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A 
[libx264 @ 0x17cb5e0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x17cb5e0] profile High, level 3.2
[libx264 @ 0x17cb5e0] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - 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=6 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 'kn-dQSN-v.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.20.100
 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 60 fps, 15360 tbn, 60 tbc (default)
 Metadata:
 encoder : Lavc58.35.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
 Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 69 kb/s (default)
 Metadata:
 encoder : Lavc58.35.100 aac
frame=15952 fps= 52 q=31.0 size= 10240kB time=00:04:33.02 bitrate= 307.3kbits/s speed=0.844x
[h264 @ 0x3472d80] get_buffer() failed40kB time=00:04:33.02 bitrate= 307.3kbits/s speed=0.844x 
[h264 @ 0x3472d80] thread_get_buffer() failed
[h264 @ 0x3472d80] decode_slice_header error
[h264 @ 0x3472d80] no frame!
Error while decoding stream #15:0: Invalid data found when processing input
[h264 @ 0x34f54d0] get_buffer() failed
[h264 @ 0x34f54d0] thread_get_buffer() failed
[h264 @ 0x34f54d0] decode_slice_header error
[h264 @ 0x34f54d0] no frame!
[h264 @ 0x3472d80] get_buffer() failed
[h264 @ 0x3472d80] thread_get_buffer() failed
(...)
Error while decoding stream #15:0: Invalid data found when processing input
[h264 @ 0x3472d80] reference picture missing during reorder
[h264 @ 0x3472d80] Missing reference picture, default is 65660
[h264 @ 0x34c4540] mmco: unref short failure
[h264 @ 0x34f54d0] get_buffer() failed08kB time=00:04:45.37 bitrate= 316.0kbits/s speed=0.845x 
[h264 @ 0x34f54d0] thread_get_buffer() failed
[h264 @ 0x34f54d0] decode_slice_header error
[h264 @ 0x34f54d0] no frame!
[h264 @ 0x3472d80] decode_slice_header error
[h264 @ 0x3472d80] no frame!
Error while decoding stream #15:0: Invalid data found when processing input
[h264 @ 0x34f54d0] mmco: unref short failure
Error while decoding stream #15:0: Invalid data found when processing input
[h264 @ 0x3472d80] get_buffer() failed
[h264 @ 0x3472d80] thread_get_buffer() failed
[h264 @ 0x3472d80] decode_slice_header error
[h264 @ 0x3472d80] no frame!
Error while decoding stream #15:0: Invalid data found when processing input
[h264 @ 0x3472d80] get_buffer() failed
[h264 @ 0x3472d80] thread_get_buffer() failed
[h264 @ 0x3472d80] decode_slice_header error
[h264 @ 0x3472d80] no frame!
[h264 @ 0x34f54d0] reference picture missing during reorder
 Last message repeated 1 times
[h264 @ 0x34f54d0] Missing reference picture, default is 65708
 Last message repeated 1 times
Error while decoding stream #15:0: Invalid data found when processing input
[h264 @ 0x34dccb0] reference picture missing during reorder
[h264 @ 0x34dccb0] Missing reference picture, default is 65716
[h264 @ 0x3472d80] mmco: unref short failure
[h264 @ 0x34f54d0] decode_slice_header error
[h264 @ 0x34f54d0] no frame!
Error while decoding stream #15:0: Invalid data found when processing inputbits/s speed=0.845x 
[h264 @ 0x3480010] get_buffer() failed
[h264 @ 0x3480010] thread_get_buffer() failed
[h264 @ 0x3480010] decode_slice_header error
[h264 @ 0x3480010] no frame!
[h264 @ 0x34c4540] decode_slice_header error
[h264 @ 0x34c4540] no frame!
Error while decoding stream #15:0: Invalid data found when processing input
[h264 @ 0x3480010] mmco: unref short failure
Error while decoding stream #15:0: Invalid data found when processing input
[h264 @ 0x34c4540] get_buffer() failed
[h264 @ 0x34c4540] thread_get_buffer() failed
[h264 @ 0x34c4540] decode_slice_header error
[h264 @ 0x34c4540] no frame!
Error while decoding stream #15:0: Invalid data found when processing input
[h264 @ 0x34c4540] get_buffer() failed
[h264 @ 0x34c4540] thread_get_buffer() failed
[h264 @ 0x34c4540] decode_slice_header error
[h264 @ 0x34c4540] no frame!
[h264 @ 0x34f54d0] decode_slice_header error
[h264 @ 0x34f54d0] no frame!
Error while decoding stream #15:0: Invalid data found when processing input
[h264 @ 0x3480010] reference picture missing during reorder
 Last message repeated 1 times
[h264 @ 0x3480010] Missing reference picture, default is 65772
 Last message repeated 1 times
Error while decoding stream #15:0: Invalid data found when processing input
[h264 @ 0x3472d80] reference picture missing during reorder
[h264 @ 0x3472d80] Missing reference picture, default is 65780
[h264 @ 0x34c4540] mmco: unref short failure
av_interleaved_write_frame(): Cannot allocate memory
[mp4 @ 0x295c7e0] Application provided duration: 3689347710924763697 / timestamp: 6291454 is out of range for mov/mp4 format
Segmentation fault



Merging videos 2 by 2


I then tried gradually merging videos into one, using multiple FFmpeg commands.


# Pseudocode
final = merge(clip1, clip2)
final = merge(final, clip3)
final = merge(final, clip4)
final = merge(final, clip5)
...



with each command, looking like this :


ffmpeg -i 1Rbrdn1Xp.mp4 -i G7eYqdFPb.mp4 -y -filter_complex concat=n=2:v=1:a=1 -vsync 2 UMVDl9jki.mp4



ffmpeg -i UMVDl9jki.mp4 -i -Xo-6ABm3.mp4 -y -filter_complex concat=n=2:v=1:a=1 -vsync 2 azE1Uombp.mp4



This works but there is a loss in audio quality on the first clips, and it is slowly improving over time. I am guessing this is due to the first videos being merged more times than the last ones. You can see this effect happen in this video (weird artefacts in the voice).



So, am I doing something wrong ?

Is there a way of merging a lot of videos, without running out of memory or worsening the audio quality ?