Log in

View Full Version : 3D Toolbox


Adam Stanislav
14th June 2010, 06:38
Hello, I just wanted to let you know that I created a collection of AviSynth functions for editing 3D videos. I actually started writing it as a plug-in, then realized AviSynth is so powerful I was able to do it all with its own scripting language.

It is called the Pantarheon 3D AviSynth Toolbox (http://www.pantarheon.org/AviSynth3DToolbox/), and is currently in version 1.1. I hope someone will find it useful.

Jenyok
14th June 2010, 17:49
I saw those functions, which you wrote, very interesting, but in this time, I think, it is not actual yet.

Adam Stanislav
14th June 2010, 18:51
Could you please explain what you mean by "actual"? Thanks.

Jenyok
15th June 2010, 16:04
I mean "Not actually"...
For more peoples, users and video editors are here with usual video to understand, but not to mention to 3D video...

foxyshadis
15th June 2010, 20:08
(Looks like Google translated Russian.) There actually is a small 3d viewing community here, and the functionality looks very feature-complete and easy to use. Thanks for posting it.

Adam Stanislav
19th June 2010, 21:46
You are quite welcome. :)

Adam Stanislav
20th June 2010, 05:41
I mean "Not actually"...
For more peoples, users and video editors are here with usual video to understand, but not to mention to 3D video...

I still do not understand how you can say it is not "actual." I am going to assume we have a linguistic barrier here. Here is how the Webster's dictionary of the English language defines the word "actual":

1 obsolete : active
2 a : existing in act and not merely potentially b : existing in fact or reality <actual and imagined conditions> c : not false or apparent <actual costs>
3 : existing or occurring at the time : current <caught in the actual commission of a crime>

Is it any of those definitions you were using? Because it really exists. It is not imaginary. And it exists now.

Blue_MiSfit
21st June 2010, 01:02
Handy dandy! This will probably save me a lot of time when I start working with more 3d content. The small amount I have done was tedious with lots of crops, resizes, and stackhorizontal / stackvertical calls.

Thanks for your contribution!!

Derek

colinhunt
21st June 2010, 15:16
Looks interesting and very useful. Thank you Adam!

Nick [D]vB
7th July 2011, 17:21
Hello, I just wanted to let you know that I created a collection of AviSynth functions for editing 3D videos. I actually started writing it as a plug-in, then realized AviSynth is so powerful I was able to do it all with its own scripting language.

It is called the Pantarheon 3D AviSynth Toolbox (http://www.pantarheon.org/AviSynth3DToolbox/), and is currently in version 1.1. I hope someone will find it useful.

@Adam - First I want to thank you for your exellent work on the AviSynth 3D Toolbox,

I have found it very useful indeed, as have many other members here.


I was wondering if you have heard about the new Sisvel 3D frame format:

http://img607.imageshack.us/img607/2628/football2.jpg


http://www.sisveltechnology.com/3D_tile_format.asp

http://3droundabout.com/2011/06/2873/the-3d-tile-format-for-3d-and-2d-viewing-via-a-single-broadcast-stream.html


It is currently being tested by several 3D channels in europe, I have uploaded a small sample for you here:

http://www.megaupload.com/?d=1GUIMP3O (plays well in VLC)


It would be great if you could help create an avisynth script to re-construct the frame into side-by-side or seperate L/R images.

I have had a quick play with avisynth myself but this is beyond me I'm affraid. :o


I have longer samples and half SBS versions of the same content so it would be interesting to compare the output results.

If this format takes-off I'm sure many people will be in search of a way to view recordings in this format.


I look forward to your reply.

:)

rica
7th July 2011, 22:08
Hi Nick, thanks for reporting this interesting technique.
But how do you watch this in 3D mode; via VLC ?

Have you reported this to Peter Wimmer too?

Nick [D]vB
7th July 2011, 22:32
I have not found any way to watch in 3D yet! But at VLC does display the full frame.

Many other decoders just display the whole 720p part and discard the rest, I think this is by design, to keep 2D compatibility.

I have emailed Peter about this, it should be pretty easy for him to add it as an output mode to the 3dtv.at renderer.

I think AVIsynth is the best option at the moment, if you are a member of dvinfo.net maybe you could ask Adam about this?

I have tried to join that forum but my account is not active for some reason.

thanks

rica
7th July 2011, 22:38
vB;1512198']I have not found any way to watch in 3D yet! But at VLC does display the full frame.

