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 Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd February 2011, 12:18   #1  |  Link
yuri69
noob
 
Join Date: Feb 2011
Posts: 15
AviSynth usage with Theora and Dirac

Hi,
I'm a completely noob in the video world, also I would like to apologize if I've posted this post in wrong section

I'd love to make a codec comparison (uncompressed/high bitrate compressed files with various codecs). First I chose the 'MSU Video Quality Measurement Tool' (url), which is kinda popular over here at this forums.

The problem I've discovered is that MSU tool works only with AviSynth (.avs AviSynth script files).

As you may know you can load a wide range of video files with the AviSynth (from MPEG-2 to MPEG-4 AVC or VC-1). However I was not able to load videos processed with some more 'exotic' codecs - for instance Theora or Dirac.

So I would like to ask if anybody knows an AviSynth plugin or some other way how could I load Theora or Dirac compressed files via the AviSynth.

In the case it's really impossible at the moment I would also love to know if there are some other possibilities how to do this typical (metrics: PSNR, SSIM, etc.) video comparison without utilizating the 'MSU Video Quality Measurement Tool'.

I would really appreciate any advice about a freeware/open source utility which I could use to compare the various video files with the typical metrics.

Thank you in advance! Any help would be really appreciated, my friends!
yuri69 is offline   Reply With Quote
Old 24th February 2011, 12:44   #2  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 959
ffmpegsource, it should be able to decode theora and dirac (this one might require one of the extra libs for ffmpeg).
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.
J_Darnley is offline   Reply With Quote
Old 24th February 2011, 13:00   #3  |  Link
yuri69
noob
 
Join Date: Feb 2011
Posts: 15
Quote:
Originally Posted by J_Darnley View Post
ffmpegsource, it should be able to decode theora and dirac (this one might require one of the extra libs for ffmpeg).
Thank you a lot.
Would you mind to show how to load the Dirac - which lib and how to implement the lib to be compatible with ffmpeg? I guess it's some schrodinger.lib but don't know the details

I've already successfully loaded a Theora video file in ogg container via:
Code:
FFmpegSource2("path/file.ogv")
//Could you, please, supply more details - I'm the very beginner.
yuri69 is offline   Reply With Quote
Old 24th February 2011, 17:46   #4  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 959
If your copy won't decode the dirac video then you would need to ask someone to compile the appropriate library, then ffmpeg with that library then ffms. Or just do that yourself.
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.
J_Darnley is offline   Reply With Quote
Old 24th February 2011, 18:31   #5  |  Link
yuri69
noob
 
Join Date: Feb 2011
Posts: 15
Quote:
Originally Posted by J_Darnley View Post
If your copy won't decode the dirac video then you would need to ask someone to compile the appropriate library, then ffmpeg with that library then ffms. Or just do that yourself.
Right Dirac ffms2 seems to require libschroedinger. It's very annoying to do this on Win32 - minGW. Do you know someone who would compile it for me?
yuri69 is offline   Reply With Quote
Old 24th February 2011, 19:49   #6  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,096
Quote:
Originally Posted by yuri69 View Post
Right Dirac ffms2 seems to require libschroedinger. It's very annoying to do this on Win32 - minGW. Do you know someone who would compile it for me?
I'll have a look. I didn't think anyone actually used Dirac for anything so I've never bothered compiling ffms2 with it.
TheFluff is offline   Reply With Quote
Old 24th February 2011, 20:02   #7  |  Link
yuri69
noob
 
Join Date: Feb 2011
Posts: 15
Quote:
Originally Posted by TheFluff View Post
I'll have a look. I didn't think anyone actually used Dirac for anything so I've never bothered compiling ffms2 with it.
Thank you!
I have spent over 2 hours to compile libschroedinger.dll but ffmpeg is even more complicated.
yuri69 is offline   Reply With Quote
Old 24th February 2011, 20:53   #8  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,096
Quote:
Originally Posted by yuri69 View Post
Thank you!
I have spent over 2 hours to compile libschroedinger.dll but ffmpeg is even more complicated.
ffmpeg is easy to compile. libschrödinger on the other hand is very annoying so I'm giving up. Ask someone else.
TheFluff is offline   Reply With Quote
Old 24th February 2011, 21:00   #9  |  Link
yuri69
noob
 
Join Date: Feb 2011
Posts: 15
Quote:
Originally Posted by TheFluff View Post
ffmpeg is easy to compile. libschrödinger on the other hand is very annoying so I'm giving up. Ask someone else.
Ok. Thanks anyway.
yuri69 is offline   Reply With Quote
Old 24th February 2011, 22:30   #10  |  Link
TheRyuu
warpsharpened
 
Join Date: Feb 2007
Posts: 788
ffms2-mt-r451.7z

Contains libschroedinger.
No idea if it works.
TheRyuu is offline   Reply With Quote
Old 24th February 2011, 22:56   #11  |  Link
yuri69
noob
 
Join Date: Feb 2011
Posts: 15
Quote:
Originally Posted by TheRyuu View Post
ffms2-mt-r451.7z

Contains libschroedinger.
No idea if it works.
Thank you for the binary. However it seems it doesn't work.
yuri69 is offline   Reply With Quote
Old 24th February 2011, 23:10   #12  |  Link
TheRyuu
warpsharpened
 
Join Date: Feb 2007
Posts: 788
Quote:
Originally Posted by yuri69 View Post
Thank you for the binary. However it seems it doesn't work.
Can you upload a sample of something which doesn't work?
TheRyuu is offline   Reply With Quote
Old 24th February 2011, 23:35   #13  |  Link
yuri69
noob
 
