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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th April 2015, 10:34   #2001  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,956
Quote:
Originally Posted by stax76 View Post
First thanks for your work and support.

I confirm the ffmsindex leak is fixed but there is another problem, the filter reports 'No video track found' trying to open avc mkv.
When you do what exactly?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 27th April 2015, 10:47   #2002  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: Germany
Posts: 5,619
Code:
------------------------------------------------------------
                        Environment
------------------------------------------------------------

StaxRip version : 1.3.0.3
OS              : Windows 7 Home Premium
Language        : German (Germany)
CPU             : Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz
GPU             : NVIDIA GeForce GTX 960
LAV Filters     : LAV Filters 0.65.0-2

------------------------------------------------------------
                   Source file MediaInfo
------------------------------------------------------------

C:\Daten\Temp\test\test.mkv

General
Unique ID                    : 179239962812818211157003190095008528769
Complete name                : C:\Daten\Temp\test\test.mkv
Format                       : Matroska
Format version               : Version 4 / Version 2
File size                    : 65.4 MiB
Duration                     : 2mn 5s
Overall bit rate             : 4 385 Kbps
Encoded date                 : UTC 2015-04-27 05:46:06
Writing application          : mkvmerge v7.8.0 ('River Man') 32bit built on Mar 27 2015 16:18:02
Writing library              : libebml v1.3.1 + libmatroska v1.4.2
DURATION                     : 00:02:05.185000000
NUMBER_OF_FRAMES             : 6260
NUMBER_OF_BYTES              : 1272797
_STATISTICS_WRITING_APP      : mkvmerge v7.8.0 ('River Man') 32bit built on Mar 27 2015 16:18:02
_STATISTICS_WRITING_DATE_UTC : 2015-04-27 05:46:06
_STATISTICS_TAGS             : BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Video
ID                           : 1
Format                       : AVC
Format/Info                  : Advanced Video Codec
Format profile               : High@L4
Format settings, CABAC       : Yes
Format settings, ReFrames    : 4 frames
Codec ID                     : V_MPEG4/ISO/AVC
Duration                     : 2mn 5s
Width                        : 1 920 pixels
Height                       : 1 080 pixels
Display aspect ratio         : 16:9
Frame rate mode              : Constant
Frame rate                   : 25.000 fps
Color space                  : YUV
Chroma subsampling           : 4:2:0
Bit depth                    : 8 bits
Scan type                    : Progressive
Writing library              : x264 core 146 r2538 121396c
Encoding settings            : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex /
	subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 /
	8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 /
	lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 /
	bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 /
	direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 /
	intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=0 /
	qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Default                      : Yes
Forced                       : No

Audio
ID                           : 2
Format                       : Opus
Codec ID                     : A_OPUS
Duration                     : 2mn 5s
Channel(s)                   : 2 channels
Channel positions            : Front: L R
Sampling rate                : 48.0 KHz
Compression mode             : Lossy
Default                      : Yes
Forced                       : No

------------------------------------------------------------
                    Index with ffmsindex
------------------------------------------------------------

"C:\Daten\Projekte\GitHub\staxrip\bin\Tools\Plugins\ffms2\ffmsindex.exe" "C:\Daten\Temp\test\test.mkv"
	"C:\Daten\Temp\test\test temp files\test.ffindex"

Writing index... done.

Start:    11:44:34
End:      11:44:34
Duration: 00:00:00


------------------------------------------------------------
                    Error opening source
------------------------------------------------------------

FFVideoSource: No video track found
(C:\Daten\Temp\test\test temp files\test_new_Source.avs, line 2)

FFVideoSource("C:\Daten\Temp\test\test.mkv", cachefile = "C:\Daten\Temp\test\test temp files\test.ffindex")
AssumeFPS(25.000000)
stax76 is offline   Reply With Quote
Old 27th April 2015, 11:56   #2003  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,956
Doh. Made a mistake in ffmsindex and avisynth ffindex that would make it unflag video tracks for indexing in many cases. Here's a fixed build:

test2
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 27th April 2015 at 11:59.
Myrsloik is offline   Reply With Quote
Old 27th April 2015, 12:31   #2004  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: Germany
Posts: 5,619
I tested 3-4 different source types, measured memory consumption, CPU usage and performance with AVSMeter against L-Smash, awesome work, perfect candidate to replace 2.20.
stax76 is offline   Reply With Quote
Old 2nd May 2015, 21:34   #2005  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,956
Here's test3.

The main noticable change is the framerate "correction". It should now more reliably pick common framerates if the input is close to one.

Previously it would "correct" framerates to 30001/1001, 25020/1001 or worse.

Test it and report your findings.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 2nd May 2015 at 21:36.
Myrsloik is offline   Reply With Quote
Old 2nd May 2015, 21:50   #2006  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,956
I want to remove the SWScale() function from avisynth since swscale is so horrible in general and doesn't really add anything compared to already existing resizers.

Objections?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 4th May 2015, 11:17   #2007  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: Germany
Posts: 5,619
Thanks for the new build. Two PAL samples were ffms2 don't use 25 or 50:

https://www.dropbox.com/s/v6urrdq6ih...%20fps.ts?dl=0

https://www.dropbox.com/s/j5bwk0u205...rphic.mpg?dl=0
stax76 is offline   Reply With Quote
Old 4th May 2015, 12:08   #2008  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,956
Quote:
Originally Posted by stax76 View Post
Thanks for the new build. Two PAL samples were ffms2 don't use 25 or 50:

https://www.dropbox.com/s/v6urrdq6ih...%20fps.ts?dl=0

https://www.dropbox.com/s/j5bwk0u205...rphic.mpg?dl=0
The 50fps one is exactly 50fps and not changed at all. So that one works for me. No idea what you're getting for that one.

