Closed birdie-github closed 1 year ago
Don't use y4m, its a bad format and the world would be better off without it ;)
But jokes aside. How is 59.94 represented in a Y4M header? And what is this strange tickspersec? Why are you using 11771760?
Don't use y4m, its a bad format and the world would be better off without it ;)
What should I pipe to vvenc then?
But jokes aside. How is 59.94 represented in a Y4M header? And what is this strange tickspersec? Why are you using 11771760?
I've shown you ffprobe output, I've no idea how to get this info for you. As for this huge number I found it here: https://github.com/facebookarchive/Flicks/issues/3
It would be great if https://github.com/fraunhoferhhi/vvenc/wiki/Usage contained an example how to prepare a video for transcoding in vvenc.
AFAIK y4m and yuv are the same format except the former includes a header with video parameters, while yuv is simply a raw format where you need to specify all the video parameters manually which is prone to errors.
Don't use y4m, its a bad format and the world would be better off without it ;)
What should I pipe to vvenc then?
Just use raw yuv and specify the metadata manually using our syntax (i.e. --fps 60000/1001).
Or use proper transcoding:
But jokes aside. How is 59.94 represented in a Y4M header? And what is this strange tickspersec? Why are you using 11771760?
I've shown you ffprobe output, I've no idea how to get this info for you. As for this huge number I found it here: facebookarchive/Flicks#3
Lol, this doesn't mean nothing. For what I know, this might be ffmpeg using a default value. Try head -n 1 your_file.y4m
or pipe_with_y4m | head -n 1
.
The header for y4m is:
YUV4MPEG2 W1920 H1080 F19001:317 Ip A1:1 C420jpeg XYSCSS=420JPEG XCOLORRANGE=LIMITED
FRAME
I see. 19001:317 is not the standard framerate used for 59.54. Please change it to 60000:1001. Than it should work just fine.
Here's the last question: the source video is yuv420p. vvenc works with yuv420, right?
How should I go about converting yuv420p to yuv420?
VVenCs yuv420 is FFmpegs yuv420p (and VVenC yuv420_10 is FFmpegs yuv420p10le). Don't worry about that, you're good here.
I see. 19001:317 is not the standard framerate used for 59.54. Please change it to 60000:1001. Than it should work just fine.
Maybe you could fix this, please? Mustn't be too difficult. Lots of videos on the Internet use this frame rate.
It's up to you to decide :-)
I've shown you ffprobe output, I've no idea how to get this info for you. As for this huge number I found it here: facebookarchive/Flicks#3
That's why you have an error. Because in your file 59.94 is represented as 19001:317, the 11771760 is not the common multiple for those. You have to fine the lowest common nominator for 19001 and 317 and use this as tickspersec. The 11771760 was designed for 60000:1001 as you can see in the link you provided.
I see. 19001:317 is not the standard framerate used for 59.54. Please change it to 60000:1001. Than it should work just fine.
Maybe you could fix this, please? Mustn't be too difficult. Lots of videos on the Internet use this frame rate.
It's up to you to decide :-)
I actually think VVenC works just right here. If you are using funny (i.e. non-standard) frame rate representations, it's up to you to find proper parametrization. We might just look into letting the encoder find the lowest common nominator tho.
Wait... no. Forget the lowest common nominator. I need to research more how the tickspersec works. For now, just use standard time representations...
Meanwhile:
https://www.wolframalpha.com/input/?i=LCM%2819001%2C317%29
6023317
19001 is prime
317 is prime
Did you try encoding with --tickspersec 6023317
? Should work. Otherwise --tickspersec 19001
should also work.
vvencapp --preset slower --qp 24 --tickspersec 6023317 -i output.yuv --output=bit.266-test
vvencapp: Fraunhofer VVC Encoder ver. 1.7.0 [Linux][GCC 11.3.0][64 bit][SIMD=AVX2]
Parameter Check Error: TicksPerSecond should be a multiple of FrameRate/Framescale. Use 27000000 for NTSC content
The same error with 19001
.
And --tickspersec -1
?
-1 worked:
vvencapp --preset slower --qp 24 --tickspersec -1 -i output.yuv --output=bit.266-test
vvencapp: Fraunhofer VVC Encoder ver. 1.7.0 [Linux][GCC 11.3.0][64 bit][SIMD=AVX2]
Input File : output.yuv
Bitstream File : bit.266-test
Real Format : 1920x1080 yuv420p 60 Hz SDR 12372 frames
: encode 12372 frames
Rate Control : QP 24
CODING TOOL CFG: CTU128 QT44BTT3333332 IBD:1 SAO:1 ALF:1 (NonLinLuma:1 NonLinChr:1) CCALF:1 Tiles:1x1 Slices:1 WPP:0 WPP-Substreams:1 TMVP:1 DQ:1 SDH:0 CST:1 BDOF:1 DMVR:1 MTSImplicit:0 SBT:1 JCbCr:1 CabacInitPresent:0 AMVR:1 SMVD:1 LMCS:2 (Signal:SDR Opt:0) CIIP:1 MIP:1 AFFINE:1 (PROF:1, Type:1) MMVD:1 DisFracMMVD:1 SbTMVP:1 GPM:1 LFNST:1 MTS:1 (IntraCand:3) ISP:1 TS:2 TSLog2MaxSize:5 useChromaTS:0 BDPCM:2 IBC:2 BCW:2
ENC. ALG. CFG: QPA:1 HAD:1 RDQ:1 RDQTS:1 ASR:1 MinSearchWindow:96 EDO:2 MCTF:2 BIM:1
PRE-ANALYSIS CFG: STA:1 LeadFrames:0 TrailFrames:0
FAST TOOL CFG: ECU:0 FEN:3 FDM:1 FastSearch:1 (SCC:2) LCTUFast:1 FastMrg:1 PBIntraFast:1 AMaxBT:0 FastQtBtEnc:1 ContentBasedFastQtbt:0 FastMIP:0 FastIntraTools:0 IntraEstDecBit:1 FastLocalDualTree:1 IntegerET:0 FastSubPel:0 ReduceFilterME:2 QtbttExtraFast:1 FastTTSplit:1 IBCFastMethod:1 FIM:0 ALFSpeed:0 QuantThr: 4
RATE CONTROL CFG: RateControl:0 QP:24 LookAhead:0
PARALLEL PROCESSING CFG: NumThreads:8 MaxParallelFrames:4 WppBitEqual:1 WF:0
started @ Tue Mar 14 08:51:43 2023
Ctrl+C
I see what happens. Apparently our y4m parses ignores fractional frame rates (thats why you see 60Hz). We'll fix that. Thanks.
While we are at it, the informational header doesn't include framerate - would be great if you showed/included it.
It does. See the 60 Hz
info.
I hoped I'd deleted my comment fast enough you wouldn't see it. Sorry :-) Yeah, I noticed it a few seconds later.
Please don´t use '--tickspersec -1' as it will internally produce 60Hz, as -1 will use ticksPerFrame=1
Both suggestions from @adamjw24 are working properly:
--tickspersec 6023317
--tickspersec 19001
You wrote that it did not work for:
vvencapp --preset slower --qp 24 --tickspersec 6023317 -i output.yuv --output=bit.266-test
That failure is correct, as you didn´t use the y4m input file.
You used -i output.yuv
without setting a framerate that fits your tickspersec.
Try:
vvencapp --preset slower --qp 24 --tickspersec 6023317 --fps 19001/317 -i output.yuv --output=bit.266-test
vvencapp --preset slower --qp 24 --tickspersec 6023317 --fps 19001/317 -i output.yuv --output=bit.266-test
This works.
Great. So that's resolved? Can the issue be closed?
But the y4m parser doesn't work for this use case :-(
It does. I was wrong, I misinterpreted the evidence you were presenting. Or does it not? Christian corrected me, saying that the y4m parser does indeed read fractional frame rates.
Well,
vvencapp --preset slower --qp 24 -i output.y4m --output=bit.266-test
vvencapp: Fraunhofer VVC Encoder ver. 1.7.0 [Linux][GCC 11.3.0][64 bit][SIMD=AVX2]
Parameter Check Error: TicksPerSecond should be a multiple of FrameRate/Framescale. Use 27000000 for NTSC content
And with --tickspersec 19001
?
This works
vvencapp --preset slower --qp 24 -i output.y4m --tickspersec 19001 --output=bit.266-test
But vvenc could really automate this, no? Since the file contains all the required info.
We'll talk about that internally. Tickspersec is like a systems level setting that people might care about beyond the scope of the encoder internals - that why its an external option in the simple encoder. Our default value handles all standard non-integer frame rates, as uses eg in NTSC. If you are not using standard non-integer fps, you should really not be using fraction fps at all. So from my perspective the issue here is a non-standard fps you selected and we found a solution for that. The encoder might handle that better but that's really a very exotic use case, that we might just as well choose to ignore. In that sense I think the issue could be closed.
But stay tuned. The simple solution would be to set the tickspersec to the nominator of the fps value, but it would produce bitstreams possibly incompatible with many systems. I need to talk this through with someone who understands this.
Speaking of non-standard: this is what ESL CSGO shoots at. Hundreds of clips and videos.
So we meet in the middle. It's still an error, but the verbose error message will tell you how to configure it properly for your data.
I don't understand how to encode 59.94fps y4m file: