Log in

View Full Version : Alternative to interleave filter


rica
1st January 2013, 16:37
Hi,

Even I can get very smooth stereoscopic videos with "StackHorizontal" or "StackVertical" options; I get shaky results with "Interleave" filter.
Here, I explain the issue detailed:

http://forum.doom9.org/showpost.php?p=1608129&postcount=368

http://forum.doom9.org/showpost.php?p=1608135&postcount=370

I think we need another filter for frame-sequential packaging.

Any feedback will be appreciated.

Thanks.

Didée
1st January 2013, 17:56
If you're experiencing issues, it must be somewhere else in your signal chain. It is plain impossible that interleave should be responsible for what you claim. Interleave does not alter the frames in any way, hence it cannot "shift the horizon line", or something.

rica
1st January 2013, 19:20
Thanks.
I hope you read my given posts and gave it a go before posting here?

wonkey_monkey
1st January 2013, 20:42
Even I can get very smooth stereoscopic videos with "StackHorizontal" or "StackVertical" options; I get shaky results with "Interleave" filter.

How do you define "smooth"?

The "rotation" you've highlighted with the red line is present simply because the two views are from different angles (necessary for 3D, of course). If you view side-by-side and cross your eyes or use some other 3D viewing technique, you won't notice because the brain is constructing a 3D view. When you interleave, it just becomes more obvious because you're viewing a 2D screen of interleaved images.

(please check how stackhorizontal script keep staying on the same horizontal line.

Compare screenshots from stackhorizontal/interleave and you'll see those frames are always exactly the same - it's the source.

David

Didée
1st January 2013, 21:22
I hope you read my given posts
In 3D world, there is no strict "horizon" along the vertical dimension. The horizon is only in the optical center. (And even that is theory. In practice, the optical deviations due to lens distortion etc. make things even more vague.) The red lines you drew in those pictures are near the bottom of the frame. It is not surprising that they are not aligned. Did you ever ecercise perspective drawing?

In any case:
The L/R frames are as they are. It does not matter if they get packed side-by-side, or if they get packed temporally, i.e. interleaved. The frames do not change by that, they stay what they are. As long as the presentation chain is correct, i.e. each L/R eye gets to see the intended L/R image, the result is the same.
If the result is not the same for you, then there must be an error in your signal/presentation chain, effectively swapping L and R - L eye sees the R image, and vice versa. That's the only explanation I could imagine.

rica
1st January 2013, 22:12
Thanks for your contributions David and Didee.

While different angles (right-view and left-view) are the nature of a 3D shot, rotation would never be expected.

In 3D shooting both identical cameras must sit on the same rig. Even shooter rotates the rig by mistake, left and right videos shift parallelly.

To be clearer, I opened left and right videos separately with VirtualDubMod and stayed at the same frame and get this screen-shot.

As you see, red-marked angles are parallel for both views.

http://img145.imageshack.us/img145/5118/newest.png (http://imageshack.us/photo/my-images/145/newest.png/)

_ _ _ _ _
_ _ _ _

Didée
1st January 2013, 23:11
Just to be sure, now I downloaded the both files.

What you show in your latest pic comparison, is exactly what I am getting with interleave(right,left). Well, what else should happen? Interleave() does not change anything with or about the pictures.

Repetition ad infinitum: It hast to be the same, it must be the same, it can't be anything other than the same, and IT IS THE SAME.

Last idea - maybe there's a slight chance that you're experiencing some sort of oddness with ffvideosource? I'm actually using DGDecodeNV.

BTW, the two pictures you posted in the other thread are not from the same timecode. The two perspectives actually are from two different (consecutive) 3D-Frames. ;)

Guest
1st January 2013, 23:29
repetition ad infinitum: It hast to be the same, it must be the same, it can't be anything other than the same, and it is the same. +1 :)

rica
1st January 2013, 23:45
Yes, it must be the same, but it is not.

BTW, the two pictures you posted in the other thread are not from the same time code. The two perspectives actually are from two different (consecutive) 3D-Frames.

OK, 380 is the left frame, and 381 is the right frame: (frame number 190 for both 2D frames.)

http://img688.imageshack.us/img688/7586/leftnew01.png (http://imageshack.us/photo/my-images/688/leftnew01.png/)

http://img405.imageshack.us/img405/8489/rightnew01.png (http://imageshack.us/photo/my-images/405/rightnew01.png/)




http:/imageshack.us/photo/my-images/688/leftnew01.png/

http://imageshack.us/photo/my-images/405/rightnew01.png/



If somebody does me a favor making a re-encoding of those videos to interleaved 3D (and upload), I will appreciate. Nowadays, I do not have DGNVTolls unfortunately.



_ _ _ _ _ _ _ __

wonkey_monkey
2nd January 2013, 00:16
While different angles (right-view and left-view) are the nature of a 3D shot, rotation would never be expected.