Join Date: Feb 2011
Posts: 15
Quote:
Originally Posted by TheRyuu View Post
Can you upload a sample of something which doesn't work?
Just a short classic video file: http://www.mediafire.com/?ubhd9r0sv136c1g

Encoded by: ffmpeg-r26400-swscale-r32676-mingw32-static
Code:
ffmpeg -t 30 -i foreman_cif.avi -acodec copy -vcodec libschroedinger -b 2000k out_dirac.mp4
yuri69 is offline   Reply With Quote
Old 28th February 2011, 09:43   #14  |  Link
yuri69
noob
 
Join Date: Feb 2011
Posts: 15
Has anybody tried to load the video file which I posted?

Also could anybody post some tutorial how to compile FFMS2 for Win32, please? The guide on the FFMS2 homepage is really vague and confusing for a newbie.
yuri69 is offline   Reply With Quote
Old 15th November 2011, 07:26   #15  |  Link
ar
Registered User
 
Join Date: Feb 2009
Posts: 16
Theora SSIM-test with Avisynth

Would you mind if i ask my question here?
So, how could i compare with Avisynth's SSIM-plugin clip encoded with Theora and original clip, despite all Theora's dropped frames?

Deails.
I tried to encode with ffmpeg2theora my clip (progressive PAL, 15000 frames):
Code:
$ wine avs2yuv ed-pal.avs - | \
       ffmpeg2theora -o ed-pal_theo_b10.ogv \
                     -v 10 --optimize --speedlevel 0 \
                     --aspect 16:9 -F 25 -S 0 -K 1250 \
                     -f yuv4mpegpipe --inputfps 25 -
and then i used ffms2-mt (version 2.13):
Code:
original = AVISource("original.avi", audio=false, pixel_type="YV12", fourCC="FFVH")
theo = FFVideoSource("ed-pal_theo_b10.ogv", track=1, cache=true, cachefile="ed-pal_theo_b10.ffindex", colorspace="YV12")

return SSIM(original,\
            theo,\
            "ed-pal_theo_b10.csv",\
            "ed-pal_theo_b10.ssim", lumimask=true)
ffms2-mt hangs up, so i have to kill it with fire.
First thing i tried was to remux video in matroska (V_THEORA) and tried again:
Code:
$ mkvmerge -o "ed-pal_theo_b10.mkv" --track-name 1:videostream --display-dimensions 1:1024x576 \
           -d 1 -A -S -T --no-global-tags --no-chapters ed-pal_theo_b10.ogv --track-order 0:1
Code:
original = AVISource("original.avi", audio=false, pixel_type="YV12", fourCC="FFVH")
theo = FFVideoSource("ed-pal_theo_b10.mkv", track=0, cache=true, cachefile="ed-pal_theo_b10.ffindex", colorspace="YV12")

return SSIM(original,\
            theo,\
            "ed-pal_theo_b10.csv",\
            "ed-pal_theo_b10.ssim", lumimask=true)
Avisynth's SSIM-plugin reported:
Code:
Avisynth error:
SSIM: These clips don't have same length
But mkvinfo reported duration was exactly 10 minutes.
Then i tried to encode with mencoder:
Code:
$ mencoder -noskip -ovc lavc -lavcopts vcodec=ffvhuff:context=1 
           -o ed-pal_theo_b10.avi \
           ed-pal_theo_b10.ogv
Mencoder reported that it encoded «584.560 secs 14614 frames».
Ok. Some frames lost. It's evident by playing ogv with mplayer.

I've just solved the problem with ffmpeg:
Code:
$ ffmpeg -i ed-pal_theo_b10.ogv -f rawvideo pipe:1 | \
  mencoder -noskip -ovc lavc -lavcopts vcodec=ffvhuff:context=1 \
           -demuxer rawvideo -rawvideo fps=25:pal:i420 \
           -o ed-pal_theo_b10.avi -
But ffmpeg lost one last frame (it's black, so it's insignificant), as usual for me. Also i tried to decode video through DirectShow and i can tell about it if someone interested.

Also, this example works to:
Code:
$ mkvmerge -o "ed-pal_theo_b10.mkv" --track-name 1:videostream --display-dimensions 1:1024x576 \
           -d 1 -A -S -T --no-global-tags --no-chapters ed-pal_theo_b10.ogv --track-order 0:1
and this code
Code:
FFVideoSource("ed-pal_theo_b10.mkv", track=0, cache=true, cachefile="ed-pal_theo_b10.ffindex", colorspace="YV12")
returns clip with one extra frame (total 15001 frames, first frame duplicated), but this code
Code:
FFVideoSource("ed-pal_theo_b10.mkv", track=0, cache=true, cachefile="ed-pal_theo_b10.ffindex", colorspace="YV12").Trim(1, 15000)
leads to Avisynth's crashes with stack overflow. So i wrote this code:
Code:
original = AVISource("original.avi", audio=false, pixel_type="YV12", fourCC="FFVH")
theo = FFVideoSource("ed-pal_theo_b10.mkv", track=0, cache=true, cachefile="ed-pal_theo_b10.ffindex", colorspace="YV12")

return SSIM(original.Trim(0,-1)++original,\
            theo,\
            "ed-pal_theo_b10.csv",\
            "ed-pal_theo_b10.ssim", lumimask=1)
It works for me.

Last edited by ar; 15th November 2011 at 20:22. Reason: problem solved
ar is offline   Reply With Quote
Reply

Tags
avisynth theora dirac cmp

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 06:04.


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