Showing posts with label video editing. Show all posts
Showing posts with label video editing. Show all posts

Sunday, February 22, 2026

Unavoidable HDMI recording audio glitches and their fix

Been noticing some unavoidable noise when capturing from a certain HDMI source. It always sounds like scrunching up a newspaper, happens about once per 20 minutes (if at all), and looks like this in Audacity:


And this:


I don't ever hear it watching live; it's just in the recording. I've found ripping the raw wav and loading it in Audacity is both the best way to find the glitch at all, as well as the only way to fix it. So at this point I recapture and get a clip of the audio without the glitch, and replace this audio. 

This is already zoomed in, but I like to zoom in even further, to the point where the thin lines of the waveform become thick again. Then I just line up the audio and mute out the bad portion. It's sort of touch-and-go at this point; it's not as easy as it should be. I try to find an identifiable peak on the main audio and split there, then on the clean audio make the same split, trim, then snap and move. Maybe mute where necessary and then Track > Mix > Mix and Render

In AviSynth, I load like this: 

rawfile1v=LWLibavVideoSource("Untitled 115.avi")
rawfile1a=LWLibavAudioSource("Untitled 115 fixed.wav")
AudioDubEx(rawfile1v, rawfile1a)
stream1=last
rawfile1=last


Another problem I had was Blackmagic Media Express not recognizing audio from certain sources, such as:

  • RetroTINK-5X Pro into OSSC Pro (individually, both scalers would work fine)

  • EZCOO 4K splitter with manual downscaling
  • RetroTINK-4K Pro with HDMI input, e.g. PSTV + splitter (even if I would get audio from a component source into the RT4K just fine)
My solution was to run the HDMI output into an HDMI + Audio Converter box, connect that to an HDMI Audio Embedder using a S/PDIF optical cable, and then finally to the capture card. 
My equipment chain, for the curious. And might I add, Google Drawings was plenty enough for this. Just had to set the canvas to a reasonable size in File > Page Setup (I chose 4K resolution, or 3840 × 2160) and set the measurements to pixels instead of inches, and everything else was easy to understand. 

I can't believe I wasted time dabbling with Lucidchart which limited the number of shapes I could use and wanted me to pay per month... and they wanted me to pay more per month if I wanted to pay for a whole year! Got rid of that app's permission real fast. 

AutoHotkey mouse movement script for precise scrubbing:

/*
up: Y -
down: Y +
left: X -
right: X +
*/

/*
space::Lbutton
; Hold spacebar to simulate holding left mouse click

Up::
CoordMode, Mouse, Screen
MouseMove, 0, -1, 0, R
return
;move mouse one pixel up

Down::
CoordMode, Mouse, Screen
MouseMove, 0, 1, 0, R
return
;move mouse one pixel down

Left::
CoordMode, Mouse, Screen
MouseMove, -1, 0, 0, R
return
;move mouse one pixel left

Right::
CoordMode, Mouse, Screen
MouseMove, 1, 0, 0, R
return
;move mouse one pixel right 
*/

~Tab & NumpadEnter::
Send {Click}
return
;click

Tuesday, August 6, 2024

Editing in AviSynth, then encoding in HandBrake

Why am I ditching MeGUI*?

While MeGUI does do x265, it's not the GPU-accelerated kind, so good quality (i.e. "Slowest" speed and 2000 kbps) on a 24-minute video takes literally about a day. As in 24 hours. Zero complaints on quality, but it's just impractical! And I have other videos to encode that are longer than that. No thank you. NVENC would only take 15 minutes to encode a 24-minute video. 

HandBrake does do GPU-accelerated encoding with H.265 NVENC, but it doesn't load AviSynth scripts directly. There's lots of outdated info out there, but I figured it out. Some links:

  • The latest AviSynth+. The installer seems to install both 32-bit and 64-bit, and you have the option to install one or the other or both. Choose both anyway; it won't hurt. I ran into "cannot load 32-bit dll in 64-bit AviSynth" errors in my search for a solution but if you're on Windows 11, you're only really using 64-bit. You won't run into any problems with VirtualDub either if you use VirtualDub2 and stick with VirtualDub64.exe in the archive.
  • AV FileSystem, aka AVFS. Apparently there are plenty of programs called "AVFS" and many sites refer you to the older version of the program which is no longer updated and will not solve the problem. Requires:

