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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Hardware & Software > Software players

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th December 2014, 09:34   #641  |  Link
romulous
Registered User
 
Join Date: Oct 2012
Posts: 179
A minor thing, but would it be possible to get a couple of preset window sizing options? These four in particular:
50%
100%
150%
200%
romulous is offline   Reply With Quote
Old 19th December 2014, 07:39   #642  |  Link
Zachs
Suptitle, MediaPlayer.NET
 
Join Date: Nov 2001
Posts: 1,721
Player Extensions - Go to time extension

As of v2.15, MPDN has a new feature called Player Extensions.
This allows the player to be extended via C# Script.

Here's a simple example where it adds a "Go to time" option (place these files under "PlayerExtensions" folder).

GoToTime.cs
PHP Code:
using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace 
Mpdn.PlayerExtensions.ZachSaw
{
    public class 
GoToTime IPlayerExtension
    
{
        private 
IPlayerControl m_PlayerControl;

        public 
ExtensionDescriptor Descriptor
        
{
            
get
            
{
                return new 
ExtensionDescriptor
                
{
                    
Guid = new Guid("7C3BA1E2-EE7B-47D2-B174-6AE76D65EC04"),
                    
Name "Go To Time",
                    
Description "Jump to a specified timecode in media",
                    
Copyright "Copyright Zach Saw © 2014. All rights reserved."
                
};
            }
        }

        public 
void Initialize(IPlayerControl playerControl)
        {
            
m_PlayerControl playerControl;
            
m_PlayerControl.KeyDown += PlayerKeyDown;
        }

        public 
void Destroy()
        {
            
m_PlayerControl.KeyDown -= PlayerKeyDown;
        }

        public 
IList<VerbVerbs
        
{
            
get
            
{
                return new[]
                {
                    new 
Verb(Category.Playstring.Empty, "Go To...""Ctrl+G"string.Empty, GotoPosition)
                };
            }
        }

        private 
void GotoPosition()
        {
            
using (var form = new GoToTimeForm())
            {
                if (
form.ShowDialog(m_PlayerControl.Form) != DialogResult.OK)
                    return;

                if (
m_PlayerControl.PlayerState == PlayerState.Closed)
                    return;

                if (
m_PlayerControl.PlayerState == PlayerState.Stopped)
                {
                    
m_PlayerControl.PauseMedia(false);
                }

                
m_PlayerControl.SeekMedia(form.Position 1000);
            }
        }

        private 
void PlayerKeyDown(object senderPlayerKeyEventArgs e)
        {
            switch (
e.Key.KeyData)
            {
                case 
Keys.Control Keys.G:
                    
GotoPosition();
                    break;
            }
        }
    }

GoToTimeForm.cs
PHP Code:
using System;
using System.Globalization;
using System.Windows.Forms;

namespace 
Mpdn.PlayerExtensions.ZachSaw
{
    public 
partial class GoToTimeForm Form
    
{
        public 
GoToTimeForm()
        {
            
InitializeComponent();
        }

        public 
long Position
        
{
            
get
            
{
                
TimeSpan timespan;
                if (
TimeSpan.TryParseExact(textBoxPos.Text, @"hh\:mm\:ss\.fff"CultureInfo.CurrentCultureout timespan))
                    return (
longtimespan.TotalMilliseconds;

                return -
1;
            }
        }

        private 
void ButtonOkClick(object senderEventArgs e)
        {
            if (
Position 0)
            {
                
errorProvider.SetError(textBoxPos"Invalid time");
                
DialogResult DialogResult.None;
            }
            else
            {
                
errorProvider.SetError(textBoxPos"");
            }
        }
    }

GoToTimeForm.Designer.cs
PHP Code:
namespace Mpdn.PlayerExtensions.ZachSaw
{
    
partial class GoToTimeForm
    
{
        
/// <summary>
        /// Required designer variable.
        /// </summary>
        
private System.ComponentModel.IContainer components null;

        
/// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        
protected override void Dispose(bool disposing)
        {
            if (
disposing && (components != null))
            {
                
components.Dispose();
            }
            
base.Dispose(disposing);
        }

        
#region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        
private void InitializeComponent()
        {
            
this.components = new System.ComponentModel.Container();
            
this.ButtonOK = new System.Windows.Forms.Button();
            
this.ButtonCancel = new System.Windows.Forms.Button();
            
this.textBoxPos = new System.Windows.Forms.MaskedTextBox();
            
this.label1 = new System.Windows.Forms.Label();
            
this.label2 = new System.Windows.Forms.Label();
            
this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
            ((
System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
            
this.SuspendLayout();
            
// 
            // ButtonOK
            // 
            
this.ButtonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom System.Windows.Forms.AnchorStyles.Right)));
            
this.ButtonOK.Cursor System.Windows.Forms.Cursors.Default;
            
this.ButtonOK.DialogResult System.Windows.Forms.DialogResult.OK;
            
this.ButtonOK.Location = new System.Drawing.Point(5085);
            
this.ButtonOK.Name "ButtonOK";
            
this.ButtonOK.Size = new System.Drawing.Size(7523);
            
this.ButtonOK.TabIndex 3;
            
this.ButtonOK.Text "OK";
            
this.ButtonOK.UseVisualStyleBackColor true;
            
this.ButtonOK.Click += new System.EventHandler(this.ButtonOkClick);
            
// 
            // ButtonCancel
            // 
            
this.ButtonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom System.Windows.Forms.AnchorStyles.Right)));
            
this.ButtonCancel.Cursor System.Windows.Forms.Cursors.Default;
            
this.ButtonCancel.DialogResult System.Windows.Forms.DialogResult.Cancel;
            
this.ButtonCancel.Location = new System.Drawing.Point(13185);
            
this.ButtonCancel.Name "ButtonCancel";
            
this.ButtonCancel.Size = new System.Drawing.Size(7523);
            
this.ButtonCancel.TabIndex 4;
            
this.ButtonCancel.Text "Cancel";
            
this.ButtonCancel.UseVisualStyleBackColor true;
            
// 
            // textBoxPos
            // 
            
this.errorProvider.SetIconPadding(this.textBoxPos3);
            
this.textBoxPos.InsertKeyMode System.Windows.Forms.InsertKeyMode.Overwrite;
            
this.textBoxPos.Location = new System.Drawing.Point(8522);
            
this.textBoxPos.Mask "00:00:00.000";
            
this.textBoxPos.Name "textBoxPos";
            
this.textBoxPos.PromptChar '0';
            
this.textBoxPos.ResetOnPrompt false;
            
this.textBoxPos.Size = new System.Drawing.Size(9720);
            
this.textBoxPos.TabIndex 0;
            
this.textBoxPos.TextAlign System.Windows.Forms.HorizontalAlignment.Center;
            
this.textBoxPos.TextMaskFormat System.Windows.Forms.MaskFormat.IncludePromptAndLiterals;
            
// 
            // label1
            // 
            
this.label1.AutoSize true;
            
this.label1.Location = new System.Drawing.Point(2525);
            
this.label1.Name "label1";
            
this.label1.Size = new System.Drawing.Size(5413);
            
this.label1.TabIndex 6;
            
this.label1.Text "Timecode";
            
// 
            // label2
            // 
            
this.label2.Location = new System.Drawing.Point(8545);
            
this.label2.Name "label2";
            
this.label2.Size = new System.Drawing.Size(9714);
            
this.label2.TabIndex 7;
            
this.label2.Text "( hh:mm:ss.msec )";
            
this.label2.TextAlign System.Drawing.ContentAlignment.MiddleCenter;
            
// 
            // errorProvider
            // 
            
this.errorProvider.ContainerControl this;
            
// 
            // GoToTimeForm
            // 
            
this.AcceptButton this.ButtonOK;
            
this.AutoScaleDimensions = new System.Drawing.SizeF(6F13F);
            
this.AutoScaleMode System.Windows.Forms.AutoScaleMode.Font;
            
this.CancelButton this.ButtonCancel;
            
this.ClientSize = new System.Drawing.Size(218120);
            
this.Controls.Add(this.label2);
            
this.Controls.Add(this.label1);
            
this.Controls.Add(this.textBoxPos);
            
this.Controls.Add(this.ButtonCancel);
            
this.Controls.Add(this.ButtonOK);
            
this.FormBorderStyle System.Windows.Forms.FormBorderStyle.FixedDialog;
            
this.MaximizeBox false;
            
this.MinimizeBox false;
            
this.Name "GoToTimeForm";
            
this.ShowInTaskbar false;
            
this.StartPosition System.Windows.Forms.FormStartPosition.CenterParent;
            
this.Text "Go To Time";
            ((
System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
            
this.ResumeLayout(false);
            
this.PerformLayout();

        }

        
#endregion

        
private System.Windows.Forms.Button ButtonOK;
        private 
System.Windows.Forms.Button ButtonCancel;
        private 
System.Windows.Forms.MaskedTextBox textBoxPos;
        private 
System.Windows.Forms.Label label1;
        private 
System.Windows.Forms.Label label2;
        private 
System.Windows.Forms.ErrorProvider errorProvider;
    }


Last edited by Zachs; 19th December 2014 at 07:49.
Zachs is offline   Reply With Quote
Old 19th December 2014, 07:40   #643  |  Link
kopija
Registered User
 
Join Date: May 2012
Posts: 50
Thanks for constant improvements.
Fluid motion feature sounds very tempting.
I might try out your little piece of software after lurking all these months.
BTW, whats the difference between Madshis Smooth Motion and your Fluid Motion?
kopija is offline   Reply With Quote
Old 19th December 2014, 07:41   #644  |  Link
Zachs
Suptitle, MediaPlayer.NET
 
Join Date: Nov 2001
Posts: 1,721
Very simple player extension example

PHP Code:
using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace 
Mpdn.PlayerExtensions.Example
{
    public class 
Test IPlayerExtension
    
{
        private 
IPlayerControl m_PlayerControl;

        public 
ExtensionDescriptor Descriptor
        
{
            
get
            
{
                return new 
ExtensionDescriptor
                
{
                    
Guid = new Guid("7C3BA1E2-EE7B-47D2-B174-6AE76D65ED04"),
                    
Name "Test",
                    
Description "Player Extension Test",
                    
Copyright "Copyright Test © 2014. All rights reserved."
                
};
            }
        }

        public 
void Initialize(IPlayerControl playerControl)
        {
            
m_PlayerControl playerControl;
            
m_PlayerControl.KeyDown += PlayerKeyDown;
        }

        public 
void Destroy()
        {
            
m_PlayerControl.KeyDown -= PlayerKeyDown;
        }

        public 
IList<VerbVerbs
        
{
            
get
            
{
                return new[]
                {
                    new 
Verb(Category.Helpstring.Empty, "Test""Ctrl+Shift+T""test test test 1"Test1Click),
                    new 
Verb(Category.Help"Test sub category""Test""Ctrl+Shift+R""test test test 2"Test2Click)
                };
            }
        }

        private 
void Test1Click()
        {
            
MessageBox.Show("Test1");
        }

        private 
void Test2Click()
        {
            
MessageBox.Show("Test2");
        }

        private 
void PlayerKeyDown(object senderPlayerKeyEventArgs e)
        {
            switch (
e.Key.KeyData)
            {
                case 
Keys.Control Keys.Shift Keys.T:
                    
Test1Click();
                    break;
                case 
Keys.Control Keys.Shift Keys.R:
                    
Test2Click();
                    break;
            }
        }
    }


Last edited by Zachs; 19th December 2014 at 07:47.
Zachs is offline   Reply With Quote
Old 19th December 2014, 07:46   #645  |  Link
Zachs
Suptitle, MediaPlayer.NET
 
Join Date: Nov 2001
Posts: 1,721
Quote:
Originally Posted by pirlouy View Post
Nice, the Fluid motion.

Some requests (some have already been asked I'm afraid).
1) How to be sure we're in exclusive mode ? Could it be displayed in statistics ?
2) Hotkeys/mouse personalization; for example:
I disable double-click, and use middle click to go Full Screen.
I use "mouse wheel up" to go back in time, and "wheel down" to jump forward
3) ability to prevent window resizing; a fixed size (video downscaled)
#1 and #3 are done in v2.15.0.
#2 can be done via Player Extensions.

Quote:
Originally Posted by kopija View Post
Thanks for constant improvements.
Fluid motion feature sounds very tempting.
I might try out your little piece of software after lurking all these months.
BTW, whats the difference between Madshis Smooth Motion and your Fluid Motion?
Fluid Motion does blend FRC, which I believe is what madvr does as well.

Quote:
Originally Posted by romulous View Post
A minor thing, but would it be possible to get a couple of preset window sizing options? These four in particular:
50%
100%
150%
200%
Done.

Enjoy!
Zachs is offline   Reply With Quote
Old 19th December 2014, 10:33   #646  |  Link
romulous
Registered User
 
Join Date: Oct 2012
Posts: 179
Quote:
Originally Posted by Zachs View Post
Done.
Thanks! Interestingly, the first video I opened I set to 50%, and I noticed some fairly obvious image corruption. Seems to be related to SuperRes though, as I had that enabled. Corruption goes away when I disable that (it only shows at 50%).
romulous is offline   Reply With Quote
Old 19th December 2014, 10:37   #647  |  Link
Shiandow
Registered User
 
Join Date: Dec 2013
Posts: 753
Quote:
Originally Posted by romulous View Post
Thanks! Interestingly, the first video I opened I set to 50%, and I noticed some fairly obvious image corruption. Seems to be related to SuperRes though, as I had that enabled. Corruption goes away when I disable that (it only shows at 50%).
SuperRes isn't even supposed to be active at that size. Could you try using ImageProcessor without any shaders and see if that has the same result?
Shiandow is offline   Reply With Quote
Old 19th December 2014, 11:06   #648  |  Link
romulous
Registered User
 
Join Date: Oct 2012
Posts: 179
Yes, appears to be the same corruption present when ImageProcessor with nothing in it is active.
romulous is offline   Reply With Quote
Old 19th December 2014, 11:52   #649  |  Link
Zachs
Suptitle, MediaPlayer.NET
 
Join Date: Nov 2001
Posts: 1,721
Quote:
Originally Posted by romulous View Post
Yes, appears to be the same corruption present when ImageProcessor with nothing in it is active.
I can't replicate the problem. Anyone else?
Zachs is offline   Reply With Quote
Old 19th December 2014, 12:09   #650  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,697
Quote:
Originally Posted by Zachs View Post
I can't replicate the problem. Anyone else?
Me neither.
ryrynz is offline   Reply With Quote
Old 19th December 2014, 12:18   #651  |  Link
romulous
Registered User
 
Join Date: Oct 2012
Posts: 179
With this video?
https://dl.dropboxusercontent.com/u/105555957/Test.mp4 (9.01 MB)

No changes to the default MPDN config (except to install the renderscripts and enable SuperRes or ImageProcessor), and then go straight to 50%. Hopefully you should see lots of little blocks appear all over the video as it plays. LAV Video is set to software mode, and I have a NVIDIA card (GTX 660Ti).
romulous is offline   Reply With Quote
Old 19th December 2014, 12:25   #652  |  Link
Zachs
Suptitle, MediaPlayer.NET
 
Join Date: Nov 2001
Posts: 1,721
Quote:
Originally Posted by romulous View Post
With this video?
https://dl.dropboxusercontent.com/u/105555957/Test.mp4 (9.01 MB)

No changes to the default MPDN config (except to install the renderscripts and enable SuperRes or ImageProcessor), and then go straight to 50%. Hopefully you should see lots of little blocks appear all over the video as it plays. LAV Video is set to software mode, and I have a NVIDIA card (GTX 660Ti).
Still no problem.

EDIT: Tested on both NVIDIA GTX560 and Intel HD3000.
Zachs is offline   Reply With Quote
Old 19th December 2014, 12:37   #653  |  Link
romulous
Registered User
 
Join Date: Oct 2012
Posts: 179
Hm, strange. I'm even using the most current versions of the renderscripts, so no idea why it is only on my system. This is what it looks like FWIW:
http://i.imgur.com/O5Kxo40.png
romulous is offline   Reply With Quote
Old 19th December 2014, 12:48   #654  |  Link
Zachs
Suptitle, MediaPlayer.NET
 
Join Date: Nov 2001
Posts: 1,721
Quote:
Originally Posted by romulous View Post
Hm, strange. I'm even using the most current versions of the renderscripts, so no idea why it is only on my system. This is what it looks like FWIW:
http://i.imgur.com/O5Kxo40.png
Using ImageProcessor without shader is exactly the same as using no renderscripts. Not sure why it would change its behaviour - especially since no one else seems to be able to replicate the problem. Does it work fine in any other sizes?
Zachs is offline   Reply With Quote
Old 19th December 2014, 12:51   #655  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,697
Quote:
Originally Posted by romulous View Post
Tested on my HD3000 and 750Ti. No problems. Try an install of the drivers ticking the clean install box.

Last edited by ryrynz; 19th December 2014 at 12:55.
ryrynz is offline   Reply With Quote
Old 19th December 2014, 12:58   #656  |  Link
Zachs
Suptitle, MediaPlayer.NET
 
Join Date: Nov 2001
Posts: 1,721
@ryrynz

How's 750ti's performance using SuperChromaRes + SuperRes 3 pass with NEDI like?
My ailing old HTPC 9600GT is definitely due for an upgrade! LOL!
Zachs is offline   Reply With Quote
Old 19th December 2014, 12:59   #657  |  Link
romulous
Registered User
 
Join Date: Oct 2012
Posts: 179
Quote:
Originally Posted by Zachs View Post
Does it work fine in any other sizes?
Yes, it only happens at 50% on this particular video (have not found another vide that has the problem as yet, though none of them have been that same small resolution to begin with either).

It is clearly size related - if I manually resize the MPDN window bigger, at some point, the corruption stops occurring.
romulous is offline   Reply With Quote
Old 19th December 2014, 12:59   #658  |  Link
Zachs
Suptitle, MediaPlayer.NET
 
Join Date: Nov 2001
Posts: 1,721
Player Extensions now available on github - https://github.com/zachsaw/PlayerExtensions

I'll make a playlist extension next.
Zachs is offline   Reply With Quote
Old 19th December 2014, 13:04   #659  |  Link
romulous
Registered User
 
Join Date: Oct 2012
Posts: 179
I tried to test another 320x240 video (same as test video) to see if it had the same problem - MPDN crashed:

TITLE: Mpdn.VideoPlayer Error
------------------------------

An unexpected error 'Mpdn.VideoPlayer.DsGraphException' has occurred.

------------------------------
ADDITIONAL INFORMATION:

Failed to render file 'K:\Videos\Video Game\F.E.A.R\E3 2004 Demo [t_fear_e3_2k4_demo].wmv' (Mpdn.VideoPlayer)

------------------------------

Exception from HRESULT: 0x80040217 (Mpdn.VideoPlayer)

------------------------------
BUTTONS:

&Ignore
&Abort
------------------------------

Not very specific, but that is all it gave me.
romulous is offline   Reply With Quote
Old 19th December 2014, 13:07   #660  |  Link
romulous
Registered User
 
Join Date: Oct 2012
Posts: 179
But I did find another 320x240 video that MPDN would play without crashing, and it too at 50% shows the corruption. Not that I would actually play a video that small at 50% (I would bump it up to 200%), but 50% was just the first combination I hit, so I stumbled across it by accident (it won't affect me, was just curious as to why it happened).
romulous is offline   Reply With Quote
Reply

Tags
direct3d, mpdn, nnedi3, opencl, reclock

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 18:28.


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