Many other decoders just display the whole 720p part and discard the rest, I think this is by design, to keep 2D compatibility.

I have emailed Peter about this, it should be pretty easy for him to add it as an output mode to the 3dtv.at renderer.

I think AVIsynth is the best option at the moment, if you are a member of dvinfo.net maybe you could ask Adam about this?

I have tried to join that forum but my account is not active for some reason.

thanks

Ok Nick, i've already asked to Adam. :)
And thanks for reporting to Peter.
Best!

Nick [D]vB
7th July 2011, 22:47
Great! Let me know what he has to say. :)

Maybe we could use "video-wall" software to re-build the frame, do you know of anything?

rica
7th July 2011, 22:50
I directly give the link of your post here on his original thread.
So i think he gonna give the response here. :)

rica
7th July 2011, 22:56
vB;1512201']Maybe we could use "video-wall" software to re-build the frame, do you know of anything?

No i don't have any idea.

Nick [D]vB
7th July 2011, 23:08
I found a few things but no way to keep it in sync, we better wait for a proper solution, I look forward to it!

thanks again

:)

rica
7th July 2011, 23:41
At least i'm able to see the whole parts of the right video via ffdshow video decoder:

http://img228.imageshack.us/img228/4003/51510827.th.png (http://imageshack.us/photo/my-images/228/51510827.png/)

_ _ _ _

Nick [D]vB
8th July 2011, 00:01
Yes ffdshow & VLC are the only things I have found that display the whole frame,

Cyberlink, Archsoft, Elecard, CoreAVC, DivXH264, and LAV CUVID all crop to 720p

Have I missed any? Maybe there is some way to over-ride this??

rica
8th July 2011, 00:03
Confirmed.
You've missed nothing.

rica
8th July 2011, 00:18
Unfortunately Adam says he is living some health issues, take care Adam, please:

No, I did not see it (I totally forgot I was even a member of that forum). Thanks for pointing it out.

And no, I have no plans on working on the script in the near future. My health was failing for quite a while. We are finally finding the right combination of medications to control my diabetes, so I am starting to feel “normal” again, but I am taking it easy.

Plus, I have started working on a completely different project, this one dealing with color grading, though I am not going to go into any details about it because with my health I do not want to make promises and not deliver them.

Quoted from dvinfonet forum.

k-c-ksum
8th July 2011, 00:20
Sisvel 3D is only ment to create 2 720p images for 3D out of a 1920x1080 image, nothing more

Nick [D]vB
8th July 2011, 00:56
Unfortunately Adam says he is living some health issues, take care Adam, please
I'm really sorry to hear about Adam's health problems, I hope he makes a fast recovery.


I noticed your post on the DVBviewer forum, sadly I don't think they are very interested in 3D support. 8(

I think ProgDVB is still the only application with live 3D support, but the new .Net versions are really buggy.

Someone started a patch for MediaPortal but I don't think it was finished, only anaglyph worked when I tested it.

AverTV have some 3D directshow filters with their software, maybe we could use them somehow??

rica
8th July 2011, 00:59
Sisvel 3D is only ment to create 2 720p images for 3D out of a 1920x1080 image, nothing more

I'd prefer 2*1280*720p instead of 2*960*1080i.

rica
8th July 2011, 01:04
Nick. Really i get bored of those conservative SW authors.
Why do i need to record first and watch 3D with SP later?

EDIT: Do you think anybody is interested in 3D stuff here?

vB;1512224'] I noticed your post on the DVBviewer forum, sadly I don't think they are very interested in 3D support. 8(

Nick [D]vB
8th July 2011, 03:15
I'd prefer 2*1280*720p instead of 2*960*1080i.
Very true! +If broadcasters can keep 2D compatibility then hopefully they will be more likely to show 3D programs on normal 2D channels!

Nick. Really i get bored of those conservative SW authors.
Until I can do better myself I can not really criticize others, but I know what you mean. ;)

Why do i need to record first and watch 3D with SP later?
I have tried steaming live TV into Stereoscopic player from DVBviewer and VLC, but it does not work very well, and also VLC doesn't support DVB-S2 yet. Another option is to use DSP-worx "DC-DVB Source" but it has not been updated for a long time, it does not support DVB-S2 either, and also has big problems with Windows7. But the source-code was published, I have it somewhere if anyone wants it. It would be great if Peter could add basic BDA driver support to Stereoscopic player, even with manual tuning, that way he can support almost any TV capture card.

http://www.dsp-worx.de/?n=11

