Good "Video compressor"?

Fishaman P

Speedrunner
Member
Joined
Jan 2, 2010
Messages
3,322
Trophies
1
Location
Wisconsin
Website
twitch.tv
XP
2,185
Country
United States
Cause i want to potentially encode videos like this one.


High HD encoded videos at HD and 60FPS, according to some tutorials from the tas videos website use these guidelines when dumping videos from emulators.

Yeah... lossless is completely overkill when YouTube will butcher it itself when you upload it.
Single pass CRF at around 15, using whatever colorspace x264 prefers (covert to YUV2?), at the slowest preset your CPU can handle minus Placebo. If the encoding can happen slower than realtime, that means Veryslow.
No tuning, profile High (NOT 4:4:4), turn off Fast Decode and Zero Latency (unless the emulator complains about encoding taking too long; for example, last time I tried Dolphin it complained when I turned off Zero Latency)

Two pass encoding produces the same results as CRF but is vastly slower, and can't work in realtime. One pass encoding with a target bitrate is downright awful, NEVER use it for ANY reason.
 
Last edited by Fishaman P,

Sonic Angel Knight

Well-Known Member
OP
Member
Joined
May 27, 2016
Messages
14,399
Trophies
1
Location
New York
XP
12,928
Country
United States
Yeah... lossless is completely overkill when YouTube will butcher it itself when you upload it.
Single pass CRF at around 15, using whatever colorspace x264 prefers (covert to YUV2?), at the slowest preset your CPU can handle minus Placebo. If the encoding can happen slower than realtime, that means Veryslow.
No tuning, profile High (NOT 4:4:4), turn off Fast Decode and Zero Latency (unless the emulator complains about encoding taking too long; for example, last time I tried Dolphin it complained when I turned off Zero Latency)

Two pass encoding produces the same results as CRF but is vastly slower, and can't work in realtime. One pass encoding with a target bitrate is downright awful, NEVER use it for ANY reason.
Not that i quite understand most of what you said, but all i know is i need to dump the video file from the emulator for example SNES9X, and is recommended to make it lossless and RGB during that process. At that time is not the final product of the video which should be handled in a video editing software. Though the video i used as example looks very fine for a SNES game in higher resolution in than 1080P, the end result is to upload high resolution Videos to youtube in 60FPS

Target settings
Resolution Sound
256x224 (NTSC), 256x240 (PAL) 48KHz stereo1

  • Select Config -> Video -> Display Configuration... and make sure that "Bi-Linear Mode 7" is checked.
  • Load the ROM.
  • Set speed to about 400% (= key or Config -> Speed -> Set Speed).
  • Pause emulation (Pause key).
  • Load the movie file, with Sync Sound checked (it increases sound resolution).
  • Select File -> Audio/Video Recording -> Start AVI Recording. Choose a file name (such as raw.avi), and choose a lossless RGB codec of your choice (see Common settings for suggestions). Click OK.
  • Unpause emulation. You are now capturing audio/video.
  • When you reach the desired end point, select File -> Audio/Video Recording -> Stop AVI Recording.

For the page to suggest x264 VFW and have no way or tutorial to encode a lossless RGB video with that encoder is basically a dumb thing in my opinion.
 
Last edited by Sonic Angel Knight,

Fishaman P

Speedrunner
Member
Joined
Jan 2, 2010
Messages
3,322
Trophies
1
Location
Wisconsin
Website
twitch.tv
XP
2,185
Country
United States
Not that i quite understand most of what you said, but all i know is i need to dump the video file from the emulator for example SNES9X, and is recommended to make it lossless and RGB during that process. At that time is not the final product of the video which should be handled in a video editing software. Though the video i used as example looks very fine for a SNES game in higher resolution in than 1080P, the end result is to upload high resolution Videos to youtube in 60FPS



For the page to suggest x264 VFW and have no way or tutorial to encode a lossless RGB video with that encoder is basically a dumb thing in my opinion.
I'm well aware of TASVideos encoding guidelines. They're overly strict, even for the purpose of official encodes.
Bit for bit lossless is buggy in H.264 to begin with, and it's highly inefficient with bitrate because H.264 wasn't designed to work that way.
Seriously, just try the settings I suggested above and TELL me it looks blocky, blurry, or shitty in any way.

EDIT:
6c120O6.png

--------------------- MERGED ---------------------------

I should actually expand a bit. For making the final YouTube upload, use the settings I posted.
For dumping the lossless data into a video editor, try Huffyuv, Lagarith, or Ut Video. They each have their tradeoffs, but I generally recommend them in the order listed.
After that, have the video editor upscale with nearest neighbor by 3x, 4x, etc. depending on the resolution you want to upload, and finally pad with black bars to the exact web resolution. 720p60 is generally the highest I recommend though, you won't see a difference on a game that was 240p or under to begin with.
 
