BtbN changed the topic of #ffmpeg to: Welcome to the FFmpeg USER support channel | Development channel: #ffmpeg-devel | Bug reports: https://ffmpeg.org/bugreports.html | Wiki: https://trac.ffmpeg.org/ | This channel is publically logged | FFmpeg 7.0 is released
ewomer has quit [Read error: Connection reset by peer]
SursumCorda has joined #ffmpeg
<SursumCorda>
Hi there, everyone! How are you doing? I'm using FFmpeg libraries in a C++ project to generate a video with a fixed duration and a fixed fps. In the current example I'm working on. I'm using 60 as fps and calling the write frame function 300 times, so the output video should have 5s, but it has less than that (3 or 4 seconds, it depends on some
<SursumCorda>
What can I be doing wrong? Did anyone else face this problem before?
crossby1004 has quit [Quit: leaving]
ewomer has joined #ffmpeg
<BtbN>
Did you forget to flush the encoder and muxer?
Unit640 has quit [Quit: Leaving]
Some_Person has quit [Ping timeout: 248 seconds]
Some_Person has joined #ffmpeg
SursumCorda has quit [Ping timeout: 256 seconds]
alexherbo2 has quit [Remote host closed the connection]
shibboleth has joined #ffmpeg
LainExperiments has joined #ffmpeg
tux97 has quit [Ping timeout: 264 seconds]
KaitoDaumoto has quit [Remote host closed the connection]
acidbunny has joined #ffmpeg
kmikita has quit [Ping timeout: 246 seconds]
lucasta has quit [Remote host closed the connection]
luva88894 has joined #ffmpeg
luva8889 has quit [Read error: Connection reset by peer]
luva88894 is now known as luva8889
LainExperiments has quit [Quit: Client closed]
iive has quit [Quit: They came for me...]
LainExperiments has joined #ffmpeg
kmikita has joined #ffmpeg
crossby1004 has joined #ffmpeg
YuGiOhJCJ has joined #ffmpeg
crossby1004 has quit [Remote host closed the connection]
tux97 has joined #ffmpeg
\\Mr_C\\ has quit [Remote host closed the connection]
wobbol has joined #ffmpeg
luva8889 has quit [Ping timeout: 276 seconds]
JavaBean has quit [Remote host closed the connection]
LainExperiments has quit [Ping timeout: 256 seconds]
chiselfuse has quit [Ping timeout: 260 seconds]
chiselfuse has joined #ffmpeg
JavaBean has joined #ffmpeg
luva8889 has joined #ffmpeg
ewomer has quit [Quit: WeeChat 4.4.2]
Traneptora has quit [Quit: Quit]
ewomer has joined #ffmpeg
noobaroo has joined #ffmpeg
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
<noobaroo>
im very weirded out by bitrate. It seems like mainstream movies are using some sort of technique that makes the raw video extremely compressible. Like, i will download a movie file that is 9000 Kbps, but I really only want the original sound track, i dont care about the video, so im re-encoding to av1 and the 1080p h264 track is coming out to a little over 600kbps and looks identical to source, even when i zoom in
<noobaroo>
when I first discovered ffmpeg and all the stuff it could do, i played around a lot with it, for quite a long time, at least a couple months in a row, daily
<noobaroo>
For this time I was re-encoding hundreds to thousands of files from my own family's 4K/8K smartphone recordings to sample files on the web to YouTube vids to various adult content from all over the web, to mainstream movie rips from web, to 15yr old DVDs I dug up from around the house
<noobaroo>
I dont re-encode much anymore. But I am right now. And it's just really weird to me that these mainstream Hollywood films squeeze down to less than 2Mbps for 1080p content, sometimes less than 1.5Mbps
<noobaroo>
And its the only type of video i have ever seen this happen. On other videos, often times at such a low CRF the bitrate will increase instead of decrease... even with av1/h265. Except hollywood films.
shibboleth has quit [Quit: shibboleth]
^Neo has quit [Ping timeout: 248 seconds]
<aaabbb>
noobaroo: what's the ssim/psnr?
Traneptora has joined #ffmpeg
<aaabbb>
whether a single crf increases or decreases bitrate compared to the original is meaningless. if i was to guess though i would say that mainstream movies have stiller shoots with less camera shake, less noise, and they operate at 24fps
Traneptora_ has joined #ffmpeg
Traneptora_ has quit [Remote host closed the connection]
<aaabbb>
but you really have to test it with a metric. re-encode with an ssim tune then use ssim filter
<furq>
there is also a reasonable chance they were denoised by the upstanding gentlemen you downloaded them from
<aaabbb>
that's true too, and even if they got a webrip (which they do these days), it's just a direct saving the stream from something like amazon, and unless it's on a bluray or something, it's not going to have intentional noise
<aaabbb>
zooming in isn't a great way to determine quality btw
<furq>
yeah upstream will often denoise
<furq>
if it wasn't shot on digital without artificial grain in the first place
<furq>
idk how common that is nowadays
<aaabbb>
it's common in anime to have grain injection to help against banding
<furq>
everything i watch was either shot on film or faked it
<furq>
i assume those films with the lads with helmets and superpowers don't bother
<aaabbb>
also i'm skeptical that 1080p h264 track at 600kbps is transparent to its 9mbps source
minimal has quit [Quit: Leaving]
<aaabbb>
that's why i suggest redoing the encode with -tune ssim, then do: ffmpeg -i original.mp4 -i encoded.mp4 -filter_complex ssim -f null -
Cheetahze has joined #ffmpeg
militantorc has joined #ffmpeg
<noobaroo>
With vorbis, do i want to mess with the `-iblock` setting? its the only parameter listed in ffmpeg -h libvorbis. I see what it says there, but can't really find anything about it online for the common man, only extremely complex research articles
<aaabbb>
then i imagine you would want to keep it at default. why vorbis and not opus tho?
<aaabbb>
>'iblock (--advanced-encode-option impulse_noisetune=N)' Set noise floor bias for impulse blocks. The value is a float number from -15.0 to 0.0. A negative bias instructs the encoder to pay special attention to the crispness of transients in the encoded audio. The tradeoff for better transient response is a higher bitrate.
<aaabbb>
noobaroo: so basically the more negative the value, the crisper transients will be at the expense of birate
<aaabbb>
so if you are suffer preecho or something and increasing bitrate manually isn't helping much, use a negative iblock
kasper93 has quit [Ping timeout: 260 seconds]
kasper93_ has joined #ffmpeg
<noobaroo>
Thanks, where'd you get that paragraph from? The source code? The ffmpeg help only says "Sets the impulse block bias (from -15 to 0) (default 0)"
<aaabbb>
i searched "libvorbis iblock impulse block bias" on duck duck go
<noobaroo>
Seems like it might be a good idea to leave it at default for low bitrate stuff but maybe increase it (or decrease it, since negative, lol) for high fidelity stuff
Sketch has quit [Read error: Connection reset by peer]
<aaabbb>
it's -15 to 0 can't be increased
AMM has quit [Ping timeout: 264 seconds]
cryptic has quit [Ping timeout: 252 seconds]
<aaabbb>
only high fidelity stuff *if* you are having issues with transients
<aaabbb>
noobaroo: but you should use opus if you can, it's better with transients anyway
chiselfuse has quit [*.net *.split]
System_Error has quit [*.net *.split]
makidoll has quit [*.net *.split]
esu has quit [*.net *.split]
fling has quit [*.net *.split]
cmc has quit [*.net *.split]
AMM has joined #ffmpeg
cryptic has joined #ffmpeg
Sketch has joined #ffmpeg
fling has joined #ffmpeg
<noobaroo>
I don't know what transients are, but lately I've been very much liking vorbis.
cmc has joined #ffmpeg
esu has joined #ffmpeg
chiselfuse has joined #ffmpeg
System_Error has joined #ffmpeg
<aaabbb>
noobaroo: a transient is a sudden change in sound basically. each hit of a drum is a transient
<aaabbb>
frequency-domain formats (like basically all modern formats) struggle with transients and so have features that compensate, such as transient-detection that shortens the mdct window
<noobaroo>
Oh okay, thanks for the info
<aaabbb>
vorbis is good but opus is better in every single way, except encode/decode complexity which matters if you are playing back on a very low-end embedded device (but in that case, you'd probably want to use mp3 which is even lighter than vorbis)
<aaabbb>
iirc vorbis has always stuggled with transients and a lot of effort has been put into mitigating its problems with pre-echo (which is a sound that occurs before a transient and is an artifact ie it should not be there). opus does not have that poblem
<noobaroo>
vorbis is the only lossy codec i know of that doesn't do any cutoff
<furq>
is that good
<noobaroo>
aac is bad with it, opus is pretty good though
<aaabbb>
you want cutoff
<furq>
also you can disable cutoff with fdk
<furq>
you just shouldn't
<aaabbb>
at least you want cutoff that is non-audible (ie not mp3's 16k)
<furq>
if you don't want cutoff then use flac
<aaabbb>
opus has a highpass at 3hz, lowpass at 20khz iirc
<furq>
lame is usually higher than 16k
<furq>
i think nowadays you need to use awful settings to get 16k cutoff
<noobaroo>
not really, aac is like 16k
<furq>
aac isn't an encoder
<noobaroo>
You have to specify -cutoff 20000 with fdk
<aaabbb>
noobaroo: at what bitrates? usually if it has a cutoff, then it's for a reason
<aaabbb>
with a lossy codec you only have so many bits to use. why waste them?
<furq>
yes
<aaabbb>
so -cutoff 20000 on fdk at low bitates will probably sound worse even though technically you get higher frequency encoding
<noobaroo>
Idk, i dont really use aac anymore because in audacity the spectrogram looks completely warped, and opus looks nearly identical, and also i cant be bothered to compile ffmpeg. But i think i used to use -vbr:a 4
<furq>
-vbr 5 disables cutoff
<aaabbb>
you listen to music with your ears not your eyes
<furq>
and it does not matter what the spectrals look like
<furq>
right
<aaabbb>
you can have a beautiful looking spectrum that sounds like shit or one that looks horrible but is transparent
<noobaroo>
Really?
<aaabbb>
yeah
<noobaroo>
I thought it was pretty much computer accurate visual representation of the sound
<furq>
it is but that doesn't mean anything
<aaabbb>
it's an accurate visual representation of the sound, not a psychoacoustic representation
<noobaroo>
You can even zoom in with the mouse to look more closely
<furq>
spectrals have their uses but trying to divine lossy audio codec quality from them is impossible
<noobaroo>
What you both are saying doesn't make sense at all to me. But if you're both saying it, then I guess I must just not understand
<furq>
they all use perceptual coding
<aaabbb>
noobaroo: for example, temporal masking makes a spectrograph ugly, but is very important
<aaabbb>
hydrogenaudio forums has a lot of technical info about that
<aaabbb>
about not using spectrographs in this way
<aaabbb>
specrogram*
<noobaroo>
Right, if i also didnt have ears. But i listen to the visibly warped aac version and the visibly almost-identical opus version and opus is not worse than aac, lets put it that way. Its either as good or better.
<aaabbb>
it's just coincidence that the warping in this case also sounds worse
<furq>
and you discovered that by listening
<noobaroo>
So ears + data visuals lead me to not use fdkaac anymore
<aaabbb>
look at a rising tone under opus. it will look horrible but sound perfect
<furq>
is this at low rate
<furq>
fdk at 128k stereo sounds more or less perfect to me and most others
<aaabbb>
i'd recommend opus over fdkaac because opus is better, not because the spectrogram looks less warped
<noobaroo>
aaabbb: do you have an example in a song ?
<furq>
but he-aac in general sounds awful to me
<aaabbb>
noobaroo: well rising sine wave is just an easy ay to visualize
<aaabbb>
also, spectrograms totally ignore the phase of audio
<aaabbb>
and at lower frequencies, you actually want to preserve the phase
<furq>
the only objective way to compare these things is abx testing with a lot of participants
<furq>
which is naturally not that objective but it's better than anything else
<furq>
unfortunately codecs are so good now that nobody bothers doing them any more
<aaabbb>
people only abx at low bitrates or against killer samples
<furq>
right
<aaabbb>
like opus at 96k is likely transparent for most people, at 128k almost certainly
<furq>
even the last big ha multiformat test was at 96k
<furq>
and that was 10 years ago
<aaabbb>
even opus at 64k is often transparent to the average music listener with good headphones
<furq>
i used vorbis at 64k 15+ years ago back when my ears were still any good and i couldn't tell any different
<furq>
granted only on portable headphones but they were pretty good ones
<aaabbb>
even good ones it's hard to tel. when abx testing you listen to the same cymbal clash at high volume over and over until you can distinguish lossless from lossy with >50% chance
<aaabbb>
so transparent really is about the human limits. but when listening to the whole track at normal volume, non-transparent is not an issue
<aaabbb>
noobaroo: what you are learning by using spectrograms is that audio codecs make crappy image encoders ;)
FlorianBad has quit [Quit: Konversation terminated!]
StephenLynx has quit [Quit: Leaving]
another| has quit [Ping timeout: 244 seconds]
FlorianBad has joined #ffmpeg
<johnjaye>
is there a problem with the ffmpeg windows port?
<johnjaye>
it seems as if the files I'm creating with it can't be moved or deleted for some reason
ChocolateArmpits has joined #ffmpeg
<aaabbb>
ffmpeg doesn't and can't make unmovable or undeletable files
kasper93_ is now known as kasper93
alphalpha has quit [Ping timeout: 260 seconds]
another| has joined #ffmpeg
<johnjaye>
well. something is causing all the output files to be that
<johnjaye>
i guess i'll restart to delete them
<aaabbb>
what happens when you move them in cmd.exe?
<johnjaye>
nothing. it just hangs
<johnjaye>
i have to ctrl-C a few times to get it back
<aaabbb>
how large are the files?
<johnjaye>
like 5MB
<aaabbb>
that sounds like you might have a problem with your disk
<johnjaye>
why is it only files ffmpeg is creating then. that's strange
ChocolateArmpits has quit [Ping timeout: 252 seconds]
<noobaroo>
Does oggenc have its own resampler that is completely different than ffmpeg's swr resampler or the sox resampler ?
<noobaroo>
Or does it just use one of those libraries ?
<aaabbb>
i don't think vorbis needs a resampler
<noobaroo>
it has one though, though I didnt know until 30min ago
<noobaroo>
I saw a 10 year old forum one time, a couple years back, of people complaining about opus only supporting 48khz sample rate back when opus first came out. and some replies were that they could resample externally instead of relying on opus' native resampler
<aaabbb>
presumably it's the speex resampler
<noobaroo>
So I knew that opus had one, did not that oggenc also did. I wonder if they are the same. I guess they probably are the same one.
<aaabbb>
well ogg123 links to libspeex
<noobaroo>
Oh okay, is speex the same as ffmpeg native resampler ?
<noobaroo>
scr i think its called
<furq>
swr and probably not
<aaabbb>
the speex resampler and sox resampler are both good
<aaabbb>
both transparent
<furq>
the official oggenc uses speex's resampler
<furq>
oggenc2 can use soxr or libsamplerate
<furq>
but it's not really worth worrying about
<furq>
they definitely don't use libswresample but i have no idea how similar they are internally
Suchiman has quit [Quit: Connection closed for inactivity]
esu has quit [Remote host closed the connection]
esu has joined #ffmpeg
fling has quit [Remote host closed the connection]
fling has joined #ffmpeg
Cheetahze has quit [Quit: Connection closed for inactivity]
fling has quit [Remote host closed the connection]
fling has joined #ffmpeg
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #ffmpeg
Tano has quit [Quit: WeeChat 4.4.2]
<aaabbb>
no matter, all those resamplers are transparent. unless you are using something as dumb as linear interpolation to resample there are no issues
Some_Person has quit [Ping timeout: 272 seconds]
Some_Person has joined #ffmpeg
trillion_exabyte has quit [Ping timeout: 252 seconds]
trillion_exabyte has joined #ffmpeg
Krusher has joined #ffmpeg
xx has joined #ffmpeg
vlm has quit [Ping timeout: 252 seconds]
vlm has joined #ffmpeg
lusciouslover has quit [Ping timeout: 246 seconds]
lusciouslover has joined #ffmpeg
vlm has quit [Ping timeout: 264 seconds]
welder has quit [Ping timeout: 265 seconds]
vlm has joined #ffmpeg
vlm has quit [Quit: vlm]
rvalue- has joined #ffmpeg
rvalue has quit [Ping timeout: 255 seconds]
Blacker47 has joined #ffmpeg
rvalue- is now known as rvalue
turlando has joined #ffmpeg
Cheetahze has joined #ffmpeg
evilscreww has joined #ffmpeg
deus0ww has quit [Ping timeout: 260 seconds]
deus0ww has joined #ffmpeg
EmleyMoor has quit [Ping timeout: 245 seconds]
crossby1004 has joined #ffmpeg
DeHackEd has quit [Remote host closed the connection]
DeHackEd has joined #ffmpeg
alexherbo2 has joined #ffmpeg
welder has joined #ffmpeg
Suchiman has joined #ffmpeg
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ffmpeg
putacho has quit [Quit: There is no spoon!]
microchip_ has joined #ffmpeg
microchip_ is now known as putacho
lavaball has joined #ffmpeg
hackkitten has quit [Read error: Connection reset by peer]
SursumCorda has joined #ffmpeg
hackkitten has joined #ffmpeg
<SursumCorda>
BtbN not sure. If the mux example does that, than probably yes. Do you have a flush sample code to share?
Wulf has quit [Ping timeout: 252 seconds]
Wulf has joined #ffmpeg
alexherbo2 has quit [Remote host closed the connection]
lavaball has quit [Remote host closed the connection]
alexherbo2 has joined #ffmpeg
hackkitten has quit [Ping timeout: 264 seconds]
evilscreww has quit [Ping timeout: 250 seconds]
hackkitten has joined #ffmpeg
fling_ has joined #ffmpeg
fling has quit [Ping timeout: 260 seconds]
fling_ is now known as fling
Some_Person has quit [Ping timeout: 248 seconds]
SursumCorda has quit [Quit: Client closed]
Some_Person has joined #ffmpeg
SursumCorda has joined #ffmpeg
Unit640 has joined #ffmpeg
<SursumCorda>
Hi there, everyone! Does anyone have a code example of how one can use the C++ FFmpeg libraries to generate a video (without audio) with a fixed duration and a fixed fps?
System_Error has quit [Ping timeout: 260 seconds]
<another|>
there are c++ libs?
Some_Person has quit [Ping timeout: 246 seconds]
alexherbo2 has quit [Remote host closed the connection]
Cheetahze has quit [Quit: Connection closed for inactivity]
halvut has joined #ffmpeg
<CounterPillow>
They're C libraries.
<CounterPillow>
Also stop trying to copypaste non-existent example code together and read the API docs please
StephenLynx has joined #ffmpeg
<welder>
SursumCorda: do you need C++ for that? ffmpeg cli suffices in such case
relue has quit [Ping timeout: 245 seconds]
<CounterPillow>
they are likely working on making an application and are trying to work out a minimal prototype
<CounterPillow>
As BtbN said, make sure to flush the encoders/muxers.
lucasta has joined #ffmpeg
Argorok has quit [Quit: Connection closed for inactivity]
<SursumCorda>
CounterPillow you're write, it's C. My project is in C++. What do you mean by "non-existent example code" exactly? I've read the API, I'm following the mux example, but I'm not finding out what's wrong. That's why I'm here asking.
<SursumCorda>
welder I wanted to make a code that didn't suppose the user has ffmpeg cli installed. Also, I'm generating the pixels on the fly through an algorithm, I think it would be a little bit hard to use the cli in this case.
<SursumCorda>
you're right*
minimal has joined #ffmpeg
<CounterPillow>
Don't expect an example of precisely what you're trying to do existing, or that people have one at the ready. As per BtbN's question, the problem could be that you're not flushing the encoder/muxer before closing. I'm not familiar enough with the ffmpeg API to know specifically which functions do this, but I can see a few when searching for "flush" in the doxygen documentation
<CounterPillow>
>Instead of valid input, send NULL to the avcodec_send_packet() (decoding) or avcodec_send_frame() (encoding) functions. This will enter draining mode.
<CounterPillow>
alright, that's the one then
<SursumCorda>
Thanks, I'll read that and try it on my code!
<BtbN>
The firmware you're using seems old at least, huc firmware on linux-firmware is at 7.10.16, and guc at 7.29.2
<BtbN>
your versions are from mid 2022
lavaball has quit [Quit: lavaball]
Magissia has joined #ffmpeg
Magissia has quit [Ping timeout: 255 seconds]
JanC has joined #ffmpeg
JanC has quit [Killed (erbium.libera.chat (Nickname regained by services))]
Some_Person has quit [Ping timeout: 244 seconds]
lavaball has joined #ffmpeg
System_Error has joined #ffmpeg
Some_Person has joined #ffmpeg
ewomer has quit [Read error: Connection reset by peer]
Traneptora has joined #ffmpeg
JanC has quit [Ping timeout: 260 seconds]
SursumCorda has joined #ffmpeg
Krusher has quit [Read error: Connection reset by peer]
minimal has quit [Quit: Leaving]
JanC has joined #ffmpeg
ewomer has joined #ffmpeg
lucasta has joined #ffmpeg
nickster has joined #ffmpeg
SursumCorda has quit [Quit: Client closed]
tyzef has joined #ffmpeg
peppi has joined #ffmpeg
<peppi>
hello
<peppi>
is it possible to use ffmpeg to output a stream to pipewire?
tyzef has quit [Quit: WeeChat 3.8]
ChocolateArmpits has quit [Ping timeout: 260 seconds]
TheSilentLink has quit [Quit: Good Bye! My bouncer has probably crashed or lost connection to the internet...]
TheSilentLink has joined #ffmpeg
wobbol has quit [Ping timeout: 272 seconds]
l4yer has quit [Ping timeout: 245 seconds]
jemius has quit [Quit: Leaving]
MrZeus has joined #ffmpeg
Blacker47 has quit [Quit: Life is short. Get a V.90 modem fast!]
wobbol has joined #ffmpeg
System_Error has quit [Remote host closed the connection]
System_Error has joined #ffmpeg
luva8889 has quit [Read error: Connection reset by peer]
rvalue- has joined #ffmpeg
rvalue has quit [Ping timeout: 276 seconds]
rvalue- is now known as rvalue
Traneptora has quit [Quit: Quit]
peppi has quit [Remote host closed the connection]
luva8889 has joined #ffmpeg
MrZeus has quit [Read error: Connection reset by peer]
wobbol has quit [Ping timeout: 260 seconds]
alien_lappy has joined #ffmpeg
<alien_lappy>
in ffplay; is there a wait or delay option? i'm using stdin from yt-dlp and it would be nice if i could wait a couple of seconds to get a stable buffer going, before starting to play
Vonter has quit [Ping timeout: 260 seconds]
Vonter has joined #ffmpeg
fling has quit [Read error: Connection reset by peer]