EDIT: Do you think anybody is interested in 3D stuff here?
Not so much... :( But it's the same on many other technology forums, it seems to be fashionable to dislike 3D at the moment.

I understand why people are cynical about the movie studios, and yes 3D technology is not perfect yet,

but I can't understand all the hate out there towards 3D, last time I checked I still had two eyes, until that changes I'm sticking with it... :D

Nick [D]vB
8th July 2011, 19:08
I have uploaded some much longer samples:

Sisvel 3D: http://www.megaupload.com/?d=P0N9UZGZ

Same in 1/2-SBS: http://www.megaupload.com/?d=6BC1ZF96

I'm still playing with AVIsynth, any help would be appreciated...

:)

Shirtfull
8th July 2011, 21:19
Using Crop and Stack Hori/Vert functions in Avisynth

http://img205.imagevenue.com/loc257/th_155735704_Sisvel3DRightframe_122_257lo.jpg (http://img205.imagevenue.com/img.php?image=155735704_Sisvel3DRightframe_122_257lo.jpg)

Demux to elementary streams first

Left=Add H264 sourcefilter here.Crop(0, 0, -640, -368)

R1=Add H264 sourcefilter here.Crop(1280, 0, -0, -368)
R2=Add H264 sourcefilter here.Crop(0, 720, -1280, -8)
R3=Add H264 sourcefilter here.Crop(640, 720, -640, -8)
R2overR3=StackVertical(R2,R3)

Right=StackHorizontal(R1,R2overR3)

StackHorizontal(Left,Right)

Output SBS @ 2560x720

rica
9th July 2011, 02:30
Thanks, this should work but it is recognized as 1280*720 so it is not possible to crop: (the main frame is expected to be 1920*1080 and your cropping method is based on cropping a 1920*1080 for sure.)

R1=DirectShowSource("C:\video.mkv", fps=25.000, audio=false, convertfps=true)
Crop(1280,0,-0,-360)

R2=DirectShowSource("C:\video.mkv", fps=25.000, audio=false, convertfps=true)
Crop(0,720,-1280,-0)

R3=DirectShowSource("C:\video.mkv", fps=25.000, audio=false, convertfps=true)
Crop(640,720,-640,-0)

Right=StackHorizontal(R1,R2overR3)

EDIT: If i seperately try to crop R1, i get this popup:

http://img807.imageshack.us/img807/804/zerocrop.png (http://imageshack.us/photo/my-images/807/zerocrop.png/)

DirectShowSource("C:\test.ts", fps=25.000, audio=false, convertfps=true)
Crop(1280,0,-0,-360)



Maybe any other source filter works?
Or do you mean just h264 Source filter works in this case?

_ _ ___

Nick [D]vB
9th July 2011, 05:25
Thanks for your help with this Shirtfull! :)

It's a shame I missed your post last night.


Rica, have you checked the dvinfo.net thread today?! :D

http://www.dvinfo.net/forum/3d-stereoscopic-production-delivery/479703-producing-3d-files-avisynth-4.html


Tony Asch has cracked the input resolution problem by using FFmpegSource2 instead:



Tried to post this over at Doom9, but I'm still in my probationary period.

The sample Sisvel files provided over at Doom9 are actually 1906x1074. Thus the AVISynth code to build a side-by-side (left first) is:


sisvel = FFmpegSource2("07-07_15-06-23_3D Tile Format_-01_new.ts", width=1906, height=1074)
sisvel = BicubicResize(sisvel, 1920, 1080)
sisvelLeft = Crop(sisvel, 0, 0, -640, -360)
sisvelR1 = Crop(sisvel, 1280, 0, -0, -360)
sisvelR2 = Crop(sisvel, 0, 720, -1280, -0)
sisvelR3 = Crop(sisvel, 640, 720, -640, -0)
sisvelRight = StackHorizontal(sisvelR1, StackVertical(sisvelR2, sisvelR3))
StackHorizontal(sisvelLeft, sisvelRight)

The conversion is problematic because of the sample files. The left image seems to be wider than 1280 and the R1 image is narrower than 640. The overall resolution and the sizes of L, R1, R2, and R3 are not what is indicated in the Sisvel spec.

You'll notice I use FFmpegSource2 which reads .ts files. As per the Sisvel spec, the playback is cropped to 1280x720, but by adding the width= and height= parameters to FFmpegSource2, we can grab the entire video. I then resize to 1920 by 1080 to keep everything standardized.

