
Recherche avancée
Médias (91)
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#1 The Wires
11 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
ED-ME-5 1-DVD
11 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (69)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
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
Sur d’autres sites (8112)
-
ffmpeg streaming from local drive to RTSP gives black video in some streaming services :(
27 avril 2022, par John RThis question if about ffmpeg flags or options.....


example, this ffmpeg command work perfectly well in mux.com but NOT in livepeer.com


ffmpeg -re -i 1.webm -threads 4 
-c:v libx264 -movflags +dash -preset fast 
-tune zerolatency -pix_fmt yuv420p -c:a aac 
-b:a 192k -ac 2 -profile:v high -b:v 1369k 
-r 30 -g 60 -bufsize 969k 
-f flv "rtmp://rtmp.livepeer.com/live/streamkey"





QUESTION : I'm I missing something ???


I try
-f mpegts
=> I get black video in the stream dasboard

I'm stuck...


-
How do I use ffmpeg to concatenate 2 videos and add a period of silence + black screen between them ?
29 avril 2022, par masotimeThere are several existing examples, but I'd like a single command that uses complex_filter to achieve the objective without doing extra things like generating blank video / audio files.


Looking around, this is the best I've come up with so far :


ffmpeg -i video1.mp4 -i video2.mp4 -filter_complex "color=black:s=960x540:d=1[b0];aevalsrc=0:d=1[s0];[0:v:0][0:a:0][b0][s0][1:v:0][1:a:0]concat=n=3:v=1:a=1[outv][outa]" -map '[outv]' -map '[outa]' out.mp4



My understanding of the breakdown of such a command is


- 

- specify 2 inputs
- define a complex filter
- define a black video stream of duration 1s and call it b0
- define a silent audio stream of duration 1s and call it s0
- pipe it through the concat filter with












- 

- First stream : [0:v:0][0:a:0] // video1.mp4
- Second stream : [b0][s0] // stuff I defined earlier
- Third stream : [1:v:0][1:a:0] // video2.mp4








- 

- define 2 output streams [outv][outa] for video and audio respectively
- combine them into out.mp4






All file inputs are correctly 960x540, all using the same audio and video codecs but ffmpeg gives me this error and starts using 100% CPU


More than 1000 frames duplicated



I think there's something wrong with the streams I'm defining in the filter - what's wrong ? Do I need to specify more parameters somewhere ?


EDIT : Here's a MediaInfo printout of the input video's metadata


Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/mp41)
File size : 7.82 MiB
Duration : 31 s 449 ms
Overall bit rate : 2 086 kb/s
Writing application : Lavf59.16.100

Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main@L3@Main
Codec ID : hvc1
Codec ID/Info : High Efficiency Video Coding
Duration : 31 s 449 ms
Bit rate : 1 973 kb/s
Maximum bit rate : 2 000 kb/s
Width : 960 pixels
Height : 540 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0 (Type 0)
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.159
Stream size : 7.40 MiB (95%)
Writing library : x265 3.4+31-6722fce1f:[Mac OS X][clang 12.0.0][64 bit] 8bit+10bit+12bit
Encoding settings : cpuid=1111039 / frame-threads=4 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=960x540 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=23 / keyint=250 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=20 / lookahead-slices=0 / scenecut=40 / hist-scenecut=0 / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=3 / limit-refs=1 / no-limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / no-frame-dup / no-hme / weightp / no-weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=3 / selective-sao=4 / early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=0.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=abr / bitrate=2000 / qcomp=0.60 / qpstep=4 / stats-write=1 / stats-read=0 / slow-firstpass / ipratio=1.40 / pbratio=1.30 / aq-mode=2 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=1 / transfer=1 / colormatrix=1 / chromaloc=1 / chromaloc-top=0 / chromaloc-bottom=0 / display-window=0 / cll=0,0 / min-luma=0 / max-luma=255 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / hist-threshold=0.03 / no-opt-cu-delta-qp / no-aq-motion / no-hdr10 / no-hdr10-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=0 / analysis-save-reuse-level=0 / analysis-load-reuse-level=0 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=1 / refine-ctu-distortion=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-analysis-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei / no-hevc-aq / no-svt / no-field / qp-adaptation-range=1.00 / scenecut-aware-qp=0conformance-window-offsets / right=0 / bottom=0 / decoder-max-rate=0 / no-vbv-live-multi-pass
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Codec configuration box : hvcC

Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 31 s 449 ms
Source duration : 31 s 492 ms
Source_Duration_LastFrame : -17 ms
Bit rate mode : Constant
Bit rate : 106 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 405 KiB (5%)
Source stream size : 406 KiB (5%)
Title : Core Media Audio
Language : English
Default : Yes
Alternate group : 1



