Virtual DJ Studio Home | NGWave Home | Official Facebook Page | Unofficial VDJ Users Group

Author Topic: Eureeka Moment :)  (Read 10210 times)

Offline Justin

  • Site Administrator
  • Administrator
  • Hero Member
  • *****
  • Posts: 949
  • Karma: 11
    • View Profile
    • Virtual DJ Studio
Eureeka Moment :)
« on: November 04, 2016, 10:43:50 AM »
Ah, the joy of that moment when it all comes together. I finally quit procrastinating the inevitable -- tackling the task of "hijacking" the audio stream from the video -- and it works. Now the audio is fed directly into my own audio processing routines and mixed down just like all other files. EQ, AGC, headphone preview, VU meters, etc.

There's still some work to do - like figuring out how to handle crossfading/triggering. I'm not sure a video file should "skip silence" or cut to the next track (especially if that is also a video) when the level goes down. Or should it? Perhaps a program option, or a "per-line" setting? This is new territory really...

For now anyway, the basics are in place now. I have some tidying up to do - mostly ensuring A/V sync - but most of the audio work is already done as it treats the audio just the same as any sound file.

There's also the issue of what happens when you start playing a video, while another video is playing. I think I will handle it just like I do with Karaoke files - whichever was last started, takes over the screen. A quick pause/unpause would resume a previously-playing video on the main screen. I could go as far as having a "video selector" to pick which of the currently-playing video files goes over, but that's getting more like a TV production studio... and generally unnecessary as you would likely just be playing one song at a time except during transitions...

So for now, I'll stick to the "whichever was started last" method as with the karaoke CDG files. I could offer a "mute video" option if you want to just play the sound portion... just as a per-line option. But I'm now focusing on cleaning up the code and getting it ready for a possible beta test ;)

I have yet to try mixing videos within the playlist but in theory that should "just work"... again the crossfade issue comes to mind.

Perhaps this (I'm thinking out loud here)... if the next song to be triggered (be it playlist or line -> line) is audio-only, go ahead and trigger at the appropriate "fade time", letting the video portion ride out. If the next track is also a video, then trigger only when the previous one is completely finished.

And before anyone asks, there are no plans to "fade" or do video transitions - at this time. Only the audio will overlap/crossfade. The video will be one or the other (mutually exclusive).

Back to work, just had to take a breather and post my progress. I may post a short video later on after I sort a few details out in the code...
-- Justin Nelson, CEO
   Next Generation Software, Inc.
   http://www.vdj.net/

Offline Justin

  • Site Administrator
  • Administrator
  • Hero Member
  • *****
  • Posts: 949
  • Karma: 11
    • View Profile
    • Virtual DJ Studio
Re: Eureeka Moment :)
« Reply #1 on: November 04, 2016, 01:26:47 PM »
Of course after doing some tweaking and testing, I tried on my Windows 7 machine... it doesn't like the audio format for some reason. I'll have to do some tweaking, as I want everything to work on a minimum of Windows 7 SP1 (in theory it should also work on Vista and even XP with certain "media center" updates, but I won't "officially" support anything lower than 7SP1).

It's not a deal breaker, pretty sure it's a simple fix... just need to walk away from it for a few minutes and regroup :)
-- Justin Nelson, CEO
   Next Generation Software, Inc.
   http://www.vdj.net/

Offline Fabio

  • Administrator
  • Hero Member
  • *****
  • Posts: 755
  • Karma: 11
    • View Profile
Re: Eureeka Moment :)
« Reply #2 on: November 04, 2016, 01:53:40 PM »
Quote
I'm not sure a video file should "skip silence" or cut to the next track (especially if that is also a video) when the level goes down. Or should it? Perhaps a program option, or a "per-line" setting? This is new territory really...

Why don't you do whatever is simplest?  When we start beta testing I'm sure it will become clear one way or the other.  If it  needs changing we'll let you know.  If it works as is then no need to change it.

