FFMPEG and cinematics question
- WaspUK1966
- Posts: 135
- Joined: Sat Aug 09, 2014 9:17 am
FFMPEG and cinematics question
Hope you can help. I've created intro and ending cinematics for my LOG 2 mod using movie maker and saving them as MP4 files. I then used ffmpeg to convert these files to .IVF format to use in my mod (using the code sequence listed on the MODDING page for cinematics). I've tested the cinematics ingame and they work fine. However, for some reason, the colours of the .IVF files seem pale, and not like the original MP4 files. The black, for example, looks a more light grey and it spoils the affect somewhat. Why is this? Is it something to do with the compression settings I used etc? Can I correct it by changing a setting/value when using ffmpeg so the colours are true and not washed out? Any help greatly appreciated.
George
George
Re: FFMPEG and cinematics question
Sounds like your ffmpeg profile either has a brightness change in it, or has too low of a gamma exponent.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- WaspUK1966
- Posts: 135
- Joined: Sat Aug 09, 2014 9:17 am
Re: FFMPEG and cinematics question
The code I used in ffmpeg is this:
ffmpeg -i c:\users\george\pictures\gorgons_start.mp4 -vcodec libvpx -b 3000k -s 1920x1080 c:\users\george\pictures\gorgons_start.ivf
I havent changed anything as regards ffmpeg etc just modified the code given on here to fit my file name etc, so I'm not sure what you mean...
ffmpeg -i c:\users\george\pictures\gorgons_start.mp4 -vcodec libvpx -b 3000k -s 1920x1080 c:\users\george\pictures\gorgons_start.ivf
I havent changed anything as regards ffmpeg etc just modified the code given on here to fit my file name etc, so I'm not sure what you mean...
Re: FFMPEG and cinematics question
Well, there's not really much else that could cause this.
It is possible that your video is too complicated to encode well at a constant 3000k bitrate at 1920x1080, which would result in "washed-out" colours among other things, but this probably wouldn't result in pure black turning to grey. See if this fixes the problem:The "-crf 10" tells the encoder to target a certain quality level (10) and choose the bitrate for each frame itself. If the resulting file is too large, you can increase the number (up to 63) to reduce the target quality and therefore the filesize. If the resulting file is too low-quality, you can decrease the number (down to 4).
Since you are not streaming this video, telling the encoder to use a fixed bitrate (like the example in the Creating Cinematics page) is probably a bad idea. You get more quality for your bytes by using variable bitrate. You can also provide both options to tell the encoder to use a variable bitrate, but cap the bitrate at a certain value:
Also, just in case you aren't aware, if your original video's resolution is lower than 1920x1080, there is not really any compelling reason to force it to 1920x1080 and you can remove the -s 1920x1080 option.
It is possible that your video is too complicated to encode well at a constant 3000k bitrate at 1920x1080, which would result in "washed-out" colours among other things, but this probably wouldn't result in pure black turning to grey. See if this fixes the problem:
Code: Select all
ffmpeg -i c:\users\george\pictures\gorgons_start.mp4 -vcodec libvpx -crf 10 -s 1920x1080 c:\users\george\pictures\gorgons_start.ivfSince you are not streaming this video, telling the encoder to use a fixed bitrate (like the example in the Creating Cinematics page) is probably a bad idea. You get more quality for your bytes by using variable bitrate. You can also provide both options to tell the encoder to use a variable bitrate, but cap the bitrate at a certain value:
Code: Select all
ffmpeg -i c:\users\george\pictures\gorgons_start.mp4 -vcodec libvpx -crf 24 -b 3000k -s 1920x1080 c:\users\george\pictures\gorgons_start.ivfGrimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- WaspUK1966
- Posts: 135
- Joined: Sat Aug 09, 2014 9:17 am
Re: FFMPEG and cinematics question
Thanks for that, i'll give it a go and see what happens. My cinematics don't contain anything animated, they're just a sequence of pictures with text, nothing complicated. And my native res is 1920x1080. Will changing the res help?
Re: FFMPEG and cinematics question
...
Why are you using videos if there's no animation involved?
Your computer's display resolution is completely irrelevant, I'm talking about the resolution of the video, which is what the -s option specifies.
Why are you using videos if there's no animation involved?
Your computer's display resolution is completely irrelevant, I'm talking about the resolution of the video, which is what the -s option specifies.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: FFMPEG and cinematics question
Don't videos allow dynamic memory management where pictures would eat permanently some precious space ?minmay wrote:Why are you using videos if there's no animation involved?
Re: FFMPEG and cinematics question
minmay wrote:...
Why are you using videos if there's no animation involved?
Because, there is no other way in Log2 to do cinematics?
- WaspUK1966
- Posts: 135
- Joined: Sat Aug 09, 2014 9:17 am
Re: FFMPEG and cinematics question
As regards what was said above, I'm only using the code on the MODDING page as is, as I'm led to believe (as THOM says) that it is the only way I can get images and music to work as intro/out sequences in LOG 2, irrespective wether the images are static or moving. As stated, the intro/ending sequences I've created work fine, I was just querying the slight colour wash-out on the final .IVF file, especially the black, which is does not look like true black but rather a lighter version. If there is another way to run both music and picture sequences at the start/end of my game WITHOUT using ffmpeg, then please let me know.
Re: FFMPEG and cinematics question
Use GameMode.playStream() to play the music and PartyComponent.onDrawGui() to show the pictures. It's really easy. There's even a cinematics module in GrimTK that will do it for you.
I just tested this, and the answer is no. Textures aren't loaded until they are actually needed, and are "garbage collected" around a minute after that. As long as you actually stop using the texture after you're done, it'll be fine.AndakRainor wrote:Don't videos allow dynamic memory management where pictures would eat permanently some precious space ?
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.