Posts for TheCoreyBurton


1 2
7 8 9
12 13
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
Whoops! Well, at least now we can be sure we were thorough about this in the future.
"./programs/avs2pipemod" -wav encode.avs | "./programs/qaac64" -v 0 --he -q 2 --delay -5187s --threading --no-smart-padding - -o "./temp/audio.mp4"
"./programs/avs2pipemod" -wav encode.avs | "./programs/sox" -t wav - -t wav - trim 0.0065 | "./programs/opusenc" --bitrate 64 - "./temp/audio.opus"
Do these commands look alright to you, Aktan?
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
Just as an update for anyone else following this, Aktan and I are regularly chatting about it still. Aktan noticed there are inconsistencies in the delay regarding aac before and after it's muxed (delays which vary depending on muxer, also) and that still needs to be worked out and then trialed.
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
Apologies, there was a flaw in my files. Everything was done at the right sample rate but I forgot to change the export settings and in the end they were all at 44100hz. I fixed the files and now they're out by varying amounts (like I'd expect). Here's a link to my test files, batch file and output files so you can see what's going on.
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
Well, this is interesting. I'm getting 80.5ms of delay on the output files in contrast with the original - that is, at 32khz, 44.1khz and 48khz the aac files seem to have a delay of roughly 80.5ms when done that way. I think what bothers me about this is the fact that with the 957 samples cut, all the output files line up correctly together - implying your findings are correct. For testing purposes, I'm using this batch file to quickly encode and decode wav tests to aac and back:
qaac64 -v 0 --he -q 2 --delay 957s --threading --no-smart-padding 32.wav -o 32-aac.mp4
qaac64 -v 0 --he -q 2 --delay 957s --threading --no-smart-padding 44.wav -o 44-aac.mp4
qaac64 -v 0 --he -q 2 --delay 957s --threading --no-smart-padding 48.wav -o 48-aac.mp4
ffmpeg -i 32-aac.mp4 32-output.wav
ffmpeg -i 44-aac.mp4 44-output.wav
ffmpeg -i 48-aac.mp4 48-output.wav
My software versions are identical to the ones you posted.
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
"./programs/avs2pipemod" -wav encode.avs | "./programs/sox" -t wav - -t wav - trim 2112s | "./programs/qaac64" --quality 0.25 - -o "./temp/audio.mp4"
"./programs/avs2pipemod" -wav encode.avs | "./programs/sox" -t wav - -t wav - trim 0.0065 | "./programs/opusenc" --bitrate 64 - "./temp/audio.opus"
I just used those two command lines (and the existing YT one) and got timings which were perfect on a series of 44100hz and 48000hz files. It's all fixed and I'm satisfied with that. Thanks again for the time you put in to testing this Aktan!
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
Edit: Link removed.
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
I appreciate you looking into this for me! I'm still seeing (both when compared to an a accompanying video & in waveform lineups in Audacity) the opus stream playing significantly earlier than the original. Without the trim of the 286 samples, it's about ~75ms early (just an estimate). This was using opus-tools 0.1.10.
I'm not as active as I once was, but I can be reached here if I should be needed.
Post subject: Audio Delays & Discrepancies in the Encoding Package
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
Hey fellow encoders & otherwise knowledgeable folk, I was watching a couple of my encodes before deleting the lossless dumps and I noticed a couple of discrepancies in relation to the audio. I did some investigation into the matter and discovered a few other potential problems too. I originally messaged feos directly about this, who suggested bringing it to the forums for open discussion - which was a great idea! - and so here it is. The first issue I noticed is in relation to audio delay. The sync was visibly inconsistent between the youtube encode (venc), the mp4 (neroaacenc) and the mkv (opusenc) when playing back videos (the Youtube video lined up as expected, but the mkv and mp4 played back the samples too early) and so investigation was required. To do some testing, I first created a simple test wav file, loaded it up in AVISynth via (ffms2 for consistency) & Virtualdub and then exported it as wav. I did the same for each of the other test files, to ensure the results were all treated the same way. I also did a FLAC encode as a control for the tests. Here's an archive with all the wav files for reference. My initial results were as follows: "wav_original" was the original file and therefore was perfectly in sync. "flac_control" was my control file and was also perfectly in sync, but cut off at the end (not related to this test, however). "venc_scriptdefault" was out - but not by a lot. The amount was minuscule and not audible in long run so theoretically could be considered in sync. "neroaacenc_scriptdefault_4672s" was out by a fair bit. It played the sounds audibly earlier than they were supposed to sync, which implied that trim value was incorrect. I changed it to 2464s (something I calculated myself) and tested it as "neroaacenc_scriptdefault_2464s" and it appeared to be back in sync. "opusenc_scriptdefault" was out by even more than the previous clip (I noticed it in an encode and this is why I was performing these tests). There didn't appear to be a setting to fix this in the encoder, so instead I took to AVISynth and added the command "DelayAudio(0.07258)". This file was then saved as "opusenc_delayaudio" and appears to have fixed the issue as well. In terms of implementation, I used the following line in AVISynth:
DelayAudio(0.07258)
There's probably a better way to do this, potentially if it's tied to "(i444 == true) ?", although that would mean that global.bat would need to be re-ordered so that i444 was set to true prior to the audio encoding. This way, the delay could be tied specifically to the MKV encodes (which as far as I can tell are the only ones which use opusenc for audio). Because these were made with a simple test clip, I decided to test these findings and values with a few other runs (specifically Paper Mario, as I still had the lossless files) and small handful of SNES and NES runs (as they were fairly quick to dump and encode). My goal here was, to ensure the values stay consistent in any situation. There was a discrepancy regarding MP4 and sample rates in these tests. My original test was for 44100hz, but at 48000hz it yields slightly different results. Both cases however, are far more accurately in sync than when encoding using the original trim value. The variance is slightly less than what venc was out by originally and if we've considered that to be in sync, then this is also acceptable. Of course, this isn't my call to make. As an alternative problem, I encountered two interesting situations on my NES test. I was using Morimoto's SMB3 run (the run that introduced me to the TAS world, so long ago) - probably a poor choice, but I have a soft spot for it and ideally we want this to work in any situation so it'll do (but apologies if any of the issues I mention are exclusive to Famtasia and not an issue elsewhere). Firstly, I noticed an audible click at the start and end of the logo's silence. Changing the following in the script fixed the problem (the only line that was altered was the last line): Before:
d = ImageSource(file=file, start=0, end=int((g.FrameRate * 2) - 1), fps=g.FrameRate) \
   .ConvertToRGB32().AssumeFPS(g.FrameRateNumerator, g.FrameRateDenominator)