My entire D drive is raw captures and templates. so I put AVFS.exe there. To get started, I open Command Prompt. From here, I type D: to change directories (learn more here, or just right-click and then Open in Terminal), then avfs "template.avs" and hit Enter. The virtual avi is created almost instantly in C:\Volumes. Windows Explorer says the 24-minute virtual AVI is 336 GB, but it doesn't take up any space. And HandBrake will load it up no problem!

Still, the consensus is GPU encoding isn't as good as CPU encoding, even if the speed is amazing. But my counter to that is, remember what we had to do with the old x264 standard: 2-pass Very Slow encoding and 12000 kbps would be damn near lossless, but would also take forever to encode and they would be huge! So if I have to bump up the bit rate a bit, well then, okay. We're still already at over 50% savings in file reduction anyway. This other guy on reddit, has more faith in the quality of NVENC, and you know what? I'll take his side.

I started encoding just animation at 2500 kbps and it looked good; it's already a higher bit rate than those old One Piece rips with multiple languages, which I consider the gold standard. But then my live action captures looked good too at this setting so I guess I'm staying at 2500 kbps, with Encoder Preset at Slowest and rc-lookahead=32. I think 3000 kbps was the lowest I would go for x264 captures at 720p, so doing 2500 kbps for 1080p is a great savings. 

Also learned a neat term from all of this: JND (just-noticeable difference). 

Those One Piece settings, by the way, are: 

Format                         : Matroska
Format version                 : Version 4
File size                      : 235 MiB
Duration                       : 23 min 50 s
Overall bit rate               : 1 380 kb/s
Frame rate                     : 23.976 FPS
Encoded date                   : 2019-03-06 23:55:59 UTC
Writing application            : mkvmerge v9.2.0 ('Photograph') 64bit
Writing library                : libebml v1.3.3 + libmatroska v1.4.4
Attachments                    : OpenSans-Semibold.ttf
Video
ID                             : 1
Format                         : HEVC
Format/Info                    : High Efficiency Video Coding
Format profile                 : Main@L5.1@Main
Codec ID                       : V_MPEGH/ISO/HEVC
Duration                       : 23 min 50 s
Bit rate                       : 1 278 kb/s
Width                          : 1 920 pixels
Height                         : 1 080 pixels
Display aspect ratio           : 16:9
Frame rate mode                : Constant
Frame rate                     : 23.976 (24000/1001) FPS
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 8 bits
Bits/(Pixel*Frame)             : 0.026
Stream size                    : 218 MiB (93%)
Default                        : Yes
Forced                         : No
Audio
ID                             : 2
Format                         : AAC LC
Format/Info                    : Advanced Audio Codec Low Complexity
Codec ID                       : A_AAC-2
Duration                       : 23 min 50 s
Bit rate                       : 96.0 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
Delay relative to video        : 22 ms
Stream size                    : 16.7 MiB (7%)
Language                       : Japanese
Default                        : Yes
Forced                         : No
Text #1
ID                             : 3
Format                         : ASS
Codec ID                       : S_TEXT/ASS
Codec ID/Info                  : Advanced Sub Station Alpha
Duration                       : 23 min 31 s
Bit rate                       : 103 b/s
Frame rate                     : 0.209 FPS
Count of elements              : 295
Compression mode               : Lossless
Stream size                    : 17.9 KiB (0%)
Title                          : English
Language                       : English
Default                        : Yes
Forced                         : No
Menu
00:00:10.500                   : en:Opening Theme
00:02:40.660                   : en:Recap
00:03:11.942                   : en:Part A
00:16:17.186                   : en:Part B
00:23:15.687                   : en:Next Episode Preview

*I'm not completely ditching MeGUI because HandBrake crashes when I try to include chapter data. HandBrake has its own method, completely incompatible with the way I've done it for nearly two decades, which is a text file that MeGUI can accept even before encoding:

CHAPTER01=00:00:00.000
CHAPTER01NAME=1 - Cold Open
CHAPTER02=00:01:16.977
CHAPTER02NAME=2 - Title Sequence
CHAPTER03=00:02:47.017
CHAPTER03NAME=3 - Sponsors A
CHAPTER04=00:02:59.429
CHAPTER04NAME=4 - Act 1
CHAPTER05=00:09:29.969
CHAPTER05NAME=5 - Eyecatch A
CHAPTER06=00:09:37.994
CHAPTER06NAME=6 - Eyecatch B
CHAPTER07=00:09:43.900
CHAPTER07NAME=7 - Act 2
CHAPTER08=00:21:27.153
CHAPTER08NAME=8 - Credits
CHAPTER09=00:22:58.377
CHAPTER09NAME=9 - Post-Credits
CHAPTER10=00:23:59.438
CHAPTER10NAME=10 - Preview
CHAPTER11=00:24:14.436
CHAPTER11NAME=11 - Sponsors B

