
Recherche avancée
Autres articles (34)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (7219)
-
FFMPEG segment creates black frame in the beginning - and key_frame looks offset [closed]
30 septembre 2022, par jackyrooI'm trying to split a video using ffmpeg segment :


ffmpeg -r 60 -accurate_seek -I input.mov -map 0:a? -map 0:v? -codec copy -reset_timestamps 1 -map_metadata 0 -avoid_negative_ts 1 -f segment output_%%03d.mov -y -loglevel debug


The problem with this approach is that the first split segment has 2 black frames at the beginning, while the consecutive ones are fine.


I cannot figure out why, and I'm genuinely lost in this process.


I've also tried specifying -force_key_frames but it makes no difference at all.


Then I found something interesting by comparing keyframes of the original video and the first split chunk using this command :


ffprobe -select_streams v -skip_frame nokey -show_frames -v quiet input.mov


Original Video KeyFrames
The first keyframe of the original video looks fine :


[FRAME]
media_type=video
stream_index=0
key_frame=1
pts=0
pts_time=0.000000
pkt_dts=127488
pkt_dts_time=8.300000
best_effort_timestamp=0
best_effort_timestamp_time=0.000000
pkt_duration=256
pkt_duration_time=0.016667
duration=256
duration_time=0.016667
pkt_pos=40
pkt_size=128838
width=1420
height=2000
pix_fmt=yuv420p
sample_aspect_ratio=N/A
pict_type=I
coded_picture_number=0
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
color_range=unknown
color_space=unknown
color_primaries=unknown
color_transfer=unknown
chroma_location=left
[SIDE_DATA]
side_data_type=H.26[45] User Data Unregistered SEI message
[/SIDE_DATA]
[/FRAME]



Split Video - First Chunk Keyframes


On the other hand, it seems like the first keyframe of the chunk (the one with the two added black frames in the beginning) gets shifted !


[FRAME]
media_type=video
stream_index=1
key_frame=1
pts=507
pts_time=0.033008
pkt_dts=N/A
pkt_dts_time=N/A
best_effort_timestamp=507
best_effort_timestamp_time=0.033008
pkt_duration=256
pkt_duration_time=0.016667
duration=256
duration_time=0.016667
pkt_pos=40
pkt_size=128838
width=1420
height=2000
pix_fmt=yuv420p
sample_aspect_ratio=N/A
pict_type=I
coded_picture_number=0
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
color_range=unknown
color_space=unknown
color_primaries=unknown
color_transfer=unknown
chroma_location=left
[SIDE_DATA]
side_data_type=H.26[45] User Data Unregistered SEI message
[/SIDE_DATA]
[/FRAME]



Might this be the cause of the two black frames at the beginning ?


The following is the first (and only) keyframe of the second chunk, and it looks fine :


[FRAME]
media_type=video
stream_index=1
key_frame=1
pts=0
pts_time=0.000000
pkt_dts=N/A
pkt_dts_time=N/A
best_effort_timestamp=0
best_effort_timestamp_time=0.000000
pkt_duration=256
pkt_duration_time=0.016667
duration=256
duration_time=0.016667
pkt_pos=40
pkt_size=158598
width=1420
height=2000
pix_fmt=yuv420p
sample_aspect_ratio=N/A
pict_type=I
coded_picture_number=0
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
color_range=unknown
color_space=unknown
color_primaries=unknown
color_transfer=unknown
chroma_location=left
[/FRAME]



Please help me spreading some light over this...


Thanks !


-
How to remove black bars with ffmpeg ?
3 novembre 2022, par watch-thisI'm trying to remove black bars from a 637×478 video




here's what happens :


% ffmpeg -i sfu11.mp4 -vf "scale=ih*16/9:ih,scale=iw:-2,setsar=1" -y out.mp4 
ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
 built with Apple clang version 14.0.0 (clang-1400.0.29.102)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/5.1.2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
 libavutil 57. 28.100 / 57. 28.100
 libavcodec 59. 37.100 / 59. 37.100
 libavformat 59. 27.100 / 59. 27.100
 libavdevice 59. 7.100 / 59. 7.100
 libavfilter 8. 44.100 / 8. 44.100
 libswscale 6. 7.100 / 6. 7.100
 libswresample 4. 7.100 / 4. 7.100
 libpostproc 56. 6.100 / 56. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sfu11.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2mp41
 encoder : Lavf57.83.100
 Duration: 01:02:49.37, start: 0.000000, bitrate: 15 kb/s
 Chapters:
 Chapter #0:0: start 0.000000, end 99.833000
 Metadata:
 title : Chapter 01
 Chapter #0:1: start 99.833000, end 701.818000
 Metadata:
 title : Chapter 02
 Chapter #0:2: start 701.818000, end 1213.746000
 Metadata:
 title : Chapter 03
 Chapter #0:3: start 1213.746000, end 1726.892000
 Metadata:
 title : Chapter 04
 Chapter #0:4: start 1726.892000, end 2167.882000
 Metadata:
 title : Chapter 05
 Chapter #0:5: start 2167.882000, end 2816.430000
 Metadata:
 title : Chapter 06
 Chapter #0:6: start 2816.430000, end 3769.366000
 Metadata:
 title : Chapter 07
 Stream #0:0[0x1](und): Video: hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(tv, progressive), 708x478 [SAR 9:10 DAR 1593:1195], 544 kb/s, 23.98 fps, 23.98 tbr, 24k tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 341 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
 Stream #0:2[0x3](eng): Data: bin_data (text / 0x74786574)
 Metadata:
 handler_name : SubtitleHandler
Stream mapping:
 Stream #0:0 -> #0:0 (hevc (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x7f8630806e00] width not divisible by 2 (849x478)
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[aac @ 0x7f8630809d00] Qavg: 15927.165
[aac @ 0x7f8630809d00] 2 frames left in the queue on closing
Conversion failed!



However, the same flags work using
ffplay
but I get horizontal black bars instead.

% ffplay -i sfu11.mp4 -vf "scale=ih\*16/9:ih,scale=iw:-2,setsar=1"





I also tried using the cropdetect filter. It doesn't work and end up with the very same black bars while passing
-vf crop=...
.

-
Is ffmpeg's chromakey filter broken when matching black/white ?
7 janvier 2023, par Taylor BrownI have a file,
colors.png
. It looks like this :



Let's say I want to make the red square transparent. When I run
ffmpeg -i colors.png -filter_complex "[0]chromakey=0xff0000:similarity=0.1:blend=0.0[out]" -map "[out]" colors-rm-red.png
(notice I usesimilarity=0.1
to make this work), I get exactly that :



How about making the blue square transparent ?
ffmpeg -i colors.png -filter_complex "[0]chromakey=0x0000ff:similarity=0.1:blend=0.0[out]" -map "[out]" colors-rm-blue.png
works too !



But what about replacing black ?
ffmpeg -i colors.png -filter_complex "[0]chromakey=0x000000:similarity=0.1:blend=0.0[out]" -map "[out]" colors-rm-black.png
gives me this :



And likewise, replacing white with
ffmpeg -i colors.png -filter_complex "[0]chromakey=0xffffff:similarity=0.1:blend=0.0[out]" -map "[out]" colors-rm-white.png
gives me the same result :



Why is this ? Even if I use
similarity=0.01
, which according to the docs "matches only the exact key color", this still doesn't work when I'm trying to make black/white transparent. Is ffmpeg broken, or am I misunderstanding thechromakey
filter ?