Log in

View Full Version : AviSynth usage with Theora and Dirac


yuri69
23rd February 2011, 12:18
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 :confused:

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 (http://www.compression.ru/video/quality_measure/vqmt_download_en.html)), 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!

J_Darnley
24th February 2011, 12:44
ffmpegsource, it should be able to decode theora and dirac (this one might require one of the extra libs for ffmpeg).

yuri69
24th February 2011, 13:00
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: FFmpegSource2("path/file.ogv")

//Could you, please, supply more details - I'm the very beginner.

J_Darnley
24th February 2011, 17:46
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.

yuri69
24th February 2011, 18:31
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?

TheFluff
24th February 2011, 19:49
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.

yuri69
24th February 2011, 20:02
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.

TheFluff
24th February 2011, 20:53
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.

yuri69
24th February 2011, 21:00
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.

TheRyuu
24th February 2011, 22:30
ffms2-mt-r451.7z (http://warpsharp.voodoo-powered.net/random/ffms2-mt-r451.7z)

Contains libschroedinger.
No idea if it works.

yuri69
24th February 2011, 22:56
ffms2-mt-r451.7z (http://warpsharp.voodoo-powered.net/random/ffms2-mt-r451.7z)

Contains libschroedinger.
No idea if it works.Thank you for the binary. However it seems it doesn't work.

TheRyuu
24th February 2011, 23:10
Thank you for the binary. However it seems it doesn't work.

Can you upload a sample of something which doesn't work?

yuri69
24th February 2011, 23:35
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
ffmpeg -t 30 -i foreman_cif.avi -acodec copy -vcodec libschroedinger -b 2000k out_dirac.mp4

yuri69
28th February 2011, 09:43
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.

ar
15th November 2011, 07:26
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):
$ 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):
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:
$ 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
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:
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:
$ 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:
$ 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:
$ 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
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
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:
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.