So after I let HandBrake encode, I run it through MeGUI again (One-Click > Advanced Config > Don't encode video) and it'll only take seconds for a lossless copy to be created, this time with chapter selection.

EDIT: Seems you can get away with lower bit rates if you have lower frame rates, according to AI-generated answers searching "does lower frame rate mean lower bit rate" in DuckDuckGo. I thought I heard almost the exact opposite a decade ago, but looking at those One Piece rips, the significant reduction in file size can't all be from CPU encoding, especially when there are so many audio tracks. 

Tuesday, January 17, 2023

My recommended settings for the highest-quality videos on PSP

Everyone knows the resolution of the PSP is 480x272, but did you know the PSP is capable of playing videos in 720x480? That's a higher resolution than what every video encoder uses for their own PSP presets. 720x480 at 2000 kbps is also the quality of purchased PSN standard-definition videos back when they were downloadable. They were playable on PSP and PS3 and looked great. 

While a PSP firmware update would eventually allow us to encode our own videos in 720x480 (and match UMD video quality), there was still the aspect ratio problem: we always had to hit Triangle and select "full screen" if the source material was 16:9 (gets annoying fast), and if the videos were 4:3, we were sort of out of luck.

Well, after nearly two decades, I've finally solved it, so now I can encode in the highest resolution at the proper aspect ratio. Looking through my notes, some guy on Dash Hacks long, long ago already got most of it: 
(re: Constant Quantizer) remember lower numbers = higher picture quality = larger file size. going from 21 to 26 will make the files smaller, but they won't look as good, esp on a TV.

Also all of the CQ profiles tend to get too aggressive on simple scenes so smooth gradients and dark scenes will have visible artifacts on a larger display. It's not bad on the PSP screen, but on a larger screen it can be distracting.

One more tip: If you are doing a 720x480 profile, be sure to turn off autocrop and set AR correction to SAR, otherwise you'll lose the anamorphic benefits and end up with a letterboxed 4x3 video and waste lots of CPU time encoding black bars.

Now having said all that, I do things a little differently myself. I make a HQ encode that will look great on my 60+" tv, one that I can play on PSP, PS3, or PC. I try to avoid any PSP specific optimizations. I can always reduce the PQ and PSP optimize it later if I need to. 

Essentially, I imitate the settings used on the PSN Video store. Start with the MP4 PSP AVC TV profile, set the video encoder to CBR 2000 mb/s AVC, set the audio encoder to AAC-LC ABR 256k, set video cropping to 0 (turn off autocrop) and AR correction to SAR. Disable mpeg2fix. Movies will average 1gig/hour, but they will look excellent over TV out, on a PC/laptop, or PS3 on a big screen.

If I need a PSP only (small screen) version, I'll use the big one as the source, and reduce it to 480x272 using the standard MP4 PSP AVC profile with autocrop and AR correction set to black and mpeg2fix/ghostbusters turned on. If you know you are never going to watch it on anything bigger than a PSP screen you can get really aggressive with the encoder.

Changing SAR was one of the big points (although he didn't say to what...), and disabling B-Pyramid (whatever the hell that is) was the other.

I'm using Megui here, which in some ways isn't as flexible as the older versions of Xvid4PSP, but I'm never going back to that. Even the old (i.e. good) versions of Xvid4PSP seemed bloated and I wasn't able to add in chapter data for my other (non-PSP) encodes without running the finished video through YAMB. 

General tab:

  • Make a new OneClick profile (at the bottom). I named mine "PSP 720x480 at 16:9"
  • Video: load AviSynth script here... more on that later
  • Audio: FFmpeg AAC
    • (Config button) Profile: MPEG-4 LC-AAC 
      • ABR 256k

Advanced Config tab:

  • Encoder settings: Config button
    • Create a new preset (at the bottom). I named mine "PSP 720x480 16:9 Best" 
    • Select PS3 under Target Playback Device.
    • AVC Profile: Main Profile
    • AVC Level: Level 3
    • (Frame-Type tab) B-Pyramid Disabled (Easy to miss and most important! Otherwise the video won't play on a PSP!)
    • (Misc tab) Input/Output: Force SAR: (This is what we're here for: making sure we get 16:9!)
      • 40:33 for 16:9 content
      • 10:11 for 4:3 content
    • Encoding Mode: Automated 2pass / Bitrate: 2000
  • AviSynth settings: CHECK "Keep Input Resolution (disable crop & resize)"

The one drawback to this method is you have to load the clip via AviSynth because Megui doesn't let you change the frame rate. Well, I guess it does, but in a way that's more complicated than just writing your own damn AviSynth script to begin with. The AviSynth script does three things:
  1. Loads any format, no fuss, no muss.
  2. Lets you change the frame rate to 29.97, which is crucial because the PSP can't seem to play videos well at higher framerates, even if you do overclock (to do: try videos at 60 FPS 480x272).
  3. Lets you know for damn sure that you're inputting a 720x480 video, so you can check the "Keep Input Resolution (disable crop & resize)" box with full confidence.
For that first one, we're using the LSMASHSource plugin. Loading scripts with it in VirtualDub might take a while, but it's necessary. Here's the script in full (after I trimmed the fat):

LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins64+\LSMASHSource.dll")

rawfile1v=LWLibavVideoSource("Untitled 05.avi")
rawfile1a=LWLibavAudioSource("Untitled 05.avi")
AudioDubEx(rawfile1v, rawfile1a)
rawfile1=last.BilinearResize(720,480)  

return rawfile1.ChangeFPS(29.970, linear=true)

Easy. 

Other fun links:

Saturday, January 7, 2023

Finding the mythical "compromise crop" between 4:3 and 16:9



I was watching a DuckTales movie from 1990 on Disney+, which was almost certainly originally 4:3, but it was presented in widescreen with thinner-than-usual pillarboxes. So that got me looking for the only good compromise for viewing zoomed-in 4:3 content on a 16:9 display: zooming in just enough to keep the original aspect ratio, but without cropping all the way so as not to lose too much information on the top and bottom of the screen.

This is what I'm talking about: 


The area in green is the full 16:9 1080p image. The area in black is the 4:3 image. The area in red is the left and right sides of the zoomed-in 4:3, with the empty selection on the top and bottom showing what's cropped.

Getting the numbers in GIMP:

1080p is 1920x1080.

4:3 content in a 1080p frame is 1440x1080.

The remaining pillar bars (the green in my illustration) have a width of 240 pixels each.

Half of 240 is 120 (this is the "compromise" part), so in GIMP I had to create a rectangle from the inner columns (the red in my illustration) with the Rectangle Select Tool until it said the rectangle was 1.33:1. (1.33:1 = 4:3). 

The numbers I got were 1680x1260... but I could be off a few pixels. It needs to reduce to exactly 4:3...

1680/420=4

1260/420=3

So yeah, 1680x1260 is what I need for a 4:3 clip before chopping it for the compromise crop.

In practice, what this means starting with a 1080p raw capture, I have to:

  1. Crop from 1920x1080 to 1440x1080 (that is, crop 240 on the left and right) to get a clip that's 4:3.
  2. Resize the clip to 1680x1260. Luckily this is still mod16 for quick, clean, no-fuss resizing with BicubicResize.
  3. Because 1260-1080=180, I need to crop 90 off the top and bottom. Clip so far is 1680x1080.
  4. Because 1920-1680=240, I need to add 120 to the left and right. Clip is now 1920x1080.
In AviSynth: 
.Crop(240,0,-240,0).BicubicResize(1680,1260).Crop(0,90,0,-90).AddBorders(120,0,120,0)

Bonus: Resolution cheat sheet

Monday, December 19, 2016

HDfury blanking out

Seems I might have solved the mystery of the HDfury mysteriously blanking out... in my case, anyway. Apparently this is a known problem since searching "HDfury blanks out" returns results for all HDfury models.

My chain is source > DVDO Edge > Monoprice Item 5369 + 2029 > HDfury (VGA out) > monitor.

Apparently my short 1.5 ft Monoprice HDMI cable (from Monoprice Item 5369 to the HDfury) was what was causing the blackouts, in which I would lose at least five seconds. For now, switching to a longer HDMI cable (same Monoprice brand, 6 feet) seems to prevent the blanking out.

EDIT: Since then I've just bought a higher-speed HDMI cable... seems to work fine.

EDIT 2: No, it doesn't. But flicking the Monoprice HD #5369 seemed to do the trick... and actually, now that I've got the Monoprice item page open, I'm reading the reviews and maybe the loss of sync is related to voltage drops, according to "Mike" from December 24, 2009. Now I just need to figure out what he means by voltage regulator.

EDIT 3: Pretty sure the problem is not with the HDfury but with the Monoprice item. I think I can make sure it doesn't lose sync by making sure the power switch is flicked on when there are no more source changes. In other words, make sure I power on last, or in the case of PS3, turn off and turn on again when entering and exiting a game.

Sunday, December 11, 2016

Capturing upscaled gameplay with an OSSC on an Intensity Pro

Quick footnote here folks: Sometimes I have to set the Intensity Pro to capture at 720p60 rather than 720p59.94 like I do with the PS3, TiVo, and anything else I capture  off the DVDO Edge.
  • 240p line X3
  • 480p line X2


Going in depth, assuming these are my DVDO Edge settings:

DVDO Edge:
Video Output: 720p 60 Hz
1:1 Frame Rate: Enable
Output Frame Lock: Auto Lock


Here's when I need the Intensity Pro at 720p59.94 Hz and when I need it at 720p60:

PS1 (SCPH-5501), RGB SCART, line X3: 720p60
PSPgo, component, 480i, line X3 (PS One Classic): 720p60
PSPgo, component, 480p, line X2 (PS One Classic): 720p60
PSPgo, component, 480p, line X2 (PSP game): 720p59.94

Friday, October 14, 2016

Panasonic AG-1980 quirk

I noticed Ranma 1/2 was on Hulu, but I got nostalgic for the way I watched it from the Blockbuster rentals: in English, and with various Viz Video trailers. I was able to snag the complete English-dubbed OAV collection for about $12 on eBay.

So I just hooked my Panasonic AG-1980 back up to my DVDO Edge for the first time in years and I'm noticing I need to let the VCR warm up for about 30 minutes (making sure to actually press the power button after plugging the power cord). No need to have a VHS playing for 30 minutes too.

I know this because after I had the VCR displaying a good picture, I had to leave so I stopped playback and powered off. When I powered on and hit Play, the bad picture returned.

For reference:


Sunday, July 17, 2016

Resolution / Aspect Ratio Cheat sheet

http://blog.chameleondg.com/post/111891072017/resolution-aspect-ratio-cheat-sheet

Found this while trying to digitize my Aladdin LaserDisc with its wacky original aspect ratio of 1.66:1 (5:3).


Note for future me: this is how I enabled LaserDisc closed captions on the Samsung smart TV: 
I got closed captions to work on the new TV with LaserDiscs. Turns out I had to really really enable them: Settings > General > Accessibility > Captions > On.

Friday, May 15, 2015

Gaming & video capture ideas before I forget

Some PS1 and PS2 games tend to switch back and forth between 240p and 480i, and that can be pretty annoying when trying to capture. Looks like I'll have to get some cheap capture card (Ezcap) that treats everything as 480i. But if I want to play in the best quality (component) while recording in S-video, apparently the GunCon multi-out adapter cable thingy allows exactly that.

Also, I've always had trouble playing Tobal 2 on my Lik-Sang modded, 1st generation Japanese PS2. It just wouldn't get past the PS logo screen. Could it be the loading or smoothing settings on the PS2? Something to consider. (Update: No dice, it still won't work. But after a while of tinkering manual forced swaps with different discs at different times, Tobal 2 would start playing music. Interesting since it's not a redbook audio game!)

Friday, March 6, 2015

Aspect Ratios

Whipped this up quick just for my own reference:

gray = 16:9, full HD = 1920x1080 = 1280x720
black= 4:3 (inside gray), pillarboxing = 1440x1080 = 960x720
red = 16:9 (inside black), windowboxing = 1440x810 = 960x540
blue = 4:3 (inside red)pillarboxed windowboxing = 1080x810 = 720x540


See: https://support.apple.com/en-us/ht2320

And I actually have seen pillarboxed windowboxing on certain "decimal channels" on TV. What the hell kind of messed up TV would ever need that?

Thursday, February 19, 2015

Mysteries of the MP4 solved

Let's start with what we already know:


XviD4PSP 5.xx is the best encoder for everything. I only really use two formats:
  • MP4 PS3 or XBOX360
  • MP4 PSP AVC
Go to settings and disable auto volume, auto crop, and analyse interlace. Check the global settings and change the temp folder to the same drive you're encoding your video so you're not waking up any sleeping drives when batch encoding.

For most videos (basically any non-PSP video), I like to stick with:
  • AVC profile: High
  • AVC level: 4.1
I've already written about specific file sizes here, but now that I'm capturing and encoding every episode of Good Eats again at a mere 233 MB, let me just state unequivocally that 3-Pass encoding (versus 2-pass) does make a difference! In fact, the lower the file size and bit rate, the more it matters! I realized that a bit late (already halfway through all the episodes), but what're ya gonna do.



To add chapters to a video, take your newly encoded video and load it into YAMB 1.6 (you probably need to locate MP4Box under Options too). Load a text file that looks like this:

CHAPTER01=00:00:00.000
CHAPTER01NAME=1
CHAPTER02=00:03:16.363
CHAPTER02NAME=2
CHAPTER03=00:07:12.282
CHAPTER03NAME=3
CHAPTER04=00:10:27.010
CHAPTER04NAME=4

You could do this in YAMB 2.1 as well but there's no convenient "clear" button when you're adding chapters to multiple videos, though in the future I might cook up an AutoHotkey script to clear it instantly myself.



To encode the best quality videos for PSP, which is to use XviD4PSP's "MP4 PSP AVC" format at 720x480, follow these settings:
  • under video encoding
    • Encoding mode: 2-Pass Bitrate
    • Bitrate: (kbps) 2000
    • AVC profile: Auto (main)
    • AVC level: 3.0
  • under video > Resolution/Aspect
    • Output Resolution: 720x480
    • Resize filter: Lanczos4Resize
Then load that newly encoded video in YAMB 2.1 (Warning about uninstalling the 2.1 beta here). Highlight the AVC, go to Properties, then Pixels Aspect Ratio and choose. Without this step, the 720x480 video will not quite be 4:3 or 16:9, and you'll have to stretch within the PSP itself. 


That last one took me about a decade to figure out! I knew Media Go converted videos and kept the original aspect ratio at 720x480, but that program wasn't any good compared to XviD4PSP. With my PhotoFast adapter coming sometime in the future, I'll likely have enough room for every PSP game I've ever bought, all my music, and every Simpsons/Seinfeld/South Park episode!

    ---


    EDIT (2024-05-27): Actually, MeGUI is better...

    Monday, September 15, 2014

    Cheers to Cooking Channel; jeers to TBS

    I've got the urge to capture every single episode of Good Eats again, for the third time.

    The first was in the early 2000s with an SD capture card. Back then they didn't have HD anything. The second was when Food Network started airing their programs in HD. And now with Cooking Channel showing Good Eats in HD, I'm inclined to start capturing the hundreds of episodes again, but I can do it right this time. I know about making sure there's no bits of audio after an edited out commercial break. I know how to add chapters to a video file. And the quality is better thanks to my HD capture card.

    To Cooking Channel's credit, they aren't showing the old SD episodes with that annoying panorama/stretch-o-vision aspect ratio that Food Network does. Sure, it's stretched, but I can easily shrink it back to 4:3. It's impossible to "un-stretch-o-vision" a picture.

    And it's also impossible to uncrop cropped video. TBS apparently doesn't think much of their viewers because they're still showing Seinfeld in "HD" by cropping off the top and bottom of the picture and zooming in. When Funimation released the first Dragon Ball Z DVD sets, they thought they could get away with doing the same thing, but no one liked missing 20% of the picture and eventually Funimation released another DVD set to address the complaints. (And then once more for Dragon Ball Z Kai... and then once more again for the music-fixed DVD release...)

    I think I'll try to make my Good Eats encodes a consistent 233 MB, up from the 170 MB my SD encodes were. It'll be down from my usual 440 MB for a 30-minute show without commercials, but I don't think the show requires a high bit rate to begin with, and honestly, there are a lot of episodes. At 233 MB per episode, 18 episodes will fit on a DVD-R. At 440 MB per episode, it would only be 10 episodes per DVD-R.

    Thursday, May 9, 2013

    Video Sync Test on YouTube.

    Wish I thought of this before I tried making my own (unreliable) tests recording myself playing Tetris with no music...

    http://www.youtube.com/watch?v=EoeDZkGvvjg

    EDIT: Actually, I've found that my own "silent Tetris" videos are the most reliable after all...

    EDIT (2013.10.17): The Eye Spy on Work Time Fun is probably the most accurate test for syncing audio for Vita captures (Fraps @ 59.94 FPS). 3DS as it turns out is the same.

    DelayAudio(0.067)

    Tuesday, January 29, 2013

    All anyone needs to know about color space

    Use RGB.

    I still don't know what "TV levels" or "PC levels" are, but that's it, really.

    ConvertToRGB(clip, matrix="rec709")

    All this was prompted by news (to me, anyway) of a cheaper, better alternative to the HDfury. That made me take a harder look at my AviSynth video settings.

    Right now I'm playing Jet Set Radio (free on Vita and $2.50 on PS3 thanks to PlayStation Plus), and I recorded one of the sewer levels. Those levels are always dark. Playing the level on my monitor was fine, but my raw capture (MJPEG) was darker than I remembered. I learned from this thread that the capture was YUV (confirmed with MediaInfo and the Blackmagic site), and that RGB would've been ideal.

    That's when I looked for an AviSynth solution and found this page. And wow, what a difference...

    Raw capture (YUV):



    Converting to RGB:


    For me, this is huge. Going back to the Tekken 3 days, Castel's combo videos were always clearer and crisper than my own. My blanket solution was just to brighten the whole clip, but I wasn't completely satisfied. Fast forward a decade and I was capturing Einhänder from my PS3 and expecting great things. However, the first two levels were as dark and muddy as ever, and certainly a far cry from the crisp picture from emulators. I'm going to try Einhänder again, and while I don't expect that level of improvement, I'm still excited to see the results.

    Downsides to using RGB? Considerably longer encoding times. The 1st pass was about 38 fps instead of about 88, and the 2nd pass was only a little slower at about 36 fps instead of about 60. I also know some AviSynth filters can't be used with some color spaces, but I rarely try anything fancy.

    -

    EDIT: Well that was a waste of time... after actually encoding with my usual settings in Xvid4PSP (i.e. without color space lines in AviSynth), the videos look pretty much the same, both looking more like my RGB vid. Quite a difference from the raw video screen grabs above. Looks like I still won't bother adding any color space lines to my AviSynth scripts after all, since I'll get the fastest speeds and the best picture quality anyway.

    Thursday, November 22, 2012

    Blacking out frames with AviSynth (BlankClip)

    Jeez, I don't know why it took me this long.

    I've been capturing shows off the DVR as a hobby for about a decade now. Over the years I've fine-tuned my editing technique. Before I used to clumsily trim the clips right in VirtualDub, never knowing if I really did find and cut all the commercials out. Joining the clips was a pain and clips pieced back together were usually out of sync anyway. Today, I use AviSynth to consistently and elegantly trim my videos.

    With VirtualDub's view -> Audio Display feature, I'm able to more accurately edit my captures down to the frame. When the commercials end and the program begins, sometimes the audio from the commercial spills over a few frames into the program. And sometimes the audio of the program begins before the first frame of the program appears.

    The goal, of course, is to remove all commercials. Editing strictly by frames, one segment might start with a a bit of audio from a commercial. In that case, I use ApplyRange to mute that portion:

    ApplyRange(1797,140673, "Amplify",0.0)

    If the audio of the program plays before the first frame of the audio, I would start at the audio. I'll then use FreezeFrame to either copy the frame from the first frame of the program back to the audio, or I'll black out those other frames entirely.

    The issue was finding a black frame in the first place. A lot of times I could try to find a black frame between commercials or at the very end of the program. But why not take the guesswork out of it and add a single black frame at the beginning or end of your video? I prefer the end -- here's an example of me blacking out the last few frames:


    c1=AviSource("Untitled 50.avi").Trim(151,1948)
    black=BlankClip(c1,1)

    AlignedSplice(c1,black)
    FreezeFrame(1797,1799,1799)

    I guess I'll make a proper post about capturing and editing TV shows with my setup later on.

    Tuesday, November 8, 2011

    Another AviSynth success story: DelayAudio

    So I have this rule about capturing video for only a few seconds before I really want to capture something. I found out the hard way that if the hard drive's still warming up, the audio will be out of sync in the raw video (too early).

    I didn't follow my own rule for some reason and this happened again, but AviSynth saved the day. First, I looked for a point in the video where I would be able to listen to audio cues -- in this case, moving the cursor in  a menu. Using my new best friend in VirtualDub (Audio Display), I determined that the audio was early and wrote down the time (0:03:05.051). The point in the video where this would've been shown was at 0:03:08:254, so it was a time difference of 3.203 seconds.

    All I had to put in my script was this line (before using Trim) and I could edit normally:

    DelayAudio(3.203)

    Sunday, October 9, 2011

    VirtualDub Audio Display

    I can't believe I was ignorant of this for so long.

    In VirtualDub: View > Audio Display

    Knowing exactly when silence starts and stops makes editing out commercials a hell of a lot easier, especially when there's sound before and after any picture on screen. I always wanted something like this in VirtualDub so I wouldn't have to rip the audio, load it in Audacity, and try to guess where to edit the frames like an idiot. I don't check for VirtualDub updates that often, but I'm on version 1.9.11 right now and apparently it's been a feature for a while now.

    I only started to search for a "VirtualDub Audio Display" when trying to record the anime sequences from Persona 4 (which I got yesterday -- only four days after I ordered it!). The screen would fade to white and there was a point where the music stopped and you heard a sound that signaled when a battle was going to begin. I wouldn't be able to tell how to edit the video based on frames like I normally do if I'm really looking for sound cues, and as long as VirtualDub stutters while playing videos, guessing for an exact time wasn't an option either.

    Of course, now I have to keep the VirtualDub window maximized, but that's not a big deal.

    Sunday, June 26, 2011

    Capture problems lead to new discoveries

    I'm having a problem right now with capturing; with my last capture, the HDMI video output was just fine, but when I played back the video raw, there was no audio. Now I can't capture anything. A full reset of the DVR briefly brought back a picture, but as soon as I selected another window, the picture went away again.

    So, I went to the Blackmagic support page. I thought I'd look for updates to Media Express or the Intensity Pro itself, and sure enough, I found them. Here's one nice update for people wanting to record their PSP in 480p (even though cool people like me already bought a scaler for 720p and zooming in anyway)...

    Intensity 3.9.4 for Windows
    Date Added: 05 January 2011

    What's new in Intensity 3.9.4
    Support for 480p/60 capture with Media Express 2.3 with Intensity Pro

    Instead of Media Express, there's "Desktop Video," which I'll get around to downloading later because my brother is watching something on Netflix.

    ---

    EDIT: Even after upgrading the driver to 3.9.4 (which also requires a firmware update for the card), I still can't use that new Desktop Video thing. At least Media Express 2.3 works the same, if not a bit better (the picture popped up in the capture preview much quicker).

    ---

    EDIT: I still can't record PSP's 480p output directly with the Intensity Pro... maybe because it's 720x480 and not 640x480? Why can my friend do it directly with his Intensity Shuttle? And forget about the new firmware or whatever making the picture appear quicker.

    ---

    EDIT (2011-08-03): Yesterday I tried to connect my PSP to that old 480p TV via component and it wouldn't display - I'd only get wavy lines. It did display when I kept component but switched from interlaced to progressive on my PSP. So I guess 480p and "720x480 in progressive" are pretty different... but 480i is always 640x480. 

    ---

    EDIT (2015-02-19): Whoops, forgot: actually, that TV mentioned above was only 480i, so of course I'd get wavy lines trying progressive.

    Friday, December 31, 2010

    New AviSynth Revelations; better colors, louder audio

    Capturing South Park episodes across the two half-seasons, I wondered why my older caps had "true blacks" and deeper colors, while my newer caps had slightly washed-out colors. I forgot what I did before (I used to think it was because I used DirectShowSource instead of AviSource), but after a lot of searching, all I needed to do was add this:
    ColorYUV(levels="TV->PC")
    Also, I noticed the low volume of my PSP captures (and pretty much everything else running from the DVDO Edge to the HDfury3 to the Intensity Pro via stereo), and after looking for an easy, consistent way to boost the volume across the videos I already made, it came back to good ol' AviSynth:
    AmplifydB(7)
    I'm still on the fence about amplifying the volume for TV caps; in my experience, the same PC vids played on a TV are louder, so it's safer for the volume to be "too soft" rather than "too loud." However, video games and even VHS transfers could probably use a boost. I'll still use Audacity and/or Xvid4PSP to come up with a reasonable Amplify volume boost first, then just edit the line in directly in AviSynth.

    It's also worth noting that for another one of my video game projects, the intro to a game was much louder than the actual gameplay, so I had to highlight and amplify those parts separately. And of course, the sequels had their own volume differences so I had to do the same thing there. That video also turned out great.

    So to summarize, my basic AviSynth script (using PSP gameplay caps, resized & cropped) looks like this:
    #Echoshift - A7 Cast
    #PSP-DVDOEdge-HDfury3

    DirectShowSource("H:\Untitled 7.avi")
    ColorYUV(levels="TV->PC")
    AmplifydB(7)
    ChangeFPS(59.940)
    Crop(6,6,-14,-8)
    Lanczos4Resize(848,480)
    Trim(2683,4643)++Trim(4905,7579)