michaelni changed the topic of #ffmpeg-devel to: Welcome to the FFmpeg development channel | Questions about using FFmpeg or developing with libav* libs should be asked in #ffmpeg | This channel is publicly logged | FFmpeg 7.1 has been released! | Please read ffmpeg.org/developer.html#Code-of-conduct
cone-757 has joined #ffmpeg-devel
<cone-757> ffmpeg Peter Ross master:ae8295417adf: avformat/rmdec: support RMHD file format
<cone-757> ffmpeg Peter Ross master:33802e7c3237: avcodec/rv60: RealVideo 6.0 decoder
<cone-757> ffmpeg Peter Ross master:2d81eaa37bba: fate/rv60: add test
<thardin> pal: probably not
<pal> ok, so we should plan on merging midweek unless we hear otherwise...
<thardin> mayhaps
<thardin> at the pub atm
zsoltiv_ has joined #ffmpeg-devel
aaabbb has quit [Ping timeout: 264 seconds]
iive has quit [Quit: They came for me...]
aaabbb has joined #ffmpeg-devel
<pal> enjoy... same for me soon.
esu has quit [Remote host closed the connection]
esu has joined #ffmpeg-devel
thilo has quit [Ping timeout: 260 seconds]
thilo has joined #ffmpeg-devel
Marth64 has quit [Quit: Leaving]
cone-757 has quit [Quit: transmission timeout]
arch1t3cht3 has joined #ffmpeg-devel
arch1t3cht has quit [Ping timeout: 252 seconds]
arch1t3cht3 is now known as arch1t3cht
jamrial has quit []
System_Error has quit [Remote host closed the connection]
System_Error has joined #ffmpeg-devel
Martchus_ has joined #ffmpeg-devel
Martchus has quit [Ping timeout: 265 seconds]
MrZeus has quit [Ping timeout: 265 seconds]
LainExperiments has joined #ffmpeg-devel
jon_in_seoul has joined #ffmpeg-devel
<JEEB> huh, this mentions RPI and seems to be a P010 patch for v4l2? https://github.com/awawa-dev/P010_for_V4L2 . whatever this HyperHDR thing is
<JEEB> oooh, it's for capture devices, so actual original v4l2 use case (https://github.com/raspberrypi/linux/pull/6451)
<JEEB> and here I hoped someone had poked the decoding hardware to force it output P010 :P
<fflogger> [editedticket] nyanmisaka: Ticket #11280 ([undetermined] Strange green flickering line added with a hevc_vaapi reencode) updated https://trac.ffmpeg.org/ticket/11280
tufei__ has quit [Ping timeout: 260 seconds]
tufei__ has joined #ffmpeg-devel
kepstin has quit [Remote host closed the connection]
kepstin has joined #ffmpeg-devel
kepstin has quit [Remote host closed the connection]
kepstin has joined #ffmpeg-devel
MrZeus has joined #ffmpeg-devel
ccawley2011 has joined #ffmpeg-devel
ccawley2011_ has joined #ffmpeg-devel
MrZeus_ has joined #ffmpeg-devel
MrZeus has quit [Ping timeout: 252 seconds]
ccawley2011 has quit [Ping timeout: 260 seconds]
MrZeus_ has quit [Ping timeout: 260 seconds]
LainExperiments has quit [Changing host]
LainExperiments has joined #ffmpeg-devel
Traneptora has quit [Quit: Quit]
mkver has quit [Ping timeout: 272 seconds]
microlappy has joined #ffmpeg-devel
microlappy has quit [Client Quit]
rvalue- has joined #ffmpeg-devel
rvalue has quit [Ping timeout: 252 seconds]
rvalue- is now known as rvalue
b50d has joined #ffmpeg-devel
jamrial has joined #ffmpeg-devel
zip6como has quit [Quit: Adiòs]
b50d has quit [Remote host closed the connection]
zip6como has joined #ffmpeg-devel
b50d has joined #ffmpeg-devel
b50d has quit [Remote host closed the connection]
martin__-- has joined #ffmpeg-devel
<martin__--> Hi, when executing make I run into the following issue: CC=/c/opt/gcc-7.1/bin/gcc CXX=/c/opt/gcc-7.1/bin/g++ ../ffmpeg-2.8.22/configure --enable-nonfree --disable-doc --disable-manpages --enable-shared --extra-libs="-lpthread -lm" --enable-gpl
LainExperiments has quit [Quit: Client closed]
<martin__--> make doc/Makefile:182: no file name for `-include' `doc/Makefile:182: no file name for -include` `Makefile:127: no file name for -include` `tests/api/Makefile:9: no file name for -include` `tests/Makefile:232: no file name for -include` `make: *** No rule to make target libavdevice/libavdevice.so, needed by ffmpeg_g. Stop.` `debian-sparc:~/ffmpeg-2.8.22# cd ..`
<jamrial> this channel is for development. usage questions go to #ffmpeg
Traneptora has joined #ffmpeg-devel
iive has joined #ffmpeg-devel
b50d has joined #ffmpeg-devel
HarshK23 has quit [Quit: Connection closed for inactivity]
<llyyr> elenril: vf_libplacebo causes a segfault since 8160178dfc0e6bdaacf80dec58e595a9d595eedc
<llyyr> reproducible with ffmpeg -i in -init_hw_device vulkan -vf libplacebo out
<llyyr> cc haasn ^
b50d has quit [Remote host closed the connection]
tufei_ has joined #ffmpeg-devel
tufei__ has quit [Ping timeout: 260 seconds]
<Daemon404> blimey
* Daemon404 zzz
Krowl has joined #ffmpeg-devel
martin__-- has quit [Quit: Leaving]
<elenril> > This is how ffmpeg came to support ProRes and DNxHD, Apple and Avid paid for the support to be added.
<elenril> llyyr: can you get a backtrace?
<llyyr> elenril: https://0x0.st/XGvT.txt
<elenril> weird
<elenril> I'll try to have a closer look tomorrow
<thardin> reading up on the VP8/9 MIME spec. VP8 has levels?
<thardin> ffprobe says level=-99 for a VP8 file encoded with libvpx
<llyyr> FWIW simply reverting that commit on top of master also fixes the issue
<elenril> that would be Wrong though
<thardin> pal: as long as it isn't wildly different it's probably fine
tufei_ has quit [Remote host closed the connection]
tufei has joined #ffmpeg-devel
<thardin> seems like type="video/webm; codecs=&quot;vp9, opus&quot;" is also an acceptable way to specify codecs, not just that cumbersome four-part MIME thing for vp8/9
<thardin> and similarly with vp8+vorbis
Krowl has quit [Read error: Connection reset by peer]
<thardin> why do so few codecs use general purpose compressors? I remember fiddling with lossless compression and just tossing a transformed file at gzip and/or bzip2 easily beat flac
tufei has quit [Remote host closed the connection]
tufei has joined #ffmpeg-devel
<johnny__> I might end up in the hospital after 1.5 days of trying to figure this out in the code: What the heck does -maxrate do in ffmpeg? Nobody seems to know. I say that because everyone gives conflicting answers. Take this example: -b:v 3M -maxrate 6M -bufsize 12M. This tells ffmpeg to monitor libx264 to aim for 3Mbit (b:v). But after this, everyone's explanations fall apart. The -bufsize is the size of the variable bitrate buffer. But
<johnny__> after that, nobody seems to know.
<johnny__> Here's what I think: FFmpeg will attempt to hit the b:v bitrate. It will collect data in the -bufsize. When -bufsize is full, it will divide the size by the length of time inside the buffer to find out what the average bitrate was for that time period, and will adjust it up/down to aim at the b:v target.
cone-566 has joined #ffmpeg-devel
<cone-566> ffmpeg Michael Niedermayer master:ebffb8b68efc: avcodec/ffv1enc: Tighter maxsize
<cone-566> ffmpeg Michael Niedermayer master:df00705e0010: INSTALL: explain the circular dependency issue and solution
<johnny__> How does -maxrate act? Does it constantly monitor the current bitrate and instantaneously detect spikes before the -bufsize has completely filled? Or does it only enforce -maxrate when -bufsize is full?
<johnny__> And lastly, doesn't -maxrate 6M mean that the stream could permanently sit at 6 Mbit instead of -b:v's 3 Mbit?
<llyyr> depends on the codec used, also this isn't the user help channel
<llyyr> s/codec/encoder
<johnny__> Well I'm a developer, working on an open source streaming tool that will use FFmpeg. And I don't trust the users answers since everyone has conflicting answers about this. Literally 1.5 days of research so far.
<johnny__> The encoder is libx264.
<johnny__> The core questions that everyone has different answers to are: Is -maxrate instantaneously enforced or only when -bufsize is full (when each chunk checks the average bitrate). And how does -maxrate interact with -b:v to ensure that we don't sit at -maxrate permanently?
<llyyr> -maxrate is the upper limit on the bitrate for the bufsize you set, according to the docs
darkapex has quit [Remote host closed the connection]
darkapex has joined #ffmpeg-devel
<johnny__> Thanks for checking. Yeah I've read those docs, and the wiki pages about streaming, and about 50 stackoverflow questions, and tried to figure it out in the source hehe. Nowhere does it say how it's enforced. All I know for sure is that -maxrate requires -bufsize to also be set, so they are intimately linked.
<jkqxz> Maxrate defines how fast the data is added to the HRD (VBV) buffer.
<jkqxz> It's the fixed channel bitrate which must be maintained to avoid any skipping if you follow the HRD buffering model.
<jkqxz> The encoder understands the model and ensures that the result follows the constraints of the model.
<johnny__> Hmm sounds interesting, this is the first time I hear that explanation. Here's the best references but none were clear: https://ffmpeg.org/ffmpeg-codecs.html https://trac.ffmpeg.org/wiki/EncodingForStreamingSites https://trac.ffmpeg.org/wiki/Limiting%20the%20output%20bitrate
<johnny__> They all say that -maxrate is the maximum output rate (bandwidth/bitrate). And that it requires -bufsize to be set too (recommended value: 2x maxrate). But none say how it's enforced.
<johnny__> Oh and the point is that `-b:v` sets the target, but that `-maxrate` allows the average target rate to be exceeded during scenes that are extra complex.
<johnny__> But where it falls apart for me is how is -maxrate enforced? It's clearly intimately linked to having a -bufsize (it won't work without it, according to docs).
<jkqxz> "how it's enforced" is not really a meaningful question. The encoder ensures that the stream stays within the bounds of the HRD buffer.
<jkqxz> (Doesn't overflow or underflow.)
<johnny__> 1. Is it enforced frame by frame, or when bufsize is full? The normal -b:v is only enforced/changed when bufsize is full. It uses each bufsize chunk to see what the target compression amount needs to be adjusted towards. 2. What prevents -maxrate from always pegging at maxrate? Is it going to be driving towards -b:v at all times and -maxrate is just headroom during complex scenes?
<johnny__> I saw warnings that if -b:v and -maxrate is the same value, the encoder can freak out and push the brakes on complex scenes that rapidly fill the -bufsize, leading to blockiness. So I was thinking that our default formula for users should be: -b:v user target, -maxrate: 1.2 x b:v, -bufsize: 2x maxrate.
<jkqxz> 1. The bounds only say that the HRD buffer doesn't overflow or underflow; a good encoder adjusts things earlier when it thinks it might be in danger (ideally with lookahead to see future stream complexity).
<jkqxz> 2. The encoder wants to hit the average rate over the whole stream within the HRD buffer constraint, pegging at maxrate is not that.
<johnny__> Thanks a lot, that really nails the explanation. The "a good encoder adjusts earlier" fits with a few of the conflicting answers I'd read. Thanks a lot. That clarifies that libx264 is susceptible to the "maxrate == b:v" sudden panics when complex scenes arrives, so we'll set maxrate to 20% more than b:v by default.
<johnny__> Thank you so much. You put an end to probably 20 hours of trying to figure this out. <3
<johnny__> I didn't want to bother you but every answer I found was different. :)
<jkqxz> Bitrate and maxrate the same means you have hard CBR, which is bound to do badly when the stream complexity changes (though with a large enough buffer size may be ok).
<jkqxz> I do suggest reading the HRD specification (H.264 annex C) if you want to understand how the maxrate constraint works (and therefore how it is intended to apply to streaming cases).
<johnny__> Yeah that's the warning I kept finding, so we'll avoid hard-CBR for the defaults. "maxrate=1.2x b:v" is not a lot extra but seems like a conservative way to help with those hard brakes.
<johnny__> Thanks for the spec information! <3
<johnny__> Oh and one minor thing... bufsize, we'll default to 2x maxrate since I kept seeing that on the ffmpeg wiki links above, regarding livestreaming. From what I understood, the general -b:v bitrate is re-adjusted every time bufsize fills up, so it seems like longer values avoid sudden quality fluctuations, while short-ish values (bufsize=2x maxrate) are needed to ensure we stay near target. Is this a sane default?
<jkqxz> If you have a streaming use-case then ask the question in the other direction.
<jkqxz> What channel rate can you maintain and how much delay in the stream can you tolerate?
<johnny__> Yeah. Bufsize didn't seem to introduce delay though? It was just about bitrate history analysis and re-adjustments?
<johnny__> We just want to ensure that the defaults keep the bitrate roughly around -b:v with allowed spikes to -maxrate.
<jkqxz> For best encode you set maxrate to infinity for completely free VBR. Any constraint is trading quality for streaming-friendliness.
<johnny__> Yeah, that makes sense. Just trying to hit some sane default constraints. Looks like we'll default to "-b:v user target, -maxrate: 1.2 x b:v, -bufsize: 2x maxrate".
<jkqxz> Buffer size is setting the buffering delay (buffering delay == buffer size / maxrate).
<johnny__> Oh. Hehe. Saw a bunch of people saying it had no effect on latency and only controlled the size of the buffer that analyzes historical bitrates for re-adjustment. It's news to me that it actually controls an output buffer delay.
<johnny__> Heck even the wiki says `-bufsize specifies the decoder buffer size, which determines the variability of the output bitrate` at https://trac.ffmpeg.org/wiki/Limiting%20the%20output%20bitrate
<johnny__> Decoder buffer. Hmm. Wait, is that referring to the playback device's decoder? Then it would be a latency after all.
<jkqxz> Though also consider -rc_init_occupancy, which is the initial delay before you can start playing from the buffer (which can be less than the whole buffer if the encoder knows that it can fill it up later).
<jkqxz> Yes, all of these numbers are defined from the perspective of the buffering on the decoder.
Kei_N has quit [Read error: Connection reset by peer]
Kei_N has joined #ffmpeg-devel
<johnny__> Ahh. That explains a lot. Thanks for `-rc_init_occupancy` too. We have about 2 seconds time-to-picture at the moment and can probably get this down thanks to this advice. :) Smaller bufsize, maybe 1.5x maxrate. And smaller -g GOP. And will explore -rc_init_occupancy.
<johnny__> Last question, I swear, but it just hit me: We've been wondering if scene change detection in libx264 is good or bad while streaming? More I-frames = better quality and sooner picture. But more bitrate usage. Hmm.
<jkqxz> Do you have periodic intra pictures already?
<johnny__> Yeah, if you are referring to GOP, which is currently forced at -g 50 (have been afraid to lower it due to full frame bitrate usage)
<jkqxz> The point of scene change detection is to truncate a GOP on a picture which has no good reference (will be encoded to a size which is close to an intra picture anyway) in order to save having to insert an intra picture later.
<jkqxz> If you have a fixed GOP anyway (because of stream fragments or whatever) then it is actively harmful.
<johnny__> Ahh so encoding big scene changes without I-frames is roughly the size of an I-frame...
<johnny__> But with our fixed GOP I guess it means we'd waste space anyway since the fixed GOP interval would always be inserted anyway.
<johnny__> So we'll turn off scene change detection. Thanks a lot.
<johnny__> That's it. I appreciate it so much. Too many days trying to find answers on the wiki and stackoverflow and finding exactly opposite explanations from different people. I was on the brink of breaking down. :D
<johnny__> Oh I just realized what you meant: Scene change detection forcing truncation of the current GOP would mean that the streaming chunks become malformed/shorter than intended. *That's* how it's harmful. Makes sense now.
LainExperiments has joined #ffmpeg-devel
<jkqxz> Either that or you have an intra frame later at the fixed location anyway and the stream is larger than it otherwise could be, yes.
<johnny__> Ah. So that happens too. I thought a truncated GOP would just mean that the counter restarts, so it might go: GOP=50, GOP=33 (scene change), GOP=50, GOP=50, etc. But sounds like it always uses the fixed `-g` interval even when scene changes truncated the current GOP?
<jkqxz> Yeah, it can use either form depending on options.
<jkqxz> For encoding to a file where GOP size is setting the seek interval there is no penalty to an extra seek point and so you want the form you said, but fragment cases generally want the opposite so they are fixed length.
Krowl has joined #ffmpeg-devel
<johnny__> Makes sense. I also finally understood the -bufsize thanks to you and re-reading the two ffmpeg wikis. It's the memory allocation on the decoder and is also used by the encoder for analysis of what frames will be in the decoder's buffer, so a larger buffer allows the encoder to do various optimizations such as repeated frame detection. And longer values also allow more bitrate spikes during complex scenes (but never higher than `-
<johnny__> maxrate`). It's all coming together now.
<johnny__> And as you mentioned, a longer buffer increases decoder latency. Not sure how though, since I-frames can be displayed instantly and independently, and everything after that can be decoded in realtime. Unless you meant that bufsize leads to some extra latency in terms of milliseconds due to more complex encoding frame references/larger buffer. Hehe.
<johnny__> Mmm. I just tried a quick `-b:v 3500k -maxrate 3500k -bufsize 350000k` for fun and it didn't cause any noticeable decoder latency.
<johnny__> So that's good, I won't have to fear that bufsize will introduce seconds of delay.
<johnny__> From what I can see then, `-bufsize` just affects the encoder's interval for when it adjusts the target bitrate, the usage of some encoding optimizations, and the potential memory usage on the decoder side.
LainExperiments has quit [Quit: Client closed]
<fflogger> [editedticket] sramacher: Ticket #11258 ([undetermined] 7.1 regression: illegal instruction on riscv64) updated https://trac.ffmpeg.org/ticket/11258
Workl has joined #ffmpeg-devel
<Sebastinas> jamrial, courmisch: Added more context to #11258. git bisect suggests that the regression was introduced in 324899b7483529c336f399022c63721df14663ef.
Krowl has quit [Ping timeout: 255 seconds]
Krowl has joined #ffmpeg-devel
Sebastinas has quit [Quit: -]
Sebastinas has joined #ffmpeg-devel
Workl has quit [Ping timeout: 260 seconds]
Workl has joined #ffmpeg-devel
Krowl has quit [Ping timeout: 255 seconds]
mkver has joined #ffmpeg-devel
Krowl has joined #ffmpeg-devel
Workl has quit [Ping timeout: 252 seconds]
Krowl has quit [Ping timeout: 260 seconds]
kmikita has quit [Ping timeout: 252 seconds]
cone-566 has quit [Quit: transmission timeout]
kmikita has joined #ffmpeg-devel
ccawley2011_ has quit [Read error: Connection reset by peer]
<johnny__> Hmm. There is debate (even in FFmpeg's own wiki) about whether `-bufsize` should be 2x `-maxrate` or `-b:v`. It makes more sense to me that it should be based on `-b:v` since that's the average rate we are aiming for. We aren't aiming for constant peaks. And "2x b:v" is also what Intel recommends.
<johnny__> I've read the HRD description so b:v is the only answer that makes sense to me, since the goal of the HRD buffer is to be exactly half-full, so `-b:v` seems like the correct reference.
System_Error has quit [Remote host closed the connection]
System_Error has joined #ffmpeg-devel