The way I determined the L, R1, R2, and R3 resolutions was to play the original TS file using Media Player Classic at exactly 100%, doing a screen grab, and then bringing the screen grab into Photoshop to use the Ruler tool. (Yes, I have a 1920x1080 monitor on my computer.)

Seref - could you pass this on to the Doom9 thread?
__________________
VRtifacts



I still can't post over there and I don't think Tony can post here yet, but if you're listening - nice work buddy! :)


I'm using this version of FFmpegSource2: http://ffmpegsource.googlecode.com/files/ffms2-r473.7z

Maybe DGSource / H264Source and others might work if they allow resolution setting?


The other major problem was the actual resolution of my samples, they seem to be out of spec, which is very odd for a Sisvel test channel,

but that would explain why my maths hasn't been adding up! lol :confused: I never checked VLC but it does report 1906 x 1074!

I had checked the resolution using DVBviewer's "H264paramReader" and it reports 1920 x 1088:

Video-PID = 35
Parameter set position in PES packet = 123
Parameter set position in file = 114638
------------------------------------------------------------

profile_idc = 100 -----> high profile
constraint_set0_flag = 0
constraint_set1_flag = 0
constraint_set2_flag = 0
constraint_set3_flag = 0
level_idc = 40 -----> level 4.0

seq_parameter_set_id = 0

chroma_format_idc = 1
bit_depth_luma_minus8 = 0
bit_depth_chroma_minus8 = 0
lossless_qpprime_flag = 0
seq_scaling_matrix_present_flag = 0

log2_max_frame_num_minus4 = 0
pic_order_cnt_type = 0
log2_max_pic_order_cnt_lsb_minus4 = 2

num_ref_frames = 4
gaps_in_frame_num_value_allowed_flag = 0

pic_width_in_mbs_minus1 = 119 -----> HRes = 1920
pic_height_in_map_units_minus1 = 67 -----> VRes = 1088
frame_mbs_only_flag = 1 -----> progressive

direct_8x8_interference_flag = 1
frame_cropping_flag = 1
frame_crop_left_offset = 0
frame_crop_right_offset = -160
frame_crop_top_offset = 0
frame_crop_bottom_offset = -92

vui_parameters_present_flag = 1
aspect_ratio_info_present_flag = 0

overscan_info_present_flag = 0

video_signal_type_present_flag = 0

chroma_loc_info_present_flag = 0

timing_info_present_flag = 1
num_units_in_tick = 1
time_scale = 50
fixed_frame_rate_flag = 1 -----> frame rate 50 fps

nal_hrd_parameters_Present_flag = 1
vcl_hrd_parameters_Present_flag = 0
low_delay_hrd_flag = 0

pic_struct_present_flag = 0
bitstream_restriction_flag = 1
motion_vectors_over_pic_boundaries_flag = 1
max_bytes_per_pic_denom = 0
max_bits_per_mb_denom = 0
log2_max_mv_length_horizontal = 11
log2_max_mv_length_vertical = 11
num_reorder_frames = 2
max_dec_frame_buffering = 4

------------------------------------------------------------
Header bytes read = 44


For some reason I am still having alignment problems in the right frame:

http://img828.imageshack.us/img828/3310/almost2.png (http://imageshack.us/photo/my-images/828/almost2.png/)

http://img221.imageshack.us/img221/4393/almostw.png (http://imageshack.us/photo/my-images/221/almostw.png/)

I have tried tweaking a few numbers but no luck yet, but I never was any good at jig-saw puzzels... :o

Maybe we could loose the BicubicResize and just work with the actual input resolution?

I also need to work out how to get sound working through AVIsynth, I only just noticed that they are using AAC.

Anyway, thanks to everyone who helped out with this, it's great to finally be able to see this stuff in 3D! :cool: :D

_

Shirtfull
9th July 2011, 08:52
I've been using DGdecNV which works OK
Tried Directshow and even built graphs in graphedit but all attempts, decode the frame incorrectly, 1906x1074 or 1920x1080 but with a border

rica
9th July 2011, 20:48
Thanks guys.

rica
9th July 2011, 22:13
Shirtfull is right.

If you use DGNVTools and don't select cropping option :

http://img121.imageshack.us/img121/8739/dgfull.png (http://imageshack.us/photo/my-images/121/dgfull.png/)

You get the whole screen:

http://img228.imageshack.us/img228/8615/dgfull02.png (http://imageshack.us/photo/my-images/228/dgfull02.png/)

And if you use a smilar scrypt you will see DGTolls recognizes the video as 1920*1088 as expected. (DVB Broadcast standard.)

