Pixilation of video during playback seek operation
Summary
Pixilation of video during playback seek operation
Minimal project and steps to reproduce
- Open video file for playback
- Fast forward the video playback via seek bar the Pixilation is seen in video playback. Note: The video playback works fine if seek is not used.
Code snippet
//Initialization code---
_libVLC = new LibVLC(new string[] { "--no-snapshot-preview", "--no-osd", "--avcodec-hw=d3d11va", "--no-video-title", "--no-audio" });
_mediaPlayer = new MediaPlayer(_libVLC);
_mediaPlayer.EnableHardwareDecoding = true;
_mediaPlayerRecord = new MediaPlayer(_libVLC);
_mediaPlayerRecord.EnableHardwareDecoding = true;
Capture snippet
//Capture code
private void StartVideoRecording()
{
string dshowfps = $":dshow-fps=30";
using (Media _recordMedia = new Media(_libVLC, "dshow://", FromType.FromLocation))
{
_recordMedia.AddOption($":dshow-vdev=Virtual Camera");
{
// diff
_recordMedia.AddOption(dshowfps);
}
List<string> options = Win32Utils.ParseStringOptions(":no-audio|:live-caching=300|:dshow-size=1280x1024|:dshow-aspect-ratio=5:4|:dshow-adev=none|:avcodec-hw=d3d11va", new char[] { '|' });
if (options == null || options.Count == 0)
{
sLogger.Log($"Record option: No Media Options added", Category.Warn);
}
else
{
foreach (string item in options)
{
_recordMedia.AddOption(item);
sLogger.Log($"Record option: {item} added", Category.Debug);
}
}
string destination = Path.Combine(AssemblyDirectory, "AttemptVideo_1.wmv");
string transcode = "#transcode{{vcodec=h264,vb=1500,fps=30,scale=0,acodec=none,ab=128,channels=2,threads=4,high-priority=true}}";
sLogger.Log($"Record option: {transcode} added", Category.Debug);
//string transcode = "#transcode{{vcodec=h264,vb=1500,fps=30,scale=0,acodec=none,ab=128,channels=2,threads=4,high-priority=true}}";
// Only recording mp4 using h264
_recordMedia.AddOption(":sout=" + transcode + ":std{access=file,dst=" + destination + "}");
if (!_mediaPlayerRecord.Play(_recordMedia))
{
MessageBox.Show("Error in Recording...");
}
_mediaPlayerRecord.Playing += _mediaPlayerRecord_Playing;
}
}
private void _mediaPlayerRecord_Playing(object sender, EventArgs e)
{
StartVideoPreview();
_mediaPlayerRecord.Playing -= _mediaPlayerRecord_Playing;
}
private bool StartVideoPreview()
{
bool bResult = false;
if (this._VideoParameters == null)
return bResult;
string dshowfps = $":dshow-fps=30";
// For Capture live feed from Camera device
using (Media _previewMedia = new Media(_libVLC, "dshow://", FromType.FromLocation))
{
_previewMedia.AddOption($":dshow-vdev=Virtual Camera");
{
// diff
_previewMedia.AddOption(dshowfps);
}
List<string> options = Win32Utils.ParseStringOptions(":no-audio|:live-caching=300|:dshow-size=1280x1024|:dshow-aspect-ratio=5:4|:dshow-adev=none|:avcodec-hw=d3d11va", new char[] { '|' });
if (options == null || options.Count == 0)
{
sLogger.Log($"Preview option: No Media Options added", Category.Warn);
}
else
{
foreach (string item in options)
{
_previewMedia.AddOption(item);
sLogger.Log($"Preview option: {item} added", Category.Debug);
}
}
if (!_mediaPlayer.Play(_previewMedia))
{
MessageBox.Show("Error in Previewing...");
}
}
bResult = true;
return bResult;
}
Playback snippet
//Playback code----
string inVideoOutputPath = Path.Combine(AssemblyDirectory, "AttemptVideo_1.wmv");
if (!_mediaPlayer.IsPlaying)
{
using (var media = new Media(_libVLC, new Uri(inVideoOutputPath)))
{
List<string> options = Win32Utils.ParseStringOptions(":file-caching=1|:avcodec-fast");
if (options == null || options.Count == 0)
{
sLogger.Log($"Playback option: No Media Options added", Category.Warn);
}
else
{
foreach (string item in options)
{
media.AddOption(item);
sLogger.Log($"Playback option: {item} added", Category.Debug);
}
}
if (!_mediaPlayer.Play(media))
{
MessageBox.Show("Error in Playing...");
}
}
}
What is the current bug behavior?
Fast forward the video playback via seek bar the Pixilation is seen in video playback.
What is the expected correct behavior?
Fast forward the video playback via seek bar the Pixilation should not happen in video playback.
Does it work on other plaforms? Does it work with the official VLC apps?
VLC player this is video playback distortion is observed.
Relevant logs and/or screenshots
[2021-09-20T14:59:18,418-04:00] [1] [DEBUG] [Framework.Application.Presentation.VLCWrapper] -- Playback option: :file-caching=1 added
[2021-09-20T14:59:18,418-04:00] [1] [DEBUG] [Framework.Application.Presentation.VLCWrapper] -- Playback option: :avcodec-fast added
[2021-09-20T14:59:18,433-04:00] [18] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] mp4:unknown box type cenc (incompletely loaded)
[2021-09-20T14:59:18,433-04:00] [36] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] mp4:elst box found
[2021-09-20T14:59:18,433-04:00] [43] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] mp4:STTS table of 246 entries
[2021-09-20T14:59:18,433-04:00] [18] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] mp4:CTTS table of 247 entries
[2021-09-20T14:59:18,489-04:00] [42] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] d3d11va:not enough decoding slices in the texture (6/24)
[2021-09-20T14:59:18,735-04:00] [44] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 107 ms)
[2021-09-20T14:59:18,735-04:00] [58] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 73 ms)
[2021-09-20T14:59:18,735-04:00] [30] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 40 ms)
[2021-09-20T14:59:18,936-04:00] [41] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 42 ms)
[2021-09-20T14:59:19,178-04:00] [46] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 50 ms)
[2021-09-20T14:59:19,178-04:00] [46] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 16 ms)
[2021-09-20T14:59:19,430-04:00] [26] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 36 ms)
[2021-09-20T14:59:19,465-04:00] [18] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] drawable:unsupported control query 3
[2021-09-20T14:59:19,677-04:00] [58] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 49 ms)
[2021-09-20T14:59:19,931-04:00] [17] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 37 ms)
[2021-09-20T14:59:20,178-04:00] [12] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 50 ms)
[2021-09-20T14:59:20,178-04:00] [36] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 16 ms)
[2021-09-20T14:59:20,429-04:00] [16] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 35 ms)
[2021-09-20T14:59:20,681-04:00] [44] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 54 ms)
[2021-09-20T14:59:20,681-04:00] [42] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 20 ms)
[2021-09-20T14:59:20,928-04:00] [30] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 34 ms)
[2021-09-20T14:59:21,180-04:00] [50] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 53 ms)
[2021-09-20T14:59:21,180-04:00] [50] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 19 ms)
[2021-09-20T14:59:21,426-04:00] [41] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 32 ms)
[2021-09-20T14:59:21,680-04:00] [36] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 53 ms)
[2021-09-20T14:59:21,680-04:00] [36] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 19 ms)
[2021-09-20T14:59:21,931-04:00] [26] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 37 ms)
[2021-09-20T14:59:22,179-04:00] [42] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 52 ms)
[2021-09-20T14:59:22,179-04:00] [42] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 18 ms)
[2021-09-20T14:59:22,431-04:00] [52] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 37 ms)
[2021-09-20T14:59:22,678-04:00] [31] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 51 ms)
[2021-09-20T14:59:22,678-04:00] [31] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 17 ms)
[2021-09-20T14:59:22,931-04:00] [12] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 36 ms)
[2021-09-20T14:59:23,180-04:00] [43] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 52 ms)
[2021-09-20T14:59:23,180-04:00] [44] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 18 ms)
[2021-09-20T14:59:23,431-04:00] [58] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 37 ms)
[2021-09-20T14:59:23,678-04:00] [52] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 51 ms)
[2021-09-20T14:59:23,678-04:00] [17] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 17 ms)
[2021-09-20T14:59:23,930-04:00] [31] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 36 ms)
[2021-09-20T14:59:24,177-04:00] [36] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 50 ms)
[2021-09-20T14:59:24,177-04:00] [36] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 16 ms)
[2021-09-20T14:59:24,430-04:00] [43] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 36 ms)
[2021-09-20T14:59:24,601-04:00] [36] [ERROR] [Framework.Application.Presentation.VLCWrapper] -- [Error] main:buffer deadlock prevented
[2021-09-20T14:59:24,818-04:00] [44] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 107 ms)
[2021-09-20T14:59:24,818-04:00] [44] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 73 ms)
[2021-09-20T14:59:24,818-04:00] [21] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 40 ms)
[2021-09-20T14:59:25,020-04:00] [46] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 42 ms)
[2021-09-20T14:59:25,262-04:00] [41] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 51 ms)
[2021-09-20T14:59:25,262-04:00] [26] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 17 ms)
[2021-09-20T14:59:25,512-04:00] [43] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 34 ms)
[2021-09-20T14:59:25,762-04:00] [44] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 50 ms)
[2021-09-20T14:59:25,762-04:00] [44] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 16 ms)
[2021-09-20T14:59:26,014-04:00] [21] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 36 ms)
[2021-09-20T14:59:26,262-04:00] [46] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 51 ms)
[2021-09-20T14:59:26,262-04:00] [40] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 17 ms)
[2021-09-20T14:59:26,519-04:00] [41] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 40 ms)
[2021-09-20T14:59:26,765-04:00] [12] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 54 ms)
[2021-09-20T14:59:26,765-04:00] [12] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 20 ms)
[2021-09-20T14:59:27,011-04:00] [42] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 32 ms)
[2021-09-20T14:59:27,263-04:00] [44] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 51 ms)
[2021-09-20T14:59:27,263-04:00] [50] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 17 ms)
[2021-09-20T14:59:27,520-04:00] [52] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 42 ms)
[2021-09-20T14:59:27,762-04:00] [46] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 51 ms)
[2021-09-20T14:59:27,762-04:00] [40] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 17 ms)
[2021-09-20T14:59:28,020-04:00] [41] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 41 ms)
[2021-09-20T14:59:28,262-04:00] [36] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 51 ms)
[2021-09-20T14:59:28,262-04:00] [36] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 17 ms)
[2021-09-20T14:59:28,519-04:00] [30] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 40 ms)
[2021-09-20T15:01:03,450-04:00] [49] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 53 ms)
[2021-09-20T15:01:03,450-04:00] [47] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 19 ms)
[2021-09-20T15:01:03,697-04:00] [8] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 33 ms)
[
[2021-09-20T15:01:03,952-04:00] [39] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 55 ms)
[2021-09-20T15:01:03,952-04:00] [56] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 21 ms)
[2021-09-20T15:01:04,199-04:00] [45] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 34 ms)
[2021-09-20T15:01:04,451-04:00] [55] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 54 ms)
[2021-09-20T15:01:04,451-04:00] [3] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 20 ms)
[2021-09-20T15:01:04,699-04:00] [33] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 35 ms)
[2021-09-20T15:01:04,946-04:00] [39] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 49 ms)
[2021-09-20T15:01:05,200-04:00] [51] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 36 ms)
[2021-09-20T15:01:05,450-04:00] [33] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 53 ms)
[2021-09-20T15:01:05,450-04:00] [56] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 19 ms)
[2021-09-20T15:01:05,701-04:00] [20] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 36 ms)
[2021-09-20T15:01:05,949-04:00] [55] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 52 ms)
[2021-09-20T15:01:05,949-04:00] [3] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 18 ms)
[2021-09-20T15:01:06,200-04:00] [48] [WARN ] [Framework.Application.Presentation.VLCWrapper] -- [Warning] main:picture is too late to be displayed (missing 36 ms)
[2021-09-20T15:01:06,581-04:00] [51] [ERROR] [Framework.Application.Presentation.VLCWrapper] -- [Error] direct3d11:SetThumbNailClip failed: 0x800706f4
Environment
- OS:
- Version
- Device:
- LibVLC version and architecture
- LibVLCSharp version AttemptVideo_721e3436-b052-495a-8321-227669da9167 OS: Windows 64 bit Version Win10, Device: Virtual Camera LibVLC version and architecture 3.0.11.0 LibVLCSharp version 3.4.9.0 LibVLCSharp.WPF 3.4.9.0