Sorry, but this isn't true! A 3D translation can indeed become a 2D rotation:

http://img26.imageshack.us/img26/7318/37216886.gif

OK, 380 is the left frame, and 381 is the right frame: (frame number 190 for both 2D frames.)

And if you look at frame 190 from your stackhorizontal version, you'll find the two halves are identical to these two images - complete with rotation, which rules out AviSynth.

David

rica
2nd January 2013, 00:35
And if you look at frame 190 from your stackhorizontal version, you'll find the two halves are identical to these two images

No, I don't think so:

http://img827.imageshack.us/img827/2036/finalls.png (http://imageshack.us/photo/my-images/827/finalls.png/)




(http://imageshack.us/photo/my-images/827/finalls.png/)



_ _ _ _ _

wonkey_monkey
2nd January 2013, 12:47
Comparing the left side of your stackhorizontal image to leftnew01.png (which is tricky because you've given us different sizes) shows that the red line you've drawn is a significantly different angle on each, despite them being the same frame - which just goes to show how subjective studying angles like this can be. You're extrapolating from a very small area of the picture. Try drawing a line between a corner of the green bin and a corner of the WOLF sign on the van, for example - you'll see these angles are the same. Or just ctrl-1 from VirtualDub to overlay the frames from interleave/stackhorizontal in an image editor and you'll see they're identical.

David

rica
2nd January 2013, 19:24
Hi David,

Why don't you upload a re-encoded video with "interleave" filter?
If everything is fine with your video, I will understand that it is my bad.
Thanks.

wonkey_monkey
2nd January 2013, 21:13
If everything is fine with your video, I will understand that it is my bad.

That's not really how science works! You need to show us what's wrong with your results - but I can't see anything wrong. Differences in orientation between two views are to be expected in this case (and it seems you've accidentally exaggerated this difference with your red lines).

Have you compared (via an image editor with a difference mode for example) frames 380 and 381 from the interleaved video and frame 190 from the stackhorizontal video? If there is a problem with AviSynth, it would be evident as an unexpected difference between the images.

David

rica
2nd January 2013, 22:32
David, I know it is not how science works, but I uploaded the interleave video for your inspection.

lv=FFVideoSource("C:\test\left.mkv")
rv=FFVideoSource("C:\test\right.mkv")
interleave(lv,rv)


C:\test>x264 --fps 25.00 --level 4.1 --sar 1:1 --frame-packing 5 -o interleave.mkv interleave.avs

http://www.mediafire.com/?hvo3dm2rgep775m

Thanks in advance!
_ _ _ _

sneaker_ger
2nd January 2013, 23:01
Just convert back and see for yourself that everything is ok:
il=ffvideosource("interleave.mkv")
lv=selecteven(il)
rv=selectodd(il)
stackhorizontal(lv,rv)

wonkey_monkey
2nd January 2013, 23:07
http://www.mediafire.com/?hvo3dm2rgep775m

I see exactly what I would expect to see from interleaving the two source videos. The jumping is caused solely by the videos being shot from different positions. You won't notice it when viewed in 3D because the brain is clever enough to align the two images it receives (unless they were much further out of alignment).

For what it's worth, the two cameras do seem to be very slightly misaligned.

Interleave is not misbehaving.

David

rica
2nd January 2013, 23:20
Sneaker, thanks. Is it possible to encode a new video instead of convert back? BTW, it is much better. However, if you have noticed it is slow motion. (original files are not.)

David, I gave it a go on 3D mode with PowerDVD 12 and Stereoscopic Player. I always got the same result.
BTW, even in this sample, as you noticed, two cameras do seem to be very slightly misaligned, the result is the same for the videos shot by very perfectly aligned cameras.

sneaker_ger
2nd January 2013, 23:36
Sneaker, thanks. Is it possible to encode a new video instead of convert back?

???

However, if you have noticed it is slow motion. (original files are not.)

That's because you used --fps 25 instead of --fps 50. You can fix the script with AssumeFPS().

I gave it a go on 3D mode with PowerDVD 12 and Stereoscopic Player. I always got the same result.

I don't know how these players work, but you have to be careful when putting out interleaved, because with each dropped frame (which do happen unless the chain is 100% synchronized) the views will switch. Better to let the player convert to side-by-side for the output on the fly, which is also how it is supposed to work for HDMI, I think.

rica
3rd January 2013, 00:20
Sneaker, I meant "could you re-encode (interleave) left and right videos I uploaded before, from the beginning?"

BTW, I use --fps 25 for the stack-horizontal and no slow-motion.

Guys, for comparison, I added this short video created with "stack-horizontal" filter. I suppose it will explain what I mean with "smooth."

C:\test>x264 --fps 25.00 --level 4.1 --sar 1:1 --frame-packing 3 -o SBS.mkv SH_01.avs

http://www.mediafire.com/?wm54eapbrewaa81


Thanks for testing. (2D or 3D; no shaking.)

wonkey_monkey
3rd January 2013, 00:41
Guys, for comparison, I added this short video created with "stack-horizontal" filter. I suppose it will explain what I mean with "smooth."

I don't think it does explain anything. Yes, it looks smooth - because it's two self-contained videos side by side :confused:

Apologies for the following large and annoying animated GIF, but this may be the easiest way to make sure everyone is on the same page:

http://img843.imageshack.us/img843/9042/flicker.gif

Rica, can you explain what, if anything, you find "wrong" with this image (and this image alone)? Is this the kind of "shakiness" you think is a problem?

David

rica
3rd January 2013, 00:42
So, the question is very clear: might there be any alternative of interleave filter, which is functional?

wonkey_monkey
3rd January 2013, 00:44
Interleave functions perfectly! I don't think any of us understand what the problem you are having is - my own suspicion is that you have misunderstood something, and there is in fact no problem to be solved.

David

rica
3rd January 2013, 00:45
Sorry David, I've missed you post.
Yes that is exactly what I have been trying to explain.

rica
3rd January 2013, 00:48
Interleave functions perfectly! I don't think any of us understand what the problem you are having is - my own suspicion is that you have misunderstood something, and there is in fact no problem to be solved.

David

Problem is still staying there. Can you tell me you can watch comfortably this garbage in 3D mode?

(And why don't you make an animation consisting of two frames taken from stack horizontal or original left and right frames? For instance frames 190 and 191? This will be a real animation of interleaving. If you make it and if we don't meet this belly dancing, I suppose you will understand me. - I mean 190-L+190-R +191-L +191-R.)

wonkey_monkey
3rd January 2013, 00:49
Then there is no problem. If encoded correctly, and viewed on a correctly set-up 3D display in interleave mode, your interleaved video will look exactly the same as your SBS video displayed on a 3D display in SBS mode.

This "shakiness" is an inherent factor of 3D video. I really don't know what you expect it to be like, other than this.

Problem is still staying there. Can you tell me you can watch comfortably this garbage in 3D mode?

But if encoded correctly and viewed correctly there will be no shakiness because each eye will only see alternate frames. If you think you're viewing this on a 3D display, and you see this shakiness, you are doing something wrong.

David

wonkey_monkey
3rd January 2013, 00:53
(And why don't you make an animation consisting two frames taken from stack horizontal or original left and right frames?)

My animated GIF is made from original left and right frames - frame 190 from each video, in fact.

Edited to add:

Are you trying to create what everyone else calls "interleaved 3D" but would in fact be better described as "interlaced 3D"?


left=ffmpegsource2("left.mkv")
right=ffmpegsource2("right.mkv")

interleave(left,right)
separatefields
selectevery(4,0,3)
weave


David

rica
3rd January 2013, 01:06
David, I see what I see on VirtualDubMod playing to interleave.
I can not make an animation since there is no SW in my home PC to compare. Sorry but it doesn't seem they are the twins taken from the original L and R.

wonkey_monkey
3rd January 2013, 01:10
Sorry but it doesn't seem they are the twins taken from the original L and R.

Sorry, but they are.

rica
3rd January 2013, 01:13
Are you trying to create what everyone else calls "interleaved 3D" but would in fact be better described as "interlaced 3D"?


What is that?

Mine is:

lv=bla bla
rv=bla bla
interleave (lv,rv)


But if encoded correctly and viewed correctly there will be no shakiness because each eye will only see alternate frames. If you think you're viewing this on a 3D display, and you see this shakiness, you are doing something wrong.

David


No, I don't think I am doing something wrong. I tried with avs and encoded video using SP in 3D mode. SP, set to frame-sequential (left image first) and nVidia selected as viewing method. I also gave it a go with PDVD 12. And please do not forget I can watch SBS very well with those programs in 3D mode.

wonkey_monkey
3rd January 2013, 09:36
I tried your interleave.mkv in Stereoscopic Player in anaglyph mode and it looked fine to me - although it did play back at half speed. Do you still get shakiness when you use anaglyph mode? Did you try encoding with --fps 50?

David

rica
4th January 2013, 00:06
Sneaker and David, thanks!

Finally I fixed the issue with encoding the video to 50 fps. I did not think interleave filter needs 2*fps while SBS and TB methods are OK with 1*fps.

Slow motion creates the shaking issue.

This looks great with SP in 3D mode while PDVD still shakes it since it does not have frame sequential option.

Thanks again.

C:\test>x264 --fps 50.00 --level 4.1 --sar 1:1 --frame-packing 5 -o final_03.mkvnewest_interleave_01.avs

And here is the resulting interleaved video:

http://www.mediafire.com/?u2bdcfn1fczdvpr

_ _ _ _ _