LoadPlugin("C:\DG\DGDecodeNV.dll")
DGSource("C:\test_full.dgi")
info()


http://img577.imageshack.us/img577/548/dguncropped.png (http://imageshack.us/photo/my-images/577/dguncropped.png/)

So in this case Shirtfull's scrypts are comletely true.

Nick [D]vB
9th July 2011, 23:21
Thanks rica, any tips on getting AVIsynth audio pass-through working?

I'm not sure about the syntax, I have tried: AudioDub(vidsound) + Vidsound = FFmpegSource2("file.ts")

thanks

rica
10th July 2011, 00:04
Nick, i will have a look tomorrow evening.
BTW this is the connected demuxed right videos over DGNVTools:

http://img94.imageshack.us/img94/3052/finalyh.png (http://imageshack.us/photo/my-images/94/finalyh.png/)

_ _ _ _

Nick [D]vB
10th July 2011, 00:15
thanks, speak to you later then.

rica
10th July 2011, 03:37
And here is the created 1280*720 right view via DGNVTools:

http://img38.imageshack.us/img38/4103/combiinedright.png (http://imageshack.us/photo/my-images/38/combiinedright.png/)

And here is the aviscrypt: (info() added to show the final resolution),

LoadPlugin("C:\DG\DGDecodeNV.dll")

V=DGSource("C:\test_full.dgi")

R1=Crop(V,1280,0,-0,-368)

R2=Crop(V,0,720,-1280,-8)

R3=Crop(V,640,720,-640,-8)

StackHorizontal(R1,StackVertical(R2,R3))

info()



_ __ _ _

rica
10th July 2011, 12:47
Hi Nick, you may use this:

DirectShowSource("C:\test.ts")

Nick [D]vB
10th July 2011, 19:32
Hi Nick, you may use this:

DirectShowSource("C:\test.ts")
For sound? Yes, this is what I am using:

Audio=DirectShowSource("file.ts",video=false)
Video=DGSource("file.dgi")
AudioDub(Video, Audio)

I can see that Haali + ffdshow audio decoder are loaded but I still get no sound, if I block ffdshow audio no other audio decoder is loaded. Can you see if ffdshow audio works for you? I think I have other problems with ffdshow audio on this system anyway.

It's a shame we can not get Directshowsource working for video, but I have not found a way for force the input resolution, same problem with Haali DSS2, the frame is always cropped to 720p even if I force ffdshow video decoder, which is really strange because ffdshow normaly displays the full frame in other programs.

I have also given up with FFmpegSource2, seeking does not work and I just can't get the cropping numbers to add up, something strange is happening with the resolution of each part, I even cut up screenshot in paint to try and work it out! lol :confused: But DGSource is working great so I am happy with that, but it would be nice to have another option if we can find one.

http://img6.imageshack.us/img6/8725/bingo2.png

Thanks again for you help with this.

:)

Gavino
10th July 2011, 19:47
vB;1512642']Audio=DirectShowSource("file.ts",video=false)
Video=DGSource("file.dgi")
AudioDub(Video, Audio)

I can see that Haali + ffdshow audio decoder are loaded but I still get no sound
Is that your complete script?
Do you then go on to crop and combine the various sections of 'Video' as shown earlier?
If so you need to replace the AudioDub line by
Video = AudioDub(Video, Audio)

rica
10th July 2011, 23:13
Nick i use ac3filter and haven't given it a go with ffdshow.

And i use that line for audio at the end of the scrypt:

DirectShowSource("C:\test.ts")

Nick [D]vB
11th July 2011, 02:54
Thanks, for me that just plays the original video at 720p, but I got it working with this:

AudioDub(DirectShowSource("test.ts",video=false))

:)

Nick [D]vB
14th July 2011, 17:05
The sView 3D video player now has Sisvel 3D support: http://www.sview.ru/ru/download/sViewLastAlpha

It can also open live TV from DVBViewer's unicast http network streaming plugin!


There is no open url menu yet so to open the stream just make a copy of the sView shortcut and add this to the target:

"C:\Program Files\sView 2011\sView.exe" --in=video - http://127.0.0.1:2345

Set the aspect ratio to 16:9 and the source format to Parallel Pair, and I would also enable de-interlacing.

I tried something similar using MainConcept demux filters in Stereoscopic Player but the video was really jerky.

sView works perfectly so a big thanks to Kirill for adding this feature, finally we can watch live 3D!

:)