Last edited by Fishaman P,

Sonic Angel Knight

Well-Known Member
OP
Member
Joined
May 27, 2016
Messages
14,399
Trophies
1
Location
New York
XP
12,928
Country
United States
I'm well aware of TASVideos encoding guidelines. They're overly strict, even for the purpose of official encodes.
Bit for bit lossless is buggy in H.264 to begin with, and it's highly inefficient with bitrate because H.264 wasn't designed to work that way.
Seriously, just try the settings I suggested above and TELL me it looks blocky, blurry, or shitty in any way.

EDIT:
6c120O6.png
Tried it your way, there is desynch in video and audio.
 

Fishaman P

Speedrunner
Member
Joined
Jan 2, 2010
Messages
3,322
Trophies
1
Location
Wisconsin
Website
twitch.tv
XP
2,185
Country
United States
Tried it your way, there is desynch in video and audio.
That's not necessarily x264-vfw's fault. The emulator can be buggy in general, the video output might be VFR or something weird (I know Dolphin is guilty of this), or the emulator expects the encoder to be realtime.

A quick diagnosis step is to try again with Ultrafast as the preset. It'll look worse buit this is just to see if CPU usage is the problem.
Also make sure you read my edit above.
 

Sonic Angel Knight

Well-Known Member
OP
Member
Joined
May 27, 2016
Messages
14,399
Trophies
1
Location
New York
XP
12,928
Country
United States
I should actually expand a bit. For making the final YouTube upload, use the settings I posted.
For dumping the lossless data into a video editor, try Huffyuv, Lagarith, or Ut Video. They each have their tradeoffs, but I generally recommend them in the order listed.
After that, have the video editor upscale with nearest neighbor by 3x, 4x, etc. depending on the resolution you want to upload, and finally pad with black bars to the exact web resolution. 720p60 is generally the highest I recommend though, you won't see a difference on a game that was 240p or under to begin with.
I tried using lagarith as also suggested by tasvideos.org The problem with that is the file size is so big especially for a short video, 20 seconds can be about 50MB, which is why i wasn't sure about using it, even though it looks great.

I tried using avisynth as a way to view the video in a upscaled format before trying to convert, but since i haven't used avi synth so long i haven't remembered exactly how i did it before. :P
 

Fishaman P

Speedrunner
Member
Joined
Jan 2, 2010
Messages
3,322
Trophies
1
Location
Wisconsin
Website
twitch.tv
XP
2,185
Country
United States
I tried using lagarith as also suggested by tasvideos.org The problem with that is the file size is so big especially for a short video, 20 seconds can be about 50MB, which is why i wasn't sure about using it, even though it looks great.
And now you understand why lossless is bad for general use. Lagarith has the best lossless compression of any codec, so it only gets worse from here.
Console speedruns encoded in Lagarith can sometimes brush up on 100GB. Not a typo.
 

Sonic Angel Knight

Well-Known Member
OP
Member
Joined
May 27, 2016
Messages
14,399
Trophies
1
Location
New York
XP
12,928
Country
United States
And now you understand why lossless is bad for general use. Lagarith has the best lossless compression of any codec, so it only gets worse from here.
Console speedruns encoded in Lagarith can sometimes brush up on 100GB. Not a typo.
I guess you can say is bad for general use, but then if is so bad why would encoders on the site suggest using it?

x264 With suggested settings by @Fishaman P
Video: MPEG4 Video (H264) 512x448 60fps 359kbps [V: h264 high L3.1, yuv420p, 512x448, 359 kb/s]
AVI TEST.avi_snapshot_00.21_[2017.05.06_00.40.39].jpg


Lagarith using lossless RGB

Video: LAGS 512x448 60fps 10520kbps [V: lagarith, rgb24, 512x448, 10520 kb/s]
AVI TEST2.avi_snapshot_00.15_[2017.05.06_00.44.29].jpg


Comparing the two, one has slight better color than the other.
 

Fishaman P

Speedrunner
Member
Joined
Jan 2, 2010
Messages
3,322
Trophies
1
Location
Wisconsin
Website
twitch.tv
XP
2,185
Country
United States
I guess you can say is bad for general use, but then if is so bad why would encoders on the site suggest using it?

x264 With suggested settings by @Fishaman P
Video: MPEG4 Video (H264) 512x448 60fps 359kbps [V: h264 high L3.1, yuv420p, 512x448, 359 kb/s]
View attachment 86167

Lagarith using lossless RGB