Quote
Of course after doing some tweaking and testing, I tried on my Windows 7 machine... it doesn't like the audio format for some reason. I'll have to do some tweaking

oh...I'm sure you'll figure it out.

-
Fabio Q.
Shooting Star Karaoke

Offline Justin

  • Site Administrator
  • Administrator
  • Hero Member
  • *****
  • Posts: 949
  • Karma: 11
    • View Profile
    • Virtual DJ Studio
Re: Eureeka Moment :)
« Reply #3 on: November 04, 2016, 02:30:22 PM »
Oh I figured it out alright. Microsoft is phasing out 7 pretty bad... if you do a clean, OEM install even with SP1 already there (as I did with my Acer using the OEM restore), you CANNOT run windows update. You cannot download and install updates manually. You pretty much are stuck with all the security holes that were present in, what, 2010?

Just extremely frustrated. I'm not even going to worry about my Win7 computer - I'm just going to get this BETA ready that I *know* works on Windows 10, and hope that for you 7 and 8 users, you'll report that it works for you as well and my problem is just a junk computer (well, a junk OS... I'll probably end up putting Linux on that one :) )

So I'm ignoring that computer. Works great on my little HP with Win10 Home, and this computer running "Pro".

Before I can put up any kind of beta I have to write the installation package, which is a bit time consuming (make sure all the various components are installed correctly, etc). This weekend for sure, I will have something for you guys to test.

Quote
Why don't you do whatever is simplest?  When we start beta testing...

In other words, SHUT UP AND GIMME THE BETA ALREADY!!! :)  Okay point taken!  Give me a day or two...
-- Justin Nelson, CEO
   Next Generation Software, Inc.
   http://www.vdj.net/

Offline Fabio

  • Administrator
  • Hero Member
  • *****
  • Posts: 755
  • Karma: 11
    • View Profile
Re: Eureeka Moment :)
« Reply #4 on: November 04, 2016, 05:50:30 PM »
Quote
In other words, SHUT UP AND GIMME THE BETA ALREADY!!! :) 

Lol...not exactly what I meant, but if that's what it takes...!

Hahahaha!...
Fabio Q.
Shooting Star Karaoke

Offline chaz

  • Full Member
  • ***
  • Posts: 109
  • Karma: 0
    • View Profile
Re: Eureeka Moment :)
« Reply #5 on: November 04, 2016, 08:43:33 PM »
Quote
In other words, SHUT UP AND GIMME THE BETA ALREADY!!! :) 

Lol...not exactly what I meant, but if that's what it takes...!

Hahahaha!...

LMAO

Offline chaz

  • Full Member
  • ***
  • Posts: 109
  • Karma: 0
    • View Profile
Re: Eureeka Moment :)
« Reply #6 on: November 04, 2016, 08:46:34 PM »
Ya agreed Justin... I am not happy with the phase out.. I have clients using older versions.. and I have to do all the updates manually .. Some machines.. Dell particularly are stubborn...
Installing 2 hours of updates and get a fail.. can make me break stuff.. LOL

Offline Justin

  • Site Administrator
  • Administrator
  • Hero Member
  • *****
  • Posts: 949
  • Karma: 11
    • View Profile
    • Virtual DJ Studio
Re: Eureeka Moment :)
« Reply #7 on: November 05, 2016, 10:40:21 AM »
I'm with you Chaz... if you have a Windows 7 machine that *works*, it's a good idea to image your drive now... so you can at least start over at this point rather than trying to catch up 7 years of updates in the event of a reinstall... of course in a corporate environment you're not going to back up every machine, and cloning all from one image is generally a bad idea... so you end up with the "rollup" updates (which still won't work for me). I can't even update IE (not that I use it, but it's required for some updates) or WMP...

But... at this point I stopped caring, since lack of updates turns out NOT to have been the problem with VDJ so I'll keep the stock SP1 for testing only. Still gonna throw Linux on there when I have time (dual-boot so I still have a 7 test PC). Should run pretty quick with the SSD drive :)