-
FFmpeg extracts black image from H264 stream
8 juin 2022, par massivemoistureI have a C# application that receives H264 stream through a socket. I want to continuously get the latest image from that stream.


Here's what I did with FFmpeg 5.0.1, just a rough sample to get ONE latest image, how I start FFmpeg :


var ffmpegInfo = new ProcessStartInfo(FFMPEG_PATH);
ffmpegInfo.RedirectStandardInput = true;
ffmpegInfo.RedirectStandardOutput = true;
ffmpegInfo.RedirectStandardError = true;
ffmpegInfo.UseShellExecute = false;

ffmpegInfo.Arguments = "-i pipe: -f h264 -pix_fmt bgr24 -an -sn pipe:";

ffmpegInfo.UseShellExecute = false;
ffmpegInfo.CreateNoWindow = true;

Process myFFmpeg = new Process();
myFFmpeg.StartInfo = ffmpegInfo;
myFFmpeg.EnableRaisingEvents = true;
myFFmpeg.Start();

var inStream = myFFmpeg.StandardInput.BaseStream;
FileStream baseStream = myFFmpeg.StandardOutput.BaseStream as FileStream;
myFFmpeg.BeginErrorReadLine();



Then I start a new thread to receive the stream through socket :


// inStream is "myFFmpeg.StandardInput.BaseStream" from the code block above
var t = Task.Run(() => ReceiveStream(inStream));



Next I read the output from FFmpeg :


byte[] decoded = new byte[Width * Height * 3];
int numBytesToRead = Width * Height * 3;
int numBytesRead = 0;

while (numBytesToRead > 0)
{
 int n = baseStream.Read(decoded, 0, decoded.Length);
 Console.WriteLine($"Read {n} bytes");
 if (n == 0)
 {
 break;
 } 
 numBytesRead += n;
 numBytesToRead -= n;
}



Lastly, I use ImageSharp library to save
decoded
byte array as a jpeg file.

image.Save("test.jpeg", encoder);



However,
test.jpeg
always comes out as a black image. What did I do wrong ?
Here's the stderr log that I got from ffmpeg :


 Duration: N/A, bitrate: N/A
 Stream #0:0: Video: h264 (High), yuv420p(tv, smpte170m/bt470bg/smpte170m, progressive), 1080x2256, 25 fps, 25 tbr, 1200k tbn
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Incompatible pixel format 'bgr24' for codec 'libx264', auto-selecting format 'yuv444p'
[libx264 @ 0x11b9068f0] using cpu capabilities: ARMv8 NEON
[libx264 @ 0x11b9068f0] profile High 4:4:4 Predictive, level 5.0, 4:4:4, 8-bit
Output #0, h264, to 'pipe:':
 Metadata:
 encoder : Lavf59.16.100
 Stream #0:0: Video: h264, yuv444p(tv, smpte170m/bt470bg/smpte170m, progressive), 1080x2256, q=2-31, 25 fps, 25 tbn
 Metadata:
 encoder : Lavc59.18.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame= 1 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 56 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
frame= 87 fps= 83 q=28.0 size= 370kB time=00:00:01.16 bitrate=2610.6kbits/s speed=1.11x
frame= 118 fps= 75 q=28.0 size= 698kB time=00:00:02.40 bitrate=2381.4kbits/s speed=1.54x
frame= 154 fps= 75 q=28.0 size= 1083kB time=00:00:03.84 bitrate=2311.1kbits/s speed=1.86x
...



Thank you !


Edit : as suggested by @kesh, I have changed
h264
torawvideo
, the arguments now are :-i pipe: -f rawvideo -pix_fmt bgr24 -an -sn pipe:


Here's the output of ffmpeg :


Input #0, h264, from 'pipe:':
 Duration: N/A, bitrate: N/A
 Stream #0:0: Video: h264 (High), yuv420p(tv, smpte170m/bt470bg/smpte170m, progressive), 1080x2256, 25 fps, 25 tbr, 1200k tbn
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
// About 9 of these "No accelerated colorspace..." message
[swscaler @ 0x128690000] [swscaler @ 0x1286a0000] No accelerated colorspace conversion found from yuv420p to bgr24.
Output #0, rawvideo, to 'pipe:':
 Metadata:
 encoder : Lavf59.16.100
 Stream #0:0: Video: rawvideo (BGR[24] / 0x18524742), bgr24(pc, gbr/bt470bg/smpte170m, progressive), 1080x2256, q=2-31, 1461888 kb/s, 25 fps, 25 tbn
 Metadata:
 encoder : Lavc59.18.100 rawvideo
frame= 1 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
// FFmpeg outputs no more log after this