Video: LAGS 512x448 60fps 10520kbps [V: lagarith, rgb24, 512x448, 10520 kb/s]
View attachment 86168

Comparing the two, one has slight better color than the other.
Slightly better colors... for 30x as much data.
The difference is far more pronounced in low resolution content and in bright, pixel-y content... emulators are both. That's why it's recommended for TASVideos's official encoder guys.
For upscaling, use the Lagarith version, so the difference isn't magnified. At 2x, 4x, 6x etc. nearest neighbor when you upscale, due to HOW the color loss works, you won't get the color loss anymore.

(YouTube itself will convert to YUV 4:2:0 when you upload, which is where the color loss would happen)
 

Sonic Angel Knight

Well-Known Member
OP
Member
Joined
May 27, 2016
Messages
14,399
Trophies
1
Location
New York
XP
12,928
Country
United States
Slightly better colors... for 30x as much data.
The difference is far more pronounced in low resolution content and in bright, pixel-y content... emulators are both. That's why it's recommended for TASVideos's official encoder guys.
For upscaling, use the Lagarith version, so the difference isn't magnified. At 2x, 4x, 6x etc. nearest neighbor when you upscale, due to HOW the color loss works, you won't get the color loss anymore.

(YouTube itself will convert to YUV 4:2:0 when you upload, which is where the color loss would happen)
So do you think they have large storage devices for such encodes as the reason why they encode like that?
 

Fishaman P

Speedrunner
Member
Joined
Jan 2, 2010
Messages
3,322
Trophies
1
Location
Wisconsin
Website
twitch.tv
XP
2,185
Country
United States
I mean i guess when you got videos like this Made you can't really think they don't have large storage devices for them all, or maybe cloud storage or something.
In that specific case, they dump the file at the game's native resolution, and the upscaled version is only ever stored in efficient H.264. That wouldn't take a ton of storage.
Dolphin movies dumped at 1080p or higher though? That's an entire hard drive platter by itself. Paper Mario TTYD comes to mind.
 

Sonic Angel Knight

Well-Known Member
OP
Member
Joined
May 27, 2016
Messages
14,399
Trophies
1
Location
New York
XP
12,928
Country
United States
According to their site they also have specific dumping instructions for getting dolphin videos from the games.

Dolphin
[paste:font size="3"]https://github.com/nattthebear/dolphin-avsync/branches
https://github.com/RisingFog/dolphin-avsync/releases
For Linux systems Ilari has created a set of patches providing similar functionality; ask on IRC if you need them. In any case applying the patches will likely result in merge conflicts, that have to be resolved manually. Ignoring this step will result in broken audio/video dumps on versions older than 4.0-3595! Some movies may require functionality (like memory card or disk switching) for playback that is not part of any official release. In these cases it is advisable to check the submission notes and discussion thread for provided patches or binaries.
Hint: Before starting the capturing process try to fully sync the run (Follow steps 1, 2 or 3, 7 (without Dump Audio) and 8). This is to make sure possible frustration caused by unnoticed late desyncs is kept to a minimum. Important: Sometimes a movie will desync on a second playback due to files being present that were created on first playback. Keep in mind that these have to be deleted before starting the capture! Check the submission details or discussion thread to be aware of such causes of desync. Should you get graphical glitches (missing/black or otherwise corrupted textures) try a different backend (e.g. OpenGL instead of DirectX) if possible.

Note: Windows Dolphin avsync versions older than 4.0-1711 crash after splitting the first 2GB segment. To overcome that, use one of these:

  • Ask the person who made a build for you to move the piece of code that closes the timecodes file (AVIDump.cpp) from AVIDump::CloseFile() to AVIDump::Stop().
  • Use x264vfw codec and configure it to output a lossless single-segment file (seeking won't break):
    • Basic -> last (nameless) drop-down menu -> Keep/Accept only RGB.
    • Check Zero latency.
    • Rate control -> Single pass - lossless.
    • Output -> Output mode -> File.
    • Output file -> specify the global path.
TODO: find out if framedump0.avi that Dolphin still creates can be ignored with no harm.



    • Build Dolphin yourself, applying the fix from method 2. Use these steps then.
[paste:font size="3"]natt's or Ilari's AVhack. Menu structure as well as names of menu items may change between releases. To avoid unnecessary hassle ensure you fulfill the assumptions made in step 9, first sentence.



    • Navigate to Options->Configure. Uncheck Enable Dual Core and Enable Idle Skipping. Set Framelimit to off. Make sure the CPU emulator engine is set to JIT Recompiler.
    • For some Gamecube games: Navigate to Options->Configure->Gamecube and check Skip BIOS. Some movies require a memory card inserted, while others expect none to be present. Set the Slot options accordingly.
    • For some Wii games: Navigate to Options->Wiimote Settings. Click Configure for Wiimote 1 and Clear. Also choose or unset the extension controller. These instructions are not required for all games.
    • Go to Options->Graphics Settings -> Hacks, disable External Frame Buffer (related to movie sync), enable EFB Copies and set it to RAM (and enable Cache if you wish).
    • Dumping is to be done on highest graphical settings. Navigate to Options->Graphics Settings and check Auto adjust Window Size. From that window navigate to Enhancements and set Internal Resolution to 2x Native, Anti-Aliasing to 16xQ CSAA or equivalent and Anisotropic Filtering to 16x (anisotropic filtering leads to graphical glitches with some games. Leave it set to 1x if this is the case.)
      1. Linux specifics: For games displaying their content in 16:9 it may be necessary to force widescreen mode at this point: Options->Graphics Settings, set Aspect Ratio to Force 16:9. This however will not suffice because Dolphin will always resize the window to a 4:3 resolution and as the window dimensions determine the video resolution, you have to resize the window to the correct resolution (2x the native 16:9 resolution, i.e. 1536x864) yourself. Ensure the window content (that is without titlebar and other decoration by your window manager) has the correct dimensions with e.g. xwininfo.
      2. TODO: Windows specifics: Does the same apply to Windows?
    • Start the game without any dumping feature enabled. This way Dolphin will resize its window to the correct resolution. Now Dolphin has to be configured to write audio and video data to disk.
    • Navigate to Options->Graphics Settings and uncheck Auto-adjust Window Size. From that window navigate to Enhancements and set Internal Resolution to 4x Native. Check Dump Frames on the Advanced tab.
      1. Linux specifics: Check Frame Dumps use FFV1 as well. The Dump Frames option will make Dolphin dump audio too.
    • Navigate to Options->DSP Settings and choose DSP LLE recompiler as DSP emulator engine. This type of sound emulation requires dsp_coef.bin and dsp_rom.bin to be present in the User\GC\ on Windows or $HOME/.dolphin-emu/GC on Linux directory or you will receive an error message. On Windows check Dump Audio and set Audio Backend to "No audio output" (sound will be dumped nevertheless).
    • Assuming the game is in your library and you have started it at least once, choose Play Recording from the Emulation menu and select the movie file to be captured. On Windows select a lossless RGB video codec of your choice and click Ok. Audio and video are now being captured. Should the emulator crash at this point examine the User\Dump\ directory of your Dolphin installation ($HOME/.dolphin-emu/GC on Linux) and create the folders Audio and Frames if either of those are missing.
      1. Linux specifics: Important: During the entire video capture no window must overlap with the one showing the actual gameplay, so it is wise to check Keep window on top in Options->Graphics Settings.
    • To stop the capturing process at the desired end point click Emulation->Stop.
Read on if you want to find out how to deal with the files that have been created for encoding: Dolphin encoding guide

Though for some reason the dolphin emulator has no option to select encoding like snex9x or VBA does which is odd. But it would probably use a lot of storage to even dump a few minutes of video. :unsure:

I might just be better off screencap it with hardware encoding capture card if i can find one at 1080P and 60FPS, the one i have only can do 60 FPS at 720P not 1080P
 
  • Like
Reactions: SebastienKrollem11

Sonic Angel Knight

Well-Known Member
OP
Member
Joined
May 27, 2016
Messages
14,399
Trophies
1
Location
New York
XP
12,928
Country
United States
Thanks for asking because I need to upgrade mine as well. Will be following this thread.
Hello, is nice to see interest in such a topic. :)

Though nothing has been added to this topic in quite few years. Though as time goes by, experience and wisdom has can be gained.

By saying that, I have figured out encoding. :D

Since then, I managed to understand somethings. Older emulators like snes9x use encoders through a "VWF - Version for windows" (I guess cause I'm a windows user). It is easy to find and install a program to do that with like X264. But, I found better modern means. :P

Pipedec is a VFW app you can install to make other encoders handle encoding. (This process is called "Piping") I since then use it to force encodes with FFMPEG. Which is good because of being able to encode many formats without installing many programs. Assuming you using older emulators like snes9x, this works effortlessly when properly setup, but may be useful for other programs as well. Modern emulators might not have VFW encoding and may come with it's own encoder. Or if one doesn't have any at all, screen cap I guess works. :)

As for saving space and compression, It seems software encoding saves more space than hardware encoding, but the time to encoder is much longer. So it would depend on the person.

Just some notes I'll leave here. :ninja:
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: https://youtube.com/shorts/WOppJ92RgGU?si=KE79L6A_3jESsGQM