e = BlankClip(d, audio_rate=g.AudioRate, channels=g.AudioChannels)
f = AudioDub(d, BlankClip(g)).LanczosResize(g.width, g.height, taps=2)
After:
d = ImageSource(file=file, start=0, end=int((g.FrameRate * 2) - 1), fps=g.FrameRate) \
   .ConvertToRGB32().AssumeFPS(g.FrameRateNumerator, g.FrameRateDenominator)
e = BlankClip(d, audio_rate=g.AudioRate, channels=g.AudioChannels)
f = AudioDub(d, e).LanczosResize(g.width, g.height, taps=2)
To be entirely honest, "e" isn't used elsewhere in that section of the script and looks like it was meant to be used this way all along. This fixes the above issue and keeps the sync identical (so should be able to be used without any adverse effects) and should prevent this problem from occurring in the future. And lastly, venc crashes when given an 8-bit input, such as the one Famtasia produced, and doesn't output audio at all. ConvertAudioTo16bit() was required in this case to ensure it worked properly. I'm not sure on the correct AVISynth syntax, but a check for the "hd" variable (to ensure this tweak is only applied to the Youtube stream, which is the encode that uses venc) along with a second check to see if the audio is 8-bit - and if BOTH are true (so only apply it when it's completely necessary) having it convert the audio to 16 bit might be a useful addition to the script (to avoid potential errors if these circumstances are ever replicated). So I guess there are three points of discussion there - the audio sync, the logo silence and the 8bit>16bit conversion. I've not been a publisher long, so I'd love to see what some of the veterans think about this and the potential solutions!
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
This is an update for anyone waiting for this run to be published, and for anyone in the future who encounters any problems when encoding this game themselves. There were a number of graphical and emulation problems, a lot of which have previously been mentioned by fsvgm777 in posts above. Additionally, I've discovered a number myself. This isn't a complete list of what was encountered and how it was dealt with, just a summary. Sorry for how long this encode is taking. Often objects placed at similar depths ended up experiencing similar problems to Tubba's tongue, and were fixed in the same way (by using cxd4 LLE). Examples include Parrakarry's third returned letter, electricity in one of the blooper fights and the flagpoles of the Toads during the end credits. CXD4 LLE also introduced clipping in certain object shadows, sometimes causing them to be completely absent. In addition to fsvgm777's comments about N64 depth compare, it also breaks multisampling, causing lines between objects to appear all over the place. This was circumvented by combining footage in AVISynth after the fact. This same method also helped solve the fact that native res texrects fixed the grey message boxes but broke the text itself. Most grey message boxes should look fine in the final encode, although the one in Boo's Mansion was not affected by the native res texrects setting (I'm not sure why) and therefore couldn't be fixed. There were also a few different scenarios regarding the updated version of GLideN64 released recently. The old version crashes on certain drivers and cards in the dark rooms in Shy Guy's toybox. The older version of GLideN64 incorrectly rendered magic effects as purple, whereas the newer one rendered these correctly. Unfortunately, the newer version of GLideN64 was prone to something I've dubbed the "zoom" glitch: http://www.mediafire.com/file/hjhki7wn7rp593g/Mario+Story+%28Japan%29.avi I'm still not entirely sure what was going on there or why it was happening. Both versions of GLideN64 have different viewports too. I've just finished watching through the most recent iteration of the encode and it looks good. I'm still going to have to tweak one or two things and re-encode the run, then watch it to make sure everything's worked out the way it's supposed to and no timings are off before I can consider uploading it, but it shouldn't be too long now. Again, apologies for how long this run is taking to publish. I just want this spectacular run looking as good and as accurate as it possibly can!
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
Here are some extra downloadable videos for the published Japanese run and accompanying North American run in various resolutions. 16:9 encodes were achieved using a widescreen hack: Japanese (published) run: 10bit444 MKV: 240p, 360p, 480p, 720p Compatibility MP4: 240p, 360p, 480p, 720p Japanese (published) run in 16:9 widescreen: 10bit444 MKV: 240p, 360p, 480p, 720p Compatibility MP4: 240p, 360p, 480p, 720p North American run: 10bit444 MKV: 240p, 360p, 480p, 720p Compatibility MP4: 240p, 360p, 480p, 720p North American run in 16:9 widescreen: 10bit444 MKV: 240p, 360p, 480p, 720p Compatibility MP4: 240p, 360p, 480p, 720p
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
I've been chatting to fsvgm777 for a bit and have worked through a lot of the graphical problems for this run. I'll be more than happy to do the encode for this. I'll be away for just over a week and will be unable to claim this, but I'll be working on it in my down-time still.
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
RingRush, do you have a preference for the screenshot for this run?
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
The short answer is yes. It's taking this long because it's proving to be a difficult run to encode with quite a number of problems and setbacks (including graphical problems and also sync problems), so it's taken quite a lot of time to fix them up. Here's a proper detailed update: Regarding sync, running the game at 640x480 using Glide64mk2 is the only guaranteed way I've found to make it play through from start to finish. Using higher resolutions or different plugins results in desyncs at various points. As an example, with GLideN64 there were 97 points where this happened. That being said, I didn't try every possible resolution, just the relevant ones to the syncing and encoding process. I have a few thoughts and can speculate as to why this happened - Fog suggested that it could be tied to CPU speed and he's definitely more versed in this than I am, so I'd trust his judgement. Feos worked diligently to make a series of lua scripts based on information provided by Isotarge for parsing the run (which was run using the movie with Glide64mk2 at 640x480, to ensure sync) and then detecting a desync (which was done using the desired dumping plugin at the desired resolution - which also meant this process was slow). When the script detected a value that didn't match the original movie, it'd pause the playback and alarm. I could then use TASStudio in a separate instance of Bizhawk to save a state from the Glide64mk2/640x480 movie a frame or two before the desync and use that to resume the movie correctly. When loading a savestate, for several frames it outputs the frame the savestate was saved on. This means despite using GLide64 at a high resolution, the frame that was displayed was from Glide64mk2 running at a much lower resolution. After some more testing, it was deemed that an offset of 5 frames negated the problem. Feos wrote two more scripts this time, the first was for AVI dumping. It checks the directory for savestates and loads them at the specified frame, so the run could be dumped in one shot and sync correctly. It also has an offset variable that dumps x frames past the desired frame, pauses dumping, loads the state and proceeds x frames and the resumes dumping (where x is an integer). The second script was used for offsetting savestates back x amount of frames, to save me re-saving them all if I needed to go down that route with the offset. There were still a number of issues (such as states being two frames apart in certain situations, causing the offset script to loop or when done manually, causing incorrect frames to be in the output) that had to be resolved, but as of a week ago this has all been resolved. In the time since then, I played back the run (both my GLideN64 dump and my reference Glide64mk2 dumo) and noticed a number of graphical discrepancies between the two. I went back and redid all of the above for Glide64mk2 - though without the testing and with knowing what I was doing this time around it was a much easier process. After that, I watched the run a couple of times and noted down anything that didn't look right or looked different between the two encodes and compared each situation to the console. In some situations neither was perfect and I had to opt for which was closest. I spliced them together at specific frames, had to fix the frame rate (because alternate sync had to be used for the dumping process to ensure there were no audio anomalies) and am currently in the process of watching a low-res encode I made to ensure everything went smoothly. I'm really sorry it's taken so long to do and I can't express my gratitude to feos enough for all his help. I don't want to give an ETA on this because I've thought it was ready twice now (only to discover things that needed to be tweaked or fixed) but provided there's no more nonsense, I should be ready to begin the actual encoding process today or tomorrow. I'll be uploading the 240p encode to my Youtube Channel privately later on today just in case anyone here can notice anything that isn't accurate to the console. I think it's all good (except for things that I've tried fixing but that can't really be helped), but if you or anyone else can find anything that needs to be fixed I'll see what I can do. Given the time it's already taken, we may as well get it right! :D Edit: Video removed as the run has now been published!
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
feos wrote:
Corey got it to sync as well, it depends on the plugin, and even on the resolution, probably on something more though.
Yeah, I messaged Fog about it who suggested it might be related to CPU speed. I played around with a few different emulation related settings and found that the most reliable sync comes from configuring the emulator to use Glide64mk2 running at 640x480 prior to loading the ROM and movie. In regards to the encode, sorry it's taking a little bit of time. Feos and I spent quite a bit of time working back and forth in order to get it to sync consistently and reliably at higher resolutions and on more accurate plugins. Feos found a way around the problem and I'm about a third through the 4K resync using GLideN64. Looks like it'll be a smooth journey from here, but let's not jinx it!
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
I thoroughly enjoyed watching this! Should it get accepted, I would be happy to do the encoding for it.
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
The best way I've found to achieve such a thing is to do it to the whole video. As mentioned by scrimpeh, sprites are often broken up into tiles and that causes quite a lot of abnormalities if you apply it on a per-sprite basis. PointSize for AVISynth is very effective at doing this. xBRZ(scale=6) is what I use when I'm after this specific effect. A while ago I often did personal encodes for my own viewing with one audio track and three video tracks - one with the original pixel output point-scaled up, one with xBRZ and one with a scanline/CRT simulated effect. It was time consuming, but I could switch through several ways of viewing the video as I watched it and I quite enjoyed that.
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
Thank you. I messaged Fog and he helped me import the file (I believe it was an oversight on my behalf). The correct way to do so is to use FFVideoSource, for anyone else coming across this message.
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
Looked into it a bit further since my last post. Seems like the reason LSMASH didn't work but LibAV did is because they use different ways of demuxing the clip (and from what I can tell, the demuxer LibAV has more success than the one LSMASH uses but still can't handle the file correctly which is what leads to the inconsistent freezing). I'm not sure what's up, I think it's either a missing codec on my behalf or the source filters struggling to demux the clip in conjunction with this particular codec. Remuxing a short portion to MKV and loading it up with FFVideoSource worked perfectly, but the file's well over 1tb in size so remuxing the whole thing isn't possible. Plus, I'd rather solve the issue and load the file directly. in terms of codecs, I can't actually play back the video file. I use MPC-HC and have ffdshow tryouts (and a whole other host of various codecs) installed, but I get the same grey screen which leads me to believe my issue might be solvesble with a simple codec - then I could perhaps use AVISource. Additionally, the file's in good condition. Programs like AVIDemux load the clip without issue. Hopefully this information is helpful in some way!
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
If you're in doubt, you could always make a backup of your plugins folder and uninstall AVISynth. Then reinstall the 32-bit version and make sure you're running the 32-bit virtualdub. I do this on a 64-bit OS for compatibility reasons so there's no harm there. It's a long shot, but this could help resolve your problem prior to Aktan's return! I have a question of my own, too. What's the best way to get FFV1 AVI files produced with Dolphin into AVISynth on Windows? AVISource and FFMS2 produce a grey video (it seems they can't decode it); LSMASHSource can't decode it (it gives off an error message). LWLibavVideoSource can load it up and display it correctly but the process eventually hangs after playback or encoding of a few frames (there's no common point in the video or number of frames before the freeze, it's usually just happens after a few minutes). How do you guys import these clips?
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
I do still think that Youtube uses poor x264 settings and a CRF in the mid 20s, but that's speculation on my behalf. My internet is throttled at the moment thanks to poor weather conditions, but as soon as it's unthrottled I'll try work this backwards. I'm thinking if I take the lossless file and work out what settings I need to use to make the artifacts appear, hopefully that information lets us work backwards to a point of either encoding a certain way or altering the script with a preventative measure to ensure they don't appear.
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
Ah. I had disabled the Wiimote out of habit from past experiences. Enabling it worked wonderfully. No error messages and it syncs. Thank you guys for all your help resolving the the matter!
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
All I can think of at this point is that there must be a setting or version discrepancy that I'm not seeing.
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
I opted for modifying the Dolphin source as it seemed like the more efficient option. When the DTM playback gets to where the errors would popup, it continues playing past the error point. The issue now is that the screen instead goes black and remains like that. I only tested the first 20,000 inputs but there was no change after the first black frame. This could be a result of me doing something wrong in the editing and building process though. I'll keep playing around with it in the meantime.
I'm not as active as I once was, but I can be reached here if I should be needed.
Experienced Forum User
Joined: 10/14/2013
Posts: 335
Location: Australia
Thank you for all your efforts! You're correct with the assumption of the scan path, if I make the adjustment I get the invalid file error as well. I'll look into making a custom build of Dolphin with the change you suggested if I can work out how. I've not had much experience / success with compiling from Github repositories (let alone applying the change directly to 5.0 and not a further revision so the movie still syncs correctly) but I'm sure a bit of research and a couple of Google searches and I'll be fine - I've been meaning to do it anyway. Regarding the DTM batch editing, I might be able to whip something up. I'm thinking the easiest way might be to cut the movie file into two parts (the header data, then the movie data itself) and apply a correction to the affected change-cd bit, then repeat that same correction at 8 byte intervals. Then it's just a matter of re-adding the header. It's a cut-and-dry, cheap solution but it should do the trick. I'll have to see how it goes. I'll have to report back tomorrow as it's very late here now, but I'll definitely come back with an update once I have news on the matter.
I'm not as active as I once was, but I can be reached here if I should be needed.
1 2
7 8 9
12 13