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
lullerhaus has joined #ffmpeg
lucasta has quit [Quit: Leaving]
iive has quit [Quit: They came for me...]
\\Mr_C\\ has quit [Remote host closed the connection]
Mister_D has quit [Ping timeout: 272 seconds]
<aaabbb>
scale2ref is deprecated, in favor of scale=rw:rh. what are the differences? scale2ref seems to take 2 inputs and gives 2 outputs, but scale=rw:rh only gives one output
<aaabbb>
am i supposed to use split to duplicate a stream so that scale doesn't consume the only copy?
MightyBOB has joined #ffmpeg
<aaabbb>
with scale2ref i could: "[in1][in2]scale2ref,concat[out]" but it seems like now i have to do something like "[in1]split[in1a][in1b];[in1a][in2]scale=rw:rh[out1];[in2][out1]concat[out]"
lucasta has joined #ffmpeg
MisterMinister has joined #ffmpeg
sadome has quit [Remote host closed the connection]
Suchiman has quit [Quit: Connection closed for inactivity]
SystemError has quit [Ping timeout: 260 seconds]
SystemError has joined #ffmpeg
emmanuelux has joined #ffmpeg
minimal has quit [Ping timeout: 260 seconds]
Tano has quit [Quit: WeeChat 4.2.1]
MisterMinister has quit [Ping timeout: 268 seconds]
emmanuelux has quit [Quit: au revoir]
mrelcee has quit [Ping timeout: 272 seconds]
<aaabbb>
also, how can i start troubleshooting a problem with expression evaluation? "eq(mod(n,1200),0)" works fine to evaluate true once every 1200 frames, but i can't seem to get it to work with time, like doing eq(mod(t,5),0) does not seem to evaluate true every 5 seconds
lucasta has quit [Remote host closed the connection]
waleee has quit [Ping timeout: 240 seconds]
<kepstin>
aaabbb: you'll have to better describe what you want to do. it's entirely possible that at the framerate of the video, there's no frame at _exactly_ 5 seconds, only ones slightly before or slightly after, so the expression is simply never true.
<aaabbb>
kepstin: i want to change the location of drawtext, once every 5 seconds. drawtext=text='hello world':x=1234:y=if(eq(mod(t,5),0),rand(0,(h-text_h)),y)
<aaabbb>
what that should do is change the horizontal position to a random position, once every 5 seconds. it works fine with eq(mod(n,30),0) if the fps is 30, but that only works with cfr
<aaabbb>
i've tried floor(t) instead of t but then of course it will evaluate true for every single frame in that second (which is not what i want)
<kepstin>
yeah, the way that's structured isn't gonna work. hmm.
<kepstin>
ideally, you really want to figure out a way to make a function that given an input time t, returns the vertical position, _without_ referencing the current vertical position.
<aaabbb>
i'm wondering if something with with st() and ld() might work? since that can store a variable across frames i think
<kepstin>
the other option would be to make use of the fact that the random function can use a seed that you can set; set the seed to something like "floor(t / 5)" to have it change every 5 seconds.
<aaabbb>
is that via random()?
<kepstin>
so "y=st(0,floor(t/5));randomi(0,0,(h-text_h))" maybe
<aaabbb>
randomi->random you mean?
<kepstin>
no, "randomi" specifically is the function that uses a random seed from a variable and returns a number in a range.
<aaabbb>
ah ok
<aaabbb>
and that stores it into variable "0"?
<kepstin>
the "st" stores a number that increments every 5 seconds into the variable 0, then the "randomi" uses the seed from variable 0 to pick a number from "0" to "(h-text_h)".
<kepstin>
note that this will provide the same sequence of positions every time it is run.
<aaabbb>
so far that seems to be working
<aaabbb>
where is the documentation for randomi? i don't see it in ffmpeg-filters or ffmpeg-utils
<aaabbb>
i'm not quite sure how to get that to work with both x and y
<aaabbb>
oh i see, mine is just outdated (i'm using btbn build but was using the local manpage)
<aaabbb>
so how would i get this to work with both x and y?
<kepstin>
the x should be exactly the same, except you use "w-text_w"… tho since you'd be using the same seed for both y and x i'm not sure if that would cause a problem.
<kepstin>
could always do something like "st(0,floor(t/5)+12345);" where you replace 12345 with a different (large, random) number for x and y so they give you different random sequences.
<aaabbb>
well i presumably can use st(0 and st(1 right?
<aaabbb>
for two sequenes?
<kepstin>
they're different expressions, so they don't share the same variables
<aaabbb>
i'm trying to figure out how to get x in there as well
<kepstin>
well, yeah, you didn't pick a random value for x
<kepstin>
"x=st(0,floor(t/5));randomi(0,0(w-text_w))" and "y=st(0,floor(t/5));randomi(0,0,(h-text_h))"
<aaabbb>
i'm clearly misunderstanding
<aaabbb>
oh, the ; is throwing me off
<kepstin>
ah, i don' know if that needs special escaping
<aaabbb>
ok i got it with "color=white,drawtext=text=test:x='st(0,floor(t/5));randomi(0,0,(w-text_w))':y='st(0,floor(t/5));randomi(0,0,(h-text_h))'"
<aaabbb>
of course x and y are always the same here, i'll try the +12345
<aaabbb>
ok i don't think that's doing what i expected it to do, having floor(t/5)+12345
<aaabbb>
oh, another problem with escaping, sorry
<aaabbb>
how large does the offset that i replace 12345 have to be? if this is the index for random numbers, it just has to be large enough that it has to be more than the number of random movements?
<furq>
depends on the rng but probably not big at all
<kepstin>
just has to be large enough that you don't notice the repeat from the x to the y
<furq>
your main problem is how to get it in there with all those single quotes
<kepstin>
which, honestly, you could probably get by with anything >20 or so ;)
<aaabbb>
so the shell's $RANDOM should be enough?
<furq>
yes
<aaabbb>
since i don't want the two random values to be close to each other, is it enough to do rand1=$RANDOM and have x use $rand1 and y use $rand1+1?
<aaabbb>
or do the two numbers have to not be close?
<kepstin>
the two numbers should be far apart; if they're too close, then the patterns of x and y movements might be close enough to be noticeable
<aaabbb>
so perhaps the first could be rand(100,150) and the second could be rand(200,250)?
<aaabbb>
oh, no that wouldn't work lol
<kepstin>
you need to provide an initial random value from outside ffmpeg to make my idea work.
<kepstin>
using using $RANDOM from the shell twice is probably fine; or you could use fixed value to make it repeatable if desired.
<aaabbb>
$RANDOM from the shell has the risk of the two results being very close to each other. when encoding thousands of videos, it's virtually guaranteed
<kepstin>
heck, you could hash the input file, take the first 128 bits of the hash and split it into two 64bit integers, and use those ;)
<aaabbb>
i guess what i need to know is how big the numbers need to be, and how far apart they have to be
<aaabbb>
so the first should be in range A,B, and the second in C,D. i need to know safe values for A, B, C, and D
<kepstin>
actually, there's probably a better way to make the x and y positions be not aligned. use the random number generator itself. try leaving x as it is, and set" y=st(0,floor(t/5));random(0);randomi(0,0,(h-text_h))"
<kepstin>
that'll take the first random number from the seed (which is what x used), discard it, then use the second random number from the seed for y.
<aaabbb>
ah, so then no need to hardcode certain values?
<kepstin>
only reason to hardcode an offset to the seed would be so different videos have different sequences of positions (and you could use the same number for both x and y)
<furq>
could you not just st in x and then call randomi in x and y
<kepstin>
i don't _think_ that works, since they're separately evaluated expressions? would have to check the filter to see if it uses the same expression context or whatever for them :/
<furq>
Note: variables are currently not shared between expressions.
<furq>
i guess not
<kepstin>
(and also to check which order they're evaluated in, since that would be meaningful then)
<kepstin>
there probably is some way to do this with stored variables that would work better than my suggestion with using a new random seed every 5 seconds, but it would likely be rather more complex.
<aaabbb>
so far i'm doing: :x='st(0,floor(t/5));randomi(0,0,(w-text_w))':y='st(0,floor(t/5));random(0);randomi(0,0,(h-text_h))'
<aaabbb>
this makes x and y independent?
<aaabbb>
they sure look it
<kepstin>
they're technically not independent, because it's a pseudo random number generator, but good enough.
<aaabbb>
as long as they're visibly independent
<aaabbb>
is there any way to make the sequence random for each invocation? perhaps storing a random number in a variable then adding it to floor(t/5)?
<kepstin>
to make it different for each invocation, you need to provide a number from outside ffmpeg
<kepstin>
i can't think of a reasonable way to do it in the expression
<aaabbb>
that's fine because i'm already doing that for another part of the filter (for a watermark)
Ox7C5 has joined #ffmpeg
beaver has quit [Remote host closed the connection]
<aaabbb>
if i set a random number manually for x, will that also affect y?
beaver has joined #ffmpeg
<kepstin>
no, they're calculated completely separately
<aaabbb>
so if i do :x='st(0,floor(t/5)+random_value);randomi(0,0,(w-text_w))':y='st(0,floor(t/5));random(0);randomi(0,0,(h-text_h))' then the x coordinates will be different for each invocation (assuming each invocation uses a new random_value), but the sequence of y coordinates will always be the same?
<furq>
yes
<aaabbb>
ok, now i just have to figure out the best way to either use a single seed to determine the sequence, or to have a new sequence for each invocation
Suchiman has joined #ffmpeg
sadome has quit [Remote host closed the connection]
<kepstin>
just add the same random value in both the x and the y expressions
<kepstin>
they're already set up so that with the same seed they produce different values
<aaabbb>
oh!
sadome has joined #ffmpeg
sadome has quit [Remote host closed the connection]
<aaabbb>
this is working perfect, thank you
Tinos has joined #ffmpeg
<noobaroo>
Hi aaabbb
<aaabbb>
hi noobaroo
<noobaroo>
Why sometimes at the end of an ffmpeg conversion, it hangs for like 2mins? I noticed just now when doing a 30sec cut, it finished encoding to the last fraction of a second, then just hung there for a good minute or two. The video played fine so idk what its doing during this time?
<noobaroo>
Also, is there any options for libsvtav1 to get better performance that I might not know about? Probably upwards of 90% of the time, libx265 has better quality detail and lower bitrate than libsvtav1
<aaabbb>
noobaroo: what parameters are you using for libsvtav1?
<kepstin>
depends on the ffmpeg version and video encoder in use, but the stats line in ffmpeg might just be counting frames that it has _sent_ to the encoder. encoders often buffer many frames internally for lookahead while they process, so at the end of the video it could take a while for it to finish encoding all the frames that it started.
<noobaroo>
According to some of the top Google results, Netflix gets bitrate savings (with av1 I think) with synthetic film grain. Film grain alone option in AV1 is actually slightly higher bitrate in every video I've tried (a small handful) but film grain + film grain denoise does reduce bitrate slightly
<aaabbb>
noobaroo: film grain denoise reduces bitrate because it's also removing detail
<aaabbb>
noobaroo: generally you want to use tune=0 for production (it's optimized for visual quality). preset 3 is quite slow, and crf 18 is veeeery low for av1
<aaabbb>
hmm it seems some filters i'm using remove color space/color matrix metadata
<aaabbb>
it's using the filters tpad, drawtext, fade
<kepstin>
and yes; for synthetic film grain the idea is that you remove any real film grain from the video so it compresses better, and then the decoder adds in a synthetic film grain to replace the grain that was removed.
<aaabbb>
kepstin: actually the most recent svtav1 no longer removes grain explicitly, because that turns out to often be worse
<kepstin>
the best use case for it is probably if the film grain is purely stylistic, and the original video was digital without any film grain. then you can encode the original video and add synthetic film grain :)
<aaabbb>
it's very good for anime where grain injection is often used in bluray releases to prevent banding
<noobaroo>
This gets better VMAF scores than AV1 at the CRF value (and looks better too) `ffmpeg -ss 10:00 -t 30 -i $V -vf scale=-1:1080 -pix_fmt yuv420p10le -c:v libx265 -tune psnr -crf 18 -g 300 -preset slow -c:a copy output.mp4`
<noobaroo>
What about for videos with lots of noise/compression artifacts, that are high bitrate and look like shit? There has to be a way to recreate the same image (basically) with like 1/10th of the bitrate
<aaabbb>
do you even have to tune for psnr when you're using vmaf?
<noobaroo>
It's more bitrate-efficient
<aaabbb>
huh? no it's not
<aaabbb>
psnr tune removes very important psychovisual optimizations
<noobaroo>
I have plenty of cases of 12mbps H264 videos that go up in file size with a x265 or av1 crf of 20, and then I have examples of 12mbps bitrate that go down to 2.5mbps
<aaabbb>
you shouldn't be measuring bitrate like that
<aaabbb>
you can't compare crf across different settings (much less encoders)
<noobaroo>
And more often than not, the ones that go down often are way more clear than the ones that stay the same or go up
<noobaroo>
Measuring bitrate is the entire reason I am on this channel
<aaabbb>
you can't say that lower bitrate = better
<aaabbb>
you'll get a lower bitrate using x265 ultrafast than x265 veryslow, but that's meaningless
<aaabbb>
try using 2pass abr with the same bitrate, and compare quality that way
<noobaroo>
And I know CRF is not the same across encoders, but what I am saying is libx265 is far superior to libsvtav1 in the majority of cases I have tested, and according to the entire internet AV1 should be better
<aaabbb>
which means you're doing something wrong. have them encode at the exact same bitrate, and then compare
<noobaroo>
I've seen claims from seemingly reputable sources saying AV1 can get up to 25-50% higher bitrate savings than H265
<aaabbb>
well 25-50% is a bit much, but it's certainly not going to be worse unless you're doing something wrong
<furq>
the magic word is can
<noobaroo>
Also aaabbb I am very glad you are here
<noobaroo>
I've been trying to reach you occasionally over the last few weeks
<aaabbb>
try 2pass abr with x265 and with svt-av1
<aaabbb>
why me? there are far more knowledgable people here
<noobaroo>
ffmpeg doesn't support 2 pass using svtav1 last I heard
<aaabbb>
svt-av1 is its own program, when testing you don't need to use ffmpeg
<noobaroo>
Anyway, I know it's possible to achieve the results that I think are reasonable (compared to similar or often much higher quality videos with lower bitrate) but it's probably only achievable with AI like Topaz AI or something
<aaabbb>
nah
<aaabbb>
topaz ai kinda crap imo
<noobaroo>
I don't really know how to use standalone svtav1
<aaabbb>
anyway there's a lot that you can do with libsvtav1 that isn't the default, enable-qm=1:enable-variance-boost=1:tune=0
<noobaroo>
How does it even decode h264? Do I need to use ffmpeg to convert to raw video first?
<noobaroo>
tune=0 can be done on ffmpeg, idk about the others
<aaabbb>
via -svtav1-params
<noobaroo>
I want to convert VR porn to normal video but nothing I try can take away the fisheye effect properly without severely cropping the image and only showing the center, which basically only the edges of fisheye really look warped, so it's really easier to just crop in that case
<noobaroo>
I have tried different filters such as lenscorrection, fisheye, dfisheye, equirect, and equisolid, with and without cropping it in half simultaneously, and I can't get it anywhere close to perfect.
<noobaroo>
Theoretically I should be able to get the FOV perfectly normal, the only catch should be detail loss when stretching squished edges back to normal size
<noobaroo>
WITHOUT cropping.\
<noobaroo>
The video I'm trying to convert has VR180 in the title. Online, I've also seen some VR200 ones but most seem to say VR180. I tried finding the model of camera used by the company but I am unable
<noobaroo>
But the fisheye effect is constant and measurable, there is a constant equation that literally doesn't change ever (AFAIK) This really shouldn't be that hard to do. Literally the only drawback should seriously be less detail around the edges and more detail in the middle (in the final product)
beaver has quit [Remote host closed the connection]
beaver has joined #ffmpeg
Traneptora has quit [Quit: Quit]
Livio has quit [Ping timeout: 252 seconds]
ossifrage has joined #ffmpeg
stolen has quit [Quit: Connection closed for inactivity]
Ox7C5__ has joined #ffmpeg
Tinos has joined #ffmpeg
le_patenteux has quit [Ping timeout: 268 seconds]
hightower4 has quit [Ping timeout: 268 seconds]
xx has quit [Remote host closed the connection]
ossifrage has quit [Remote host closed the connection]
Magissia has quit [Ping timeout: 252 seconds]
beaver_ has joined #ffmpeg
beaver has quit [Remote host closed the connection]
j45 has quit [Ping timeout: 260 seconds]
j45 has joined #ffmpeg
beaver_ has quit [Remote host closed the connection]
Juest has quit [Ping timeout: 268 seconds]
xx has joined #ffmpeg
beaver has joined #ffmpeg
ossifrage has joined #ffmpeg
contrapunctus has joined #ffmpeg
Juest has joined #ffmpeg
Traneptora has joined #ffmpeg
a0z has quit [Quit: Leaving]
kasper93 has quit [Ping timeout: 240 seconds]
jagannatharjun has joined #ffmpeg
kasper93 has joined #ffmpeg
AbleBacon has joined #ffmpeg
Magissia has joined #ffmpeg
kasper93 has quit [Ping timeout: 246 seconds]
kasper93 has joined #ffmpeg
Tinos has quit [Ping timeout: 250 seconds]
Tinos has joined #ffmpeg
lavaball has quit [Remote host closed the connection]
hightower2 has joined #ffmpeg
todi has joined #ffmpeg
Tinos has quit [Ping timeout: 250 seconds]
Tinos has joined #ffmpeg
waleee has joined #ffmpeg
coldfeet has joined #ffmpeg
vlm has joined #ffmpeg
Narrat has joined #ffmpeg
waleee has quit [Ping timeout: 268 seconds]
Ox7C5__ has quit [Quit: Lost terminal]
beaver has quit []
beaver has joined #ffmpeg
beaver has quit [Client Quit]
beaver has joined #ffmpeg
beaver has quit [Remote host closed the connection]
beaver has joined #ffmpeg
beaver_ has joined #ffmpeg
beaver has quit [Remote host closed the connection]
lavaball has joined #ffmpeg
rv1sr has joined #ffmpeg
Livio has joined #ffmpeg
beaver_ has quit [Remote host closed the connection]
emmanuelux has joined #ffmpeg
beaver has joined #ffmpeg
Tinos has quit [Ping timeout: 250 seconds]
waleee has joined #ffmpeg
nillyhan has quit [Quit: read bokuyaba]
nillyhan has joined #ffmpeg
Vonter has quit [Ping timeout: 252 seconds]
Vonter has joined #ffmpeg
<DeHackEd>
is there a reason the audio track in an MP4 forces its time_base to be 1 / sample_rate ? Video doesn't have this kind of thing enforced, but audio does.
<JEEB>
that reminds me that the separate options for the timescales for video etc should just be removed as the time base should just be set'able in general -_-
militantorc has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
<JEEB>
DeHackEd: I guess it was considered that the sample rate should be exact enough. technically I would not disagree that you could attempt to set some other time base and then that could be utilized, but the usefulness of that is generally pretty limited methinks?
pikapika has joined #ffmpeg
Narrat has quit [Quit: They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.]
<DeHackEd>
having come from MPEGTS where everything was consistent at 1/90_000 having separate PTS values for all streams makes me feel dirty....
<DeHackEd>
sure, I can easily correct for it and it's probably better this way overall, but I feel like it'll make things harder in some way down the line
<JEEB>
and then if you look the other way try looking at how 24/1.001 ends up being with 1:90000 :P
contrapunctus has left #ffmpeg [#ffmpeg]
<DeHackEd>
mostly the issue has been that 60/1.001 is okay at 1:180k but not 1:90k
<JEEB>
there's in various projects the nice logic to look at the jitter of dts/pts growth to figure out 24/1.001 in 1:90k
<JEEB>
but yea I guess if you are very used at only having a static time base then having a freeform one can feel weird
<JEEB>
I think FLV's 1:1000 is even "better" than MPEG-TS's 1:90k :P
<JEEB>
and then you have stuff that goes remuxed through FLV *and* MPEG-TS
* DeHackEd
walks into a corner and enters the fetal position
coldfeet has quit [Remote host closed the connection]
Blacker47 has quit [Quit: Life is short. Get a V.90 modem fast!]
Livio has quit [Ping timeout: 240 seconds]
beaver has quit [Quit: (-) /channel remove #linux-offtopic Libera </idiotie>]
rv1sr has quit []
beaver has joined #ffmpeg
intrac2 has joined #ffmpeg
intrac has quit [Ping timeout: 268 seconds]
todi has quit [Remote host closed the connection]
Haxxa has quit [Quit: Haxxa flies away.]
Haxxa has joined #ffmpeg
todi has joined #ffmpeg
todi has quit [Remote host closed the connection]
todi has joined #ffmpeg
lavaball has quit [Remote host closed the connection]
beaver has quit [Ping timeout: 260 seconds]
beaver_ has joined #ffmpeg
kasper93 has quit [Ping timeout: 252 seconds]
Magissia has quit [Ping timeout: 252 seconds]
kilobyte_ch has quit [Read error: Connection reset by peer]
MrZeus has joined #ffmpeg
jagannatharjun has quit [Quit: Connection closed for inactivity]
bitbinge has quit [Quit: bitbinge]
todi has quit [Remote host closed the connection]
e^pi-1 has joined #ffmpeg
ivanich has joined #ffmpeg
MrZeus_ has joined #ffmpeg
MrZeus has quit [Ping timeout: 260 seconds]
vlm has quit [Quit: Leaving]
sadome has joined #ffmpeg
e^pi-1 has quit [Quit: WeeChat 4.2.2]
sadome has quit [Remote host closed the connection]
sadome has joined #ffmpeg
MisterMinister has joined #ffmpeg
sadome has quit [Remote host closed the connection]
sadome has joined #ffmpeg
sadome has quit [Remote host closed the connection]
sadome has joined #ffmpeg
e^pi-1 has joined #ffmpeg
sadome has quit [Remote host closed the connection]
MisterMinister has quit [Remote host closed the connection]
AbleBacon has quit [Read error: Connection reset by peer]
AbleBacon has joined #ffmpeg
kasper93 has joined #ffmpeg
iive has joined #ffmpeg
five61848033 has quit [Remote host closed the connection]
five61848033 has joined #ffmpeg
Traneptora has quit [Quit: Quit]
Traneptora has joined #ffmpeg
SystemError has quit [Remote host closed the connection]
SystemError has joined #ffmpeg
beaver_ has quit []
SuicideShow has quit [Ping timeout: 268 seconds]
SuicideShow has joined #ffmpeg
psykose has joined #ffmpeg
SystemError has quit [Ping timeout: 260 seconds]
e^pi-1 has quit [Quit: WeeChat 4.2.2]
e^pi-1 has joined #ffmpeg
ivanich has quit [Read error: Connection reset by peer]
ivanich has joined #ffmpeg
ivanich has quit [Remote host closed the connection]
darkapex has quit [Remote host closed the connection]