New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to encode 59.94fps y4m video? #252
Comments
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? |
What should I pipe to vvenc then?
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 |
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. |
Just use raw yuv and specify the metadata manually using our syntax (i.e. --fps 60000/1001). Or use proper transcoding:
Lol, this doesn't mean nothing. For what I know, this might be ffmpeg using a default value. Try |
The header for y4m is:
|
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. |
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 :-) |
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 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
|
Did you try encoding with |
The same error with |
And |
-1 worked:
|
I see what happens. Apparently our y4m parses ignores fractional frame rates (thats why you see 60Hz). We'll fix that. Thanks. |
It does. See the |
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 You wrote that it did not work for: That failure is correct, as you didn´t use the y4m input file. |
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,
|
And with |
This works
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. |
auto set ticks per second for non-standard frame rates
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:
The text was updated successfully, but these errors were encountered: