Log in

View Full Version : LAVFilters? cuts leading black frames


twazerty
14th March 2016, 22:25
I have the following problem:
Playing the Avisynth script trough MPC HC results in missing the leading black frames that are in front of the video. Result: audio/video out of sync.

Original trailer sample starts with 1 second of black video. Playing the avisynth file is missing the first second of black video. If I put the Avisynth script trough x264 to get a new h264 file: same results, missing first second.

Script:

DirectShowsource("F:\Trailers\Chain of Command.m2ts",fps=23.976,audio=false).ConvertToYV12().AssumeFPS(24000,1001).addborders(0,0,0,0)

Tried with Avisynth 2.58 and 2.60
Tried with LavFilters 0.65 and 0.68
Tried with X264.exe r2665, r2638 and r2334

F:\Temp>"J:\Tools\X264\32bit\x264.exe" --pass 1 --bitrate 17775 --weightp 0 --bframes 3 --nal-hrd vbr
--vbv-maxrate 18000 --vbv-bufsize 18000 --level 4.1 --keyint 24 --b-pyramid strict --slices 4 --aud
--bluray-compat --open-gop --stats "F:\Temp\Test decoder encoder.stats" --fps 24000/1001 --force-cfr
--sar 1:1 --direct auto --output NUL "F:\Temp\Test decoder encoder.avs"

F:\Temp>"J:\Tools\X264\32bit\x264.exe" --pass 2 --bitrate 17775 --weightp 0 --bframes 3 --nal-hrd vbr
--vbv-maxrate 18000 --vbv-bufsize 18000 --level 4.1 --keyint 24 --b-pyramid strict --slices 4 --aud
--bluray-compat --open-gop --stats "F:\Temp\Test decoder encoder.stats" --fps 24000/1001 --force-cfr
--sar 1:1 --me umh --direct auto --psy-rd 1.0:0.25 --output "F:\Temp\Test decoder encoder.264" "F:\Temp\Test decoder encoder.avs"

Running:
Windows 10 Home 64 bit
AMD R390 Graphics card with Crimson Drivers 15.12
Core i7 6700k
Testing with MPC HC 1.7.10 32 bit to play the avisynth files
Testing with different files like m2ts and mkv, all are giving the same problem.

I am trying to figure out what is the problem for days without any progress.

Any ideas what could be the source of my problems?

sneaker_ger
14th March 2016, 22:30
How did you determine there are black frames in the beginning? Upload a sample.

twazerty
14th March 2016, 22:38
I know the video starts with black. First I check with MediaInfo there are now audio/video delays. Then playing the file with MPC HC and see with my eyes there is black video. Also most movies start with black video.

I cut you a sample with the same problem:
tools.twanwintjes.nl/uploads/temp/Chain of Command_cut.m2ts

sneaker_ger
14th March 2016, 23:02
I used a graph of "LAV Splitter Source" -> "LAV Video" with DirectShowSource() and the black frames are not lost. You are probably not using LAV all the way. You can manually build a graph using e.g. GraphStudioNext or increase LAV's merits with an additional tool. Or you do what's mostly recommended and use a source filter with integrated decoders like l-smash source.

twazerty
14th March 2016, 23:17
If I play the avisynth file I see LAV Filters are kicking in in the windows tray. The original m2ts is playing fine with MPC HC with build in LAV Filters.

Current solution with avisynth file and DirectShowSource worked for years without any problem with ffdshow.

L-SMASH looks awesome, but first I am going to try GraphStudioNext.

sneaker_ger
14th March 2016, 23:19
If I play the avisynth file I see LAV Filters are kicking in in the windows tray.
LAV Splitter AND LAV Video?

twazerty
14th March 2016, 23:23
Yes both LAV Splitter and LAV Video.
Playing trough GraphStudioNext gives me the same result: no black frames, green video starts immediately.

Build the following:
<?xml version="1.0" encoding="utf-8"?>
<graph name="Unnamed Graph">
<filter name="LAV Splitter" clsid="{171252A0-8820-4AFE-9DF8-5C92B2D66B04}"/>
<filter name="LAV Video Decoder" clsid="{EE30215D-164F-4A92-A4EB-9D4C13390F9F}"/>
<filter name="Enhanced Video Renderer" clsid="{FA10746C-9B63-4B6C-BC49-FC300EA5F256}"/>
<filter name="File Source (Async.)" clsid="{E436EBB5-524F-11CE-9F53-0020AF0BA770}">
<ifilesourcefilter source="F:\Temp\Test decoder encoder - item 1\Test decoder encoder.avs"/>
</filter>
</graph>

sneaker_ger
14th March 2016, 23:28
You are not supposed to open the .avs file using lav, your .avs file is supposed to use LAV.

twazerty
14th March 2016, 23:30
You are right, lets try again. New to this powerfull tool.

twazerty
14th March 2016, 23:34
If I load up the m2ts in GraphStudioNext I see the 1 second of black video.


<?xml version="1.0" encoding="utf-8"?>
<graph name="Unnamed Graph">
<filter name="LAV Video Decoder" clsid="{EE30215D-164F-4A92-A4EB-9D4C13390F9F}"/>
<filter name="Enhanced Video Renderer" clsid="{FA10746C-9B63-4B6C-BC49-FC300EA5F256}"/>
<filter name="LAV Splitter Source" clsid="{B98D13E7-55DB-4385-A33D-09FD1BA26338}">
<ifilesourcefilter source="F:\Temp\Test decoder encoder - item 1\Chain of Command.m2ts"/>
</filter>
</graph>


What can we conclude?

sneaker_ger
14th March 2016, 23:36
What I said in #4. DirectShowsource() is not using LAV Splitter + LAV Video to open the m2ts. You have been mislead because your player opens the .avs file using LAV, but your avs file opens the m2ts using another decoder, probably the one from Microsoft.

twazerty
14th March 2016, 23:44
Didn't suspect I was being mislead. What tool do you recommend for changing the merit? Win7DSFilterTweaker looks outdated.

Current value for LAV Splitter source is '0x00800004' for LAV splitter and '0x00800003' for LAV video.

sneaker_ger
14th March 2016, 23:53
I think Codec Tweak Tool might be the most popular option to set the preferred codecs at the moment. Not sure, though. Never used any of these myself.

http://www.codecguide.com/download_other.htm#codectweaktool

twazerty
14th March 2016, 23:56
Looks like Codec-Tweak-Tool is fully up2date and working. I made the false assumption LAV Filters would give itself the highest priority so tools like CodecTweakTool are not required anymore.

When I was using ffdshow on windows 7/8.1 I also had to use Win7DSFilterTweaker to activate the decoders. This is the first time I see a decoder unwanted cut something from the video.
Started using LAV Filters only recently on my new Windows 10, I saw LAV pop up in the tray and made a false assumption LAV Filters where the preferred decoder/splitter.

Big thanx

Sharc
15th March 2016, 00:37
Same here on W10. I had to use the Codec Tweak tool as well in order to select the filters according to their merit or force LAV, otherwise the MS filters kicked in.
Not sure if I have to repeat the procedure with every Windows (or LAV) update ......