Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st March 2021, 17:44   #1  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 113
How do you edit and upscale Playstation, Nintendo 64 and Sega Saturn video dumps?

I usually use emulation to dump videos from SNES and Genesis as well as edit my videos on Virtualdub2 (although I am looking into other software) but I had never edited videos from Nintendo 64, Sega Saturn or Playstation games before. Not all the games on those systems are 3D but I know that 3D games are different from 2D games. With that said however what would be a good way to edit the video dumps from Nintendo 64 and beyond games? I am currently using something called Bizhawk for the dumps.
GAP is offline   Reply With Quote
Old 22nd March 2021, 22:01   #2  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Metropolitan City of Milan, Italy
Posts: 2,269
I'm afraid we're gonna need a bit more info here.
How are those recorded? I mean, which codec are you using to record, which chroma sampling etc?
Also what do you mean by "editing"?
If it's just trimming, it can be easily done in Avisynth, otherwise if it's something more complicated like a proper editing, I would suggest Davinci Resolve which is free, cross platform and pretty intuitive.
(I personally use AVID Media Composer but the license ain't cheap).
As to the upscaling part, from which resolution to which resolution would you like to go?
I would suggest NNEDI3 but as I said we need to know more...
FranceBB is offline   Reply With Quote
Old 23rd March 2021, 02:42   #3  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 113
Here is the Mediainfo details the dump I made from the BizHawk emulator:

Quote:
Complete name : ******.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 1.51 MiB
Duration : 50 s 604 ms
Overall bit rate mode : Variable
Overall bit rate : 251 kb/s
Writing application : Lavf58.22.100

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High 4:4:4 Predictive@L2.1
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 50 s 566 ms
Source duration : 3 s 540 ms
Bit rate : 173 kb/s
Width : 352 pixels
Height : 240 pixels
Display aspect ratio : 3:2
Frame rate mode : Constant
Frame rate : 59.940 (59940/1000) FPS
Chroma subsampling : 4:4:4
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.034
Stream size : 1.04 MiB (69%)
Source stream size : 1.04 MiB (69%)
Writing library : x264 core 157 r2935 545de2f
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=4 / threads=7 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
mdhd_Duration : 50565
Codec configuration box : avcC

Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 50 s 604 ms
Duration_LastFrame : -16 ms
Bit rate mode : Variable
Bit rate : 66.2 kb/s
Maximum bit rate : 128 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 44.1 kHz
Frame rate : 43.066 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 404 KiB (26%)
Default : Yes
Alternate group : 1
I was mostly using the built in A/V recording in the emulator but I wanted to upscale and resize to videos to the current Youtube HD Standards (via Nearest Neighbor and/or if possible, Lanzcos resize). There are other video codec settings within BizHawk including the ability to resize the output video. I wanted to create clips of the individual levels in the games that I play. The thing is I had never done 3D games (or the various 2D games on the aforementioned consoles) before and I wanted advice on how to make my videos presentable?
GAP is offline   Reply With Quote
Old 23rd March 2021, 12:02   #4  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Metropolitan City of Milan, Italy
Posts: 2,269
Ok, I see, so it's essentially a 352x240 yv24 progressive that you wanna upscale.
I noticed that it's actually recorded at 59.940p 'cause I suppose that's the refresh rate of the monitor, but I wonder if the game is actually rendered with as many frames...
If you see any dups, you might wanna be using TDecimate() but since it's a fairly old game and modern CPUs are powerful enough, let's assume that it really is 59.940p without dups.
In that case, all is left for us is to upscale and converttoyv12() as YouTube is in 4:2:0 8bit planar.


Quote:
Originally Posted by GAP View Post
I wanted to upscale and resize to videos to the current Youtube HD Standards (via Nearest Neighbor and/or if possible, Lanzcos resize).
Nearest Neighbor? In 2021? Oh no, I can't let you do that hahaha

No, honestly, nearest neighbor is the simplest algorithm possible, which is also why it's the worse one to pick.
Sure, it's not computationally complex, but nowadays CPUs are much much better than they were in the past and it's easy enough to upscale using a decent kernel like Spline64 or even a Neural Network.
About Lanczos, it's better than PoinResize (Nearest Neighbor) but it's a bit old and there are better alternatives.
I don't actually have any synthetic graphics to show you the comparison, but I can definitely show you how they behave in a real life footage.

This is the original picture in 426x240 (similar to your source):



This is the algorithm you suggested, Nearest Neighbor, so PointResize:



This is NNEDI3 (Neural Network Edge Directed Interpolation 3) upscaling the very same source:



As you can see, it's much much better.
Still, there's still a fair amount of blur due to the very low resolution and there's a bit of aliasing in the lines, but it's way better than PointResize.

So, for your scenario, I would use:

Code:
#Indexing
FFMpegSource2("your_file.mp4, atrack=-1)

#Loudness Correction
Normalize(0.22)

#Bringing AR to 1.77FF
AddBorders(36, 0, 36, 0)

#Converting from BT601 to BT709
Matrix(from=601, to=709, rg=1.0, gg=1.0, bg=1.0, a=16, b=235, ao=16, bo=235, bitdepth=8)

#Upscale to HD
nnedi3_rpow2(cshift="Spline64ResizeMT", rfactor=2, fwidth=1280, fheight=720, nsize=4, nns=4, qual=1, etype=0, pscrn=2, threads=0, csresize=true, mpeg2=true)

#From 4:4:4 planar 8bit to 4:2:0 planar 8bit
Converttoyv12(matrix="Rec709", interlaced=false)

#Clipping
Limiter(min_luma=16, max_luma=235, min_chroma=16, max_chroma=240)
Please note that the MediaInfo you provided doesn't say if the file is in Full PC Range or in Limited TV Range.
IF it's in Full PC Range you're gonna have to add:

Code:
Levels(0, 1, 255, 16, 235, coring=false)
before Clipping.
This is very important and you can check if it's Limited or Full by using VideoTek() and check if it goes outside the black region in the middle and reaches the brown part.

Ah, one last thing, you said "HD" but then you added "YouTube". Please know that nowadays YT doesn't consider HD as HD anymore and it considers FULL HD as HD.
What this means is that if you upload a 1280x720 HD clip you won't get the "HD" icon on the gear in their player as you have to upload at least a 1920x1080 FULL HD clip to get it. In the script, the only thing you have to do to change it is change the values in NNEDI3.

Cheers,
Frank

Last edited by FranceBB; 23rd March 2021 at 12:07.
FranceBB is offline   Reply With Quote
Old 24th March 2021, 02:27   #5  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 113
And I need to put that code in AVISynth or FFMPEG? Or will Virtualdub2 do the job?
GAP is offline   Reply With Quote
Old 24th March 2021, 07:53   #6  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Metropolitan City of Milan, Italy
Posts: 2,269
Avisynth so an AVS Script.
I can send you a BAT to make your AVS Script encode in H.264 and AAC audio if you have never used it, but you're going to need to install Avisynth yourself and get plugins_JPSDR and ffms2
FranceBB is offline   Reply With Quote
Old 24th March 2021, 10:43   #7  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 113
Okay I could use that. PM me?
GAP is offline   Reply With Quote
Old 24th March 2021, 14:28   #8  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Metropolitan City of Milan, Italy
Posts: 2,269
Quote:
Originally Posted by GAP View Post
Okay I could use that. PM me?
Nah, I can share it here with a temporary WeTransfer link.
I mean, I don't care if others download it, it's just a zip with a folder in which there are:

avs4x264mod.exe
ffmpeg.exe
MP4Box.exe
x264.exe

The AVS Script.avs I posted above and the "Command Line H264 LC" with some pretty basic settings to make a YT compatible video with x264, encode the audio in AAC with ffmpeg and mux everything with MP4Box...

Quote:
avs4x264mod.exe "AVS Script.avs" --x264-binary "x264.exe" --crf 18 --preset medium --profile High --level 4.1 --deblock -4:-4 --overscan show --colormatrix bt709 --range tv --log-level info --thread-input --transfer bt709 --colorprim bt709 --videoformat component --nal-hrd vbr --vbv-maxrate 25000 --vbv-bufsize 25000 --output "raw_video.h264"

ffmpeg.exe -i "AVS Script.avs" -vn -sn -af loudnorm=I=-24:LRA=12:tp=-2 -c:a aac -b:a 550k -ar 48000 "audio.aac"

mp4box.exe -add "raw_video.h264" -add "audio.aac" "final_output.mp4"


pause

Here: https://we.tl/t-yH0YVntUjM


Please remember to change in the AVS Script.avs the name of the source file with your actual source file.
I generally help other people in the Avisynth section, I don't generally help folks in the newbie section so I give some things for granted sometimes... Anyway, welcome to the Avisynth world, make sure you're using this release: https://github.com/AviSynth/AviSynthPlus/releases
FranceBB is offline   Reply With Quote
Old 26th March 2021, 23:42   #9  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 113
And you do all that in the AVS Script right? Just to make sure:


Code:
#Indexing
FFMpegSource2("your_file.mp4, atrack=-1)

#Loudness Correction
Normalize(0.22)

#Bringing AR to 1.77FF
AddBorders(36, 0, 36, 0)

#Converting from BT601 to BT709
Matrix(from=601, to=709, rg=1.0, gg=1.0, bg=1.0, a=16, b=235, ao=16, bo=235, bitdepth=8)

#Upscale to HD
nnedi3_rpow2(cshift="Spline64ResizeMT", rfactor=2, fwidth=1280, fheight=720, nsize=4, nns=4, qual=1, etype=0, pscrn=2, threads=0, csresize=true, mpeg2=true)

#From 4:4:4 planar 8bit to 4:2:0 planar 8bit
Converttoyv12(matrix="Rec709", interlaced=false)

#Clipping
Limiter(min_luma=16, max_luma=235, min_chroma=16, max_chroma=240)
Quote:
avs4x264mod.exe "AVS Script.avs" --x264-binary "x264.exe" --crf 18 --preset medium --profile High --level 4.1 --deblock -4:-4 --overscan show --colormatrix bt709 --range tv --log-level info --thread-input --transfer bt709 --colorprim bt709 --videoformat component --nal-hrd vbr --vbv-maxrate 25000 --vbv-bufsize 25000 --output "raw_video.h264"

ffmpeg.exe -i "AVS Script.avs" -vn -sn -af loudnorm=I=-24:LRA=12:tp=-2 -c:a aac -b:a 550k -ar 48000 "audio.aac"

mp4box.exe -add "raw_video.h264" -add "audio.aac" "final_output.mp4"
I do all that in AVISynth right?

Last edited by GAP; 27th March 2021 at 00:54.
GAP is offline   Reply With Quote
Old 27th March 2021, 19:01   #10  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Metropolitan City of Milan, Italy
Posts: 2,269
Quote:
Originally Posted by GAP View Post
And you do all that in the AVS Script right? Just to make sure:

I do all that in AVISynth right?
The first one is the AVS Script, the second one is the BAT.
I already sent you the package with everything.
Just make sure to change "your_file.mp4" with the name and extension of your actual file.
FranceBB is offline   Reply With Quote
Old 28th March 2021, 00:29   #11  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 113
Okay. I will copy the template and put it in a file.
GAP is offline   Reply With Quote
Old 28th March 2021, 01:04   #12  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Metropolitan City of Milan, Italy
Posts: 2,269
Quote:
Originally Posted by GAP View Post
Okay. I will copy the template and put it in a file.
Ok, but in the zip I sent you there's already the AVS Script.avs and the command line H.264.bat, both filled by me, so you literally just have to double click on the bat
FranceBB is offline   Reply With Quote
Old 29th March 2021, 22:10   #13  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,213
Why do you want to upscale the video footage when an emulator will let you natively render it at a higher resolution to begin with?
Zarxrax is offline   Reply With Quote
Old 30th March 2021, 11:31   #14  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 113
Quote:
Originally Posted by Zarxrax View Post
Why do you want to upscale the video footage when an emulator will let you natively render it at a higher resolution to begin with?
I wanted to create clips of the individual levels of the various games that I am playing. I also wanted to upload my videos consistently and maintain the quality. I wanted to know what to do when I encounter games of various graphics. I have programs like Virtualdub2 but I am trying to create clips of videos that will still be very similar to each other and not have to worry too much about the graphics.

Last edited by GAP; 30th March 2021 at 11:34.
GAP is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 16:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.