The other one is too far off from 25fps. ~24.9495 fps to be exact. Actually 25000/1001 (24.9750) is quite far off too, seen as a percentage. The current code will only adjust the framerate if it's within 0.05%. This small interval is needed since the difference between 25 and 25000/1001fps is only 0.1% and would otherwise cause more trouble than it solves.

The reason it's done at all is mostly to recover a normal fps from matroska files.

AssumeFPS() is your friend.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 4th May 2015, 12:39   #2009  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: Germany
Posts: 5,619
My understanding of frame rates and field processing, especially NTSC is basic at best. 30000/1001 and 24000/1001 are obviously NTSC but were does 25000/1001 come from?

The 50 fps sample is reported as 25 fps by MediaInfo! I tried to deinterlace it and use AssumeFPS but couldn't find a way to properly process it, only thing that helped was using fpsnum, fpsden arguments for FFVideoSource.

What StaxRip and I believe MeGUI too do is read the frame rate with MediaInfo and then use AssumeFPS. With the Ski sample this didn't work so I switched to use fpsnum and fpsden arguments in the latest StaxRip release.
stax76 is offline   Reply With Quote
Old 4th May 2015, 12:51   #2010  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,405
Quote:
Originally Posted by stax76 View Post
The 50 fps sample is reported as 25 fps by MediaInfo! I tried to deinterlace it and use AssumeFPS but couldn't find a way to properly process it, only thing that helped was using fpsnum, fpsden arguments for FFVideoSource.
That can't be quite right. fpsnum/fpsden duplicates and/or deletes frames, it shouldn't help with deinterlacing.

The problem with the "SD - anamorphic.mpg" sample is probably initial delay. Delay makes an otherwise nice 25 fps cfr file into vfr with a peculiar average frame rate. Maybe delays should be handled differently? Does not really make sense to use them for the average fps calculation when we cannot map delays into AviSynth anyways (on account of being limited to cfr).

Last edited by sneaker_ger; 4th May 2015 at 12:56.
sneaker_ger is offline   Reply With Quote
Old 4th May 2015, 13:06   #2011  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: Germany
Posts: 5,619
The ski sample is 50i right? MediaInfo reporting it as 25 fps should be a bug then.
stax76 is offline   Reply With Quote
Old 4th May 2015, 13:15   #2012  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,405
It looks ok: frame rate 25, (implied) field rate 50
sneaker_ger is offline   Reply With Quote
Old 4th May 2015, 14:11   #2013  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: Germany
Posts: 5,619
When I query the frame rate from AviSynth I get 50 fps from ffms2, something is wrong here, I've never seen a sample like this. How would a full script handling this properly look like?
stax76 is offline   Reply With Quote
Old 4th May 2015, 14:26   #2014  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,405
Oh, you're right. ffms2 duplicates all frames for some reason. So fpsnum=25 (or similar like selecteven()/selectodd() or changefps()) might be valid after all
sneaker_ger is offline   Reply With Quote
Old 4th May 2015, 14:51   #2015  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,956
Quote:
Originally Posted by sneaker_ger View Post
Oh, you're right. ffms2 duplicates all frames for some reason. So fpsnum=25 (or similar like selecteven()/selectodd() or changefps()) might be valid after all
It's interlaced h.264. It's a known and annoying issue and even in FFmpeg it's handled differently (inexplicably doubled framerate and stuff).
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 4th May 2015, 15:02   #2016  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: Germany
Posts: 5,619
Quote:
Oh, you're right. ffms2 duplicates all frames for some reason. So fpsnum=25 (or similar like selecteven()/selectodd() or changefps()) might be valid after all
Ahh, now I understand what's wrong, maybe Myrsloik can fix it. I didn't know that fpsnum, fpsden mostly is about dropping frames so I'll go back to using AssumeFPS.
stax76 is offline   Reply With Quote
Old 4th May 2015, 15:05   #2017  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,956
Quote:
Originally Posted by stax76 View Post
Ahh, now I understand what's wrong, maybe Myrsloik can fix it. I didn't know that fpsnum, fpsden mostly is about dropping frames so I'll go back to using AssumeFPS.
Go annoy the FFmpeg developers until they begin to see common sense.

Not going to add a workaround unless money is involved. There may be some other TS issues lurking in that file too.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 4th May 2015, 15:08   #2018  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: Germany
Posts: 5,619
Quote:
Originally Posted by Myrsloik View Post
It's interlaced h.264. It's a known and annoying issue and even in FFmpeg it's handled differently (inexplicably doubled framerate and stuff).
l-smash-works fixes it, maybe workaround ffmpeg problem? Maybe ffmpeg could be fixed by reporting it?
stax76 is offline   Reply With Quote
Old 4th May 2015, 18:42   #2019  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,956
Quote:
Originally Posted by stax76 View Post
l-smash-works fixes it, maybe workaround ffmpeg problem? Maybe ffmpeg could be fixed by reporting it?
We (the union of disgruntled source filter writers of doom9) had a quick discussion about this. We all think FFmpeg sucks and that the behavior/API should be fixed in it.

Btw, interlaced fields is frame murder.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 4th May 2015, 19:04   #2020  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: Germany
Posts: 5,619
Thanks for investigating. I've done a small workaround, StaxRip includes 40 tools and plugins and since no software is perfect GUI authors constantly end up doing workarounds, I'm used to this. Most tools are pretty good, only mp4box sucks big time, I've every week a new problem with it, last week I discovered it's the only tool requiring VC++ 2010 runtime being present, not a big deal on it's own but after 20 more issues it starts to bother.

Last edited by stax76; 4th May 2015 at 19:47.
stax76 is offline   Reply With Quote
Reply

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 17:41.


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