As for the audio stuff not working, it boils down to an internal MF feature that doesn't seem to work in Win7 (tested on a fully-updated machine yesterday) that does in Win10. According to the documentation, Microsoft Media Foundation is *supposed* to automatically do any resampling or reformatting of the audio to match your "sink" (normally the sound card, here it's passed on to my code). Windows 10 does this automatically just fine. 7 does not. Don't know about 8/8.1, or care because I have my own solution below:

Once I figured out the root of the problem it wasn't a big deal to just take the audio as-is and do my own resampling (it's what I already do on MP3 files). So, no big deal at all, once I slept on it and figured out that was the problem. So now stereo or mono, 44.1 or 48kHz, etc, all play just fine.

Seems like video files use more varied sample rates than audio-only files, I guess because most MP3s are ripped from CD and the ripper just preserves that format... video is usually captured, or ripped from DVD (48 kHz) or Blu-Ray (any number of sample rates to choose from), and down-mixed from 5.1/7.1/something.something surround into 1 or 2 channels... so anything can happen in the resulting file as far as the audio is concerned.

Anyway, I'm still having some odd buffer issues, trying to keep the audio and video in sync, but that will hopefully be finished up today.

Side Note
I just won a "smart" TV in a contest at our local grocery store. If I remember correctly (from when I started filling out entry forms when they started the contest), it's a 42" VIZIO. I remember seeing the box with the Hulu and Netflix logos on it so I know it's of the "smart" variety.

I know it sounds like a scam -- but the local store manager called to inform me. I know Jeff personally, I've been shopping there since they opened, and they do a lot of contests - so it's totally legit :)  Crazy the luck this year... both bad and good... Cubs Win = Good. Pacemaker wiring all messed up = Bad. Free TV = Good.

Universal balance perhaps? lol let's not get existential or philosophical here... I have a TV to go pick up (I'm heading to the store later anyway... right now I'm going back to working on the audio code) :)
-- Justin Nelson, CEO
   Next Generation Software, Inc.
   http://www.vdj.net/

Offline Justin

  • Site Administrator
  • Administrator
  • Hero Member
  • *****
  • Posts: 949
  • Karma: 11
    • View Profile
    • Virtual DJ Studio
Re: Eureeka Moment :)
« Reply #8 on: November 05, 2016, 04:58:27 PM »
Well I assumed it was a 42" but that was what I remembered seeing on display. I guess there were hundreds of prizes among all the Strack and Van Til stores (a local chain in northwest Indiana).

The one I won is actually probably better for my purposes anyway. It's a Samsung 32" Full 1080p smart TV. It's downloading its apps right now, but works perfectly as a screen.

When you press "Input", one of the options is "Screen Mirror" -- I hope like hell that is a trend that catches on. This (in theory) makes it VERY simple to connect as a wireless display using a single button on the remote (rather than going several menus deep). Now I just need to get VDJ to output this way, though it should work with AirParrot (a Windows program I purchased a while back). I'll test that in a bit after my TV is done updating lol...

Anyway I'm happy with it. I already have a 42" and a 37", so I really didn't need another huge TV. Rather I needed something that would fit on my desk that also has all the "smarts" - so winner winner chicken dinner :)

Attached are a couple pics... gotta rearrange a bit but for now it's on the back-side of my desk hooked to the little HP laptop.
-- Justin Nelson, CEO
   Next Generation Software, Inc.
   http://www.vdj.net/

Offline Justin

  • Site Administrator
  • Administrator
  • Hero Member
  • *****
  • Posts: 949
  • Karma: 11
    • View Profile
    • Virtual DJ Studio
Re: Eureeka Moment :)
« Reply #9 on: November 05, 2016, 05:08:39 PM »
One thing though... if I do the "force 720p" thing, I would have to manually "zoom" it on this TV. Hm... my other (bigger) TVs are not 1080 so I didn't realize this. My 1080p LG monitors don't do that (though I already set them up to zoom full panel).

Maybe that check box isn't the end-all solution I thought it would be...

Oh, and this TV requires only 2% overscan compensation, but can also be set to dot-for-dot (no overscan).
-- Justin Nelson, CEO
   Next Generation Software, Inc.
   http://www.vdj.net/

Offline Justin

  • Site Administrator
  • Administrator
  • Hero Member
  • *****
  • Posts: 949
  • Karma: 11
    • View Profile
    • Virtual DJ Studio
Re: Eureeka Moment :)
« Reply #10 on: November 05, 2016, 05:53:13 PM »
I just love to reply to myself lol... I see the problem now. Being a "smart" TV, when connected to a PC via HDMI it sees itself as a computer monitor. So setting 1280x720 shows like a monitor would if it weren't configured to zoom - it shows it boxed in, pixel-for-pixel by default.

The tech is growing so fast that every company adheres to their own standards. Here I thought I had the solution to the whole "multiple TV" problem but it still totally depends on what TVs are connected (and likely will still depend on the order in which they are connected).

In other words: that magic button I created doesn't do what I thought and is probably useless. Instead I will probably offer a drop-down of available resolutions, and let you choose whatever works best. Basically a shortcut so you don't have to dig through the Windows settings, and I can more easily guide users to it (since it will be the same interface regardless of what version of Windows you are on).

Still loving the 32" free TV though. I *never* gamble, buy lottery tickets, or any of that because I'm good at math :)  But this cost me nothing, just a few minutes of my time while at the store (I think I put 5 or 6 entries in total). Darn thing weighs 8.5 pounds, less than any of my computer monitors...

One point to note: If you do use an LCD/LED TV as a computer monitor, turn the "sharpness" down until the text looks good and readable up close. Sounds counter-intuitive but try it (after setting the TV to show true pixel-by-pixel full resolution) and you'll find it much better. Computer monitors always blur the pixels because the perfect squareness of a fixed pixel actually looks jagged if set to be too "sharp".
-- Justin Nelson, CEO
   Next Generation Software, Inc.
   http://www.vdj.net/

Offline vcationguy

  • Sr. Member
  • ****
  • Posts: 310
  • Karma: 0
    • View Profile
Re: Eureeka Moment :)
« Reply #11 on: November 06, 2016, 05:20:42 AM »
Congrats Justin!  Enjoy your TV and your chicken dinner!  lol  ;)

Offline Justin

  • Site Administrator
  • Administrator
  • Hero Member
  • *****
  • Posts: 949
  • Karma: 11
    • View Profile
    • Virtual DJ Studio
Re: Eureeka Moment :)
« Reply #12 on: November 06, 2016, 07:20:07 AM »
LOL I was just getting ready to post. Got some progress already, but for the moment it is using WiDi - an Intel version of DLNA that is built into Intel video drivers. So I can make it work only on my cheap laptop which has Intel video.

But for proof of concept, it works great. By default it uses 1024x768, which is fine as long as you click the "Anamorphic" button (forcing a 4:3 output to a 16:9 panel).

The next step is to implement the DLNA protocol myself, so that instead of VDJ showing up on a second monitor, then mirroring said monitor to the wireless display - VDJ would just render the video itself onto the wireless display(s) *directly*. Or optionally do both, in case you have one wired and one or more wireless (though the wired would be about 1/4 second ahead of the wireless).

Quick demo: https://youtu.be/PKdi__tLncY
-- Justin Nelson, CEO
   Next Generation Software, Inc.
   http://www.vdj.net/

Offline vcationguy

  • Sr. Member
  • ****
  • Posts: 310
  • Karma: 0
    • View Profile
Re: Eureeka Moment :)
« Reply #13 on: November 07, 2016, 05:13:57 AM »
That new video is great!  Can't wait to figure out how to do that.  :) 

Offline chaz

  • Full Member
  • ***
  • Posts: 109
  • Karma: 0
    • View Profile
Re: Eureeka Moment :)
« Reply #14 on: November 07, 2016, 03:45:36 PM »
sweet...did you have any dropouts?