Compare commits

...

6 Commits

Author SHA1 Message Date
Ray
a5ac0121e1 Merge pull request 'Added readme' (#1) from release/0.1.3.010 into master
Reviewed-on: HiImRay_Public/video-preview#1
2026-07-07 16:24:58 +00:00
Ray
59c51bcce4 Added readme 2026-07-07 17:24:16 +01:00
Ray
dcaf9ac017 Merge branch 'release/0.1.3.010' into 'master'
Release/0.1.3.010

See merge request SympatheticFire/video-preview!7
2022-09-14 20:12:20 +00:00
Ray
d14f1f9ec0 Upgrade to .net-6 2022-09-09 13:42:45 +01:00
Ray
de0570da33 Fixed always-on-top updates session options 2022-09-09 13:13:34 +01:00
Ray
65cb00eb9f Merge branch 'release/0.1.2.041' into 'master'
Release/0.1.2.041

See merge request SympatheticFire/video-preview!6
2022-07-06 18:42:13 +00:00
36 changed files with 137 additions and 105 deletions

41
README.md Normal file
View File

@ -0,0 +1,41 @@
# Video Preview
> Preview a video file by rendering random frames.
---
## Features
- Read random frames from a video
## Screenshots
[![screenshot](wiki/screenshot-1-h240.png)](wiki/screenshot-1.png) [![screenshot](wiki/screenshot-2-h240.png)](wiki/screenshot-2.png)
---
## Background
Its quite common for me to build a tool for myself to do a specific task. These tools are usually pretty crude and never get shared. This tool is an exception, its still grossly crude but Im sharing it.
I was sorting through a large number of video files. I wasnt certain what each file contained and playing each video was frustratingly slow. I needed a tool that would read a video file and give me a few video frames. And this Video Preview was born.
---
## Releases & Builds
See [Releases](/HiImRay_Public/video-preview/releases)
## Acknowledgements
This software uses a number of dependencies and assets from third-parties.
These developers and artists deserve due credit for their work and for their commitment to sharing their work freely.
Each product is released under their own particular license, for more information please visit their websites.
- [Feather - Simply Beautiful Open Source Icons](https://feathericons.com/)
- [FFmpeg](https://www.ffmpeg.org/)
- [MediaToolkit](https://github.com/mtebenev/MediaToolkit.NetCore)
## License
None.

View File

@ -1,5 +0,0 @@
rmdir /s /q "bin\Release\64\"
dotnet publish skye.sln -r win-x64 -c Release /p:PublishSingleFile=true /p:SelfContained=false /p:PublishReadyToRunfalse=true /p:PublishDir="bin\Release\64\"
rmdir /s /q "bin\Release\86\"
dotnet publish skye.sln -r win-x86 -c Release /p:PublishSingleFile=true /p:SelfContained=false /p:PublishReadyToRunfalse=true /p:PublishDir="bin\Release\86\"

View File

View File

@ -73,8 +73,6 @@ namespace VideoPreview
this.label1.TabIndex = 3; this.label1.TabIndex = 3;
this.label1.Text = "File Name"; this.label1.Text = "File Name";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
this.label1.DragOver += new System.Windows.Forms.DragEventHandler(this.Form1_DragOver);
// //
// label2 // label2
// //
@ -85,8 +83,6 @@ namespace VideoPreview
this.label2.TabIndex = 5; this.label2.TabIndex = 5;
this.label2.Text = "-"; this.label2.Text = "-";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label2.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
this.label2.DragOver += new System.Windows.Forms.DragEventHandler(this.Form1_DragOver);
// //
// button1 // button1
// //
@ -120,8 +116,6 @@ namespace VideoPreview
this.tHorizontalSeparator1.Size = new System.Drawing.Size(454, 22); this.tHorizontalSeparator1.Size = new System.Drawing.Size(454, 22);
this.tHorizontalSeparator1.TabIndex = 9; this.tHorizontalSeparator1.TabIndex = 9;
this.tHorizontalSeparator1.TabStop = false; this.tHorizontalSeparator1.TabStop = false;
this.tHorizontalSeparator1.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
this.tHorizontalSeparator1.DragOver += new System.Windows.Forms.DragEventHandler(this.Form1_DragOver);
// //
// tHorizontalSeparator3 // tHorizontalSeparator3
// //
@ -152,8 +146,6 @@ namespace VideoPreview
this.flowLayoutPanel1.Size = new System.Drawing.Size(433, 540); this.flowLayoutPanel1.Size = new System.Drawing.Size(433, 540);
this.flowLayoutPanel1.TabIndex = 1; this.flowLayoutPanel1.TabIndex = 1;
this.flowLayoutPanel1.WrapContents = false; this.flowLayoutPanel1.WrapContents = false;
this.flowLayoutPanel1.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
this.flowLayoutPanel1.DragOver += new System.Windows.Forms.DragEventHandler(this.Form1_DragOver);
// //
// pictureBox1 // pictureBox1
// //
@ -200,7 +192,6 @@ namespace VideoPreview
this.button2.Size = new System.Drawing.Size(37, 37); this.button2.Size = new System.Drawing.Size(37, 37);
this.button2.TabIndex = 2; this.button2.TabIndex = 2;
this.toolTip1.SetToolTip(this.button2, "Options"); this.toolTip1.SetToolTip(this.button2, "Options");
this.button2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button2_MouseClick);
// //
// button3 // button3
// //
@ -217,7 +208,6 @@ namespace VideoPreview
this.button3.Size = new System.Drawing.Size(35, 37); this.button3.Size = new System.Drawing.Size(35, 37);
this.button3.TabIndex = 3; this.button3.TabIndex = 3;
this.toolTip1.SetToolTip(this.button3, "Refresh"); this.toolTip1.SetToolTip(this.button3, "Refresh");
this.button3.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button3_MouseClick);
// //
// button4 // button4
// //
@ -234,7 +224,6 @@ namespace VideoPreview
this.button4.Size = new System.Drawing.Size(37, 37); this.button4.Size = new System.Drawing.Size(37, 37);
this.button4.TabIndex = 4; this.button4.TabIndex = 4;
this.toolTip1.SetToolTip(this.button4, "Next"); this.toolTip1.SetToolTip(this.button4, "Next");
this.button4.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button4_MouseClick);
// //
// label4 // label4
// //
@ -420,8 +409,6 @@ namespace VideoPreview
this.MainMenuStrip = this.menuStrip1; this.MainMenuStrip = this.menuStrip1;
this.Name = "MainForm"; this.Name = "MainForm";
this.Text = "Video Preview"; this.Text = "Video Preview";
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
this.DragOver += new System.Windows.Forms.DragEventHandler(this.Form1_DragOver);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.menuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();

View File

@ -27,6 +27,10 @@ namespace VideoPreview
{ {
InitializeComponent(); InitializeComponent();
button3.Click += delegate { refreshToolStripMenuItem_Click(null, null); };
button4.Click += delegate { loadNextFileToolStripMenuItem_Click(null, null); };
button2.Click += delegate { optionsToolStripMenuItem_Click(null, null); };
button2.SetIcon("settings"); button2.SetIcon("settings");
button3.SetIcon("refresh-cw"); button3.SetIcon("refresh-cw");
button4.SetIcon("arrow-right-circle"); button4.SetIcon("arrow-right-circle");
@ -56,31 +60,17 @@ namespace VideoPreview
base.OnFormClosing(e); base.OnFormClosing(e);
} }
protected override void OnDragOver(DragEventArgs e)
public bool IsBusy
{ {
get => isBusy; base.OnDragOver(e);
set
{
isBusy = value;
ThreadControl.SetValue(pictureBox1, (isBusy ? UIcon.GetImage("loading_block") : null));
ThreadControl.SetEnable(textBox1, !isBusy);
ThreadControl.SetEnable(button1, !isBusy);
ThreadControl.SetEnable(button2, !isBusy);
ThreadControl.SetEnable(button3, !isBusy);
ThreadControl.SetEnable(button4, !isBusy);
}
}
private void Form1_DragOver(object sender, DragEventArgs e)
{
e.Effect = (e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None); e.Effect = (e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None);
} }
private async void Form1_DragDrop(object sender, DragEventArgs e) protected override async void OnDragDrop(DragEventArgs e)
{ {
base.OnDragDrop(e);
string[] fileList = e.Data.GetData(DataFormats.FileDrop) as string[]; string[] fileList = e.Data.GetData(DataFormats.FileDrop) as string[];
if (fileList == null) if (fileList == null)
{ {
@ -110,31 +100,101 @@ namespace VideoPreview
} }
public bool IsBusy
{
get => isBusy;
set
{
isBusy = value;
ThreadControl.SetValue(pictureBox1, (isBusy ? UIcon.GetImage("loading_block") : null));
ThreadControl.SetEnable(textBox1, !isBusy);
ThreadControl.SetEnable(button1, !isBusy);
ThreadControl.SetEnable(button2, !isBusy);
ThreadControl.SetEnable(button3, !isBusy);
ThreadControl.SetEnable(button4, !isBusy);
}
}
public AppSession CurrentSession { get; set; } = new AppSession(); public AppSession CurrentSession { get; set; } = new AppSession();
#region main menu
/// <summary> /// <summary>
/// Refresh /// Refresh
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
private void refreshToolStripMenuItem_Click(object sender, EventArgs e) => button3_MouseClick(null, null); private async void refreshToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.IsBusy)
{
return;
}
if (string.IsNullOrWhiteSpace(textBox1.Text))
{
return;
}
await ReadVideoFile(textBox1.Text);
}
/// <summary> /// <summary>
/// Load next file /// Load next file
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
private void loadNextFileToolStripMenuItem_Click(object sender, EventArgs e) => button4_MouseClick(null, null); private async void loadNextFileToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.IsBusy)
{
return;
}
if (string.IsNullOrWhiteSpace(textBox1.Text))
{
return;
}
await Task.Run(() =>
{
string path = AccessibleDirectory.GetNextFile(textBox1.Text, "*.avi;*.mkv;*.mp4;*.ogm;*.mov;*.mpg;*.mpeg");
if (string.IsNullOrWhiteSpace(path)) return;
textBox1.Text = path;
});
}
/// <summary> /// <summary>
/// Options /// Options
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
private void optionsToolStripMenuItem_Click(object sender, EventArgs e) => button2_MouseClick(null, null); private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.IsBusy)
{
return;
}
if (optionsForm == null) optionsForm = new OptionsForm(this.CurrentSession);
if (optionsForm.ShowDialog() == DialogResult.OK)
{
this.CurrentSession = optionsForm.Session;
this.TopMost = this.CurrentSession.AlwaysOnTop;
}
}
/// <summary>
/// Always-On-Top
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void toolStripMenuItem3_Click(object sender, EventArgs e)
{
this.TopMost = this.CurrentSession.AlwaysOnTop = !this.TopMost;
}
/// <summary> /// <summary>
/// View help /// View help
@ -167,61 +227,6 @@ namespace VideoPreview
MessageBox.Show(Application.ProductName + " v" + Application.ProductVersion, "About", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show(Application.ProductName + " v" + Application.ProductVersion, "About", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
#endregion
/// <summary>
/// Refresh
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void button3_MouseClick(object sender, MouseEventArgs e)
{
if (this.IsBusy) return;
if (string.IsNullOrWhiteSpace(textBox1.Text)) return;
await ReadVideoFile(textBox1.Text);
}
/// <summary>
/// Options
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button2_MouseClick(object sender, MouseEventArgs e)
{
if (this.IsBusy)
{
return;
}
if (optionsForm == null) optionsForm = new OptionsForm(this.CurrentSession);
if (optionsForm.ShowDialog() == DialogResult.OK)
{
this.CurrentSession = optionsForm.Session;
this.TopMost = this.CurrentSession.AlwaysOnTop;
}
}
/// <summary>
/// Next file
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void button4_MouseClick(object sender, MouseEventArgs e)
{
await Task.Run(() =>
{
if (this.IsBusy) return;
if (string.IsNullOrWhiteSpace(textBox1.Text)) return;
string path = AccessibleDirectory.GetNextFile(textBox1.Text, "*.avi;*.mkv;*.mp4;*.ogm;*.mov;*.mpg;*.mpeg");
if (string.IsNullOrWhiteSpace(path)) return;
textBox1.Text = path;
});
}
/// <summary> /// <summary>
/// Close /// Close
/// </summary> /// </summary>
@ -329,10 +334,13 @@ namespace VideoPreview
protected async Task ReadVideoFile(string filename) protected async Task ReadVideoFile(string filename)
{ {
if (this.IsBusy)
{
return;
}
await Task.Run(() => await Task.Run(() =>
{ {
if (this.IsBusy) return;
this.IsBusy = true; this.IsBusy = true;
Clear(); Clear();
@ -415,9 +423,5 @@ namespace VideoPreview
}); });
} }
private void toolStripMenuItem3_Click(object sender, EventArgs e)
{
this.TopMost = !this.TopMost;
}
} }
} }

View File

Before

Width:  |  Height:  |  Size: 666 B

After

Width:  |  Height:  |  Size: 666 B

View File

Before

Width:  |  Height:  |  Size: 428 B

After

Width:  |  Height:  |  Size: 428 B

View File

Before

Width:  |  Height:  |  Size: 642 B

After

Width:  |  Height:  |  Size: 642 B

View File

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 364 B

View File

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 293 B

View File

Before

Width:  |  Height:  |  Size: 354 B

After

Width:  |  Height:  |  Size: 354 B

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 623 B

After

Width:  |  Height:  |  Size: 623 B

View File

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 416 B

View File

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 589 B

View File

Before

Width:  |  Height:  |  Size: 751 B

After

Width:  |  Height:  |  Size: 751 B

View File

Before

Width:  |  Height:  |  Size: 500 B

After

Width:  |  Height:  |  Size: 500 B

View File

Before

Width:  |  Height:  |  Size: 694 B

After

Width:  |  Height:  |  Size: 694 B

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework> <TargetFramework>net6.0-windows8.0</TargetFramework>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<AssemblyName>videopreview</AssemblyName> <AssemblyName>videopreview</AssemblyName>
<Authors>Ray Lam</Authors> <Authors>Ray Lam</Authors>
@ -11,7 +11,7 @@
<Copyright>Ray Lam</Copyright> <Copyright>Ray Lam</Copyright>
<ApplicationIcon>favicon.ico</ApplicationIcon> <ApplicationIcon>favicon.ico</ApplicationIcon>
<NoWin32Manifest>true</NoWin32Manifest> <NoWin32Manifest>true</NoWin32Manifest>
<Version>0.1.2.041</Version> <Version>0.1.3.010</Version>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

5
source/build.bat Normal file
View File

@ -0,0 +1,5 @@
rmdir /s /q "bin\Release\64\"
dotnet publish skye.sln -r win-x64 -c Release /p:PublishSingleFile=true /p:SelfContained=false /p:PublishReadyToRunfalse=true /p:PublishDir="bin\Release\64\"
##rmdir /s /q "bin\Release\86\"
##dotnet publish skye.sln -r win-x86 -c Release /p:PublishSingleFile=true /p:SelfContained=false /p:PublishReadyToRunfalse=true /p:PublishDir="bin\Release\86\"

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

BIN
wiki/screenshot-1-h240.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
wiki/screenshot-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 KiB

BIN
wiki/screenshot-2-h240.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
wiki/screenshot-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB