Req Support for 3D Fuji Finepix 3DW3 video (AVI; 2 video streams)
#1
Now that we got beautiful working 3D video support and I own a 3D TV (Samsung UE40H6750) and a 3D camera (Fujifilm Finepix 3DW3), I wonder if it would be possible to add support for this camera's 3D video files. It would be so great to shoot your own 3D video footage and be able to directly display it on XBMC (Kodi) without converting for hours and hours …

Fujifilm, at least on their Finepix 3D W3 camera (maybe also on the 3D W1) store 720p24 video footage as AVI files, containg of stream #0 = left eye MJPEG video, stream #1 = audio, and stream #2 = right eye MJPEG video.

Here's what avconv has to say:
Code:
$ avconv -i DSCF0006.AVI
avconv version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
  built on Aug 10 2014 18:16:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, avi, from 'DSCF0006.AVI':
  Duration: 00:00:25.99, start: 0.000000, bitrate: 50187 kb/s
    Stream #0.0: Video: mjpeg, yuvj422p, 1280x720, 24 fps, 24 tbr, 24 tbn
    Metadata:
      title           : FUJIFILM AVI STREAM 0200
    Stream #0.1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Stream #0.2: Video: mjpeg, yuvj422p, 1280x720, 24 fps, 24 tbr, 24 tbn
    Metadata:
      title           : FUJIFILM AVI STREAM 0200

And here's the mediainfo on the same file:
Code:
General
Complete name                            : /home/matthias/Bilder/3D/DSCF0006.AVI
Format                                   : AVI
Format/Info                              : Audio Video Interleave
File size                                : 156 MiB
Duration                                 : 26s 0ms
Overall bit rate                         : 50.2 Mbps

Video #1
ID                                       : 0
Format                                   : JPEG
Codec ID                                 : MJPG
Duration                                 : 26s 0ms
Bit rate                                 : 24.6 Mbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Original height                          : 1 440 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 24.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Bit depth                                : 8 bits
Scan type                                : Interlaced
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 1.110
Stream size                              : 76.1 MiB (49%)
Title                                    : FUJIFILM AVI STREAM 0200

Video #2
ID                                       : 2
Format                                   : JPEG
Codec ID                                 : MJPG
Duration                                 : 26s 0ms
Bit rate                                 : 24.1 Mbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Original height                          : 1 440 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 24.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Bit depth                                : 8 bits
Scan type                                : Interlaced
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 1.088
Stream size                              : 74.6 MiB (48%)
Title                                    : FUJIFILM AVI STREAM 0200

Audio
ID                                       : 1
Format                                   : PCM
Format settings, Endianness              : Little
Format settings, Sign                    : Signed
Codec ID                                 : 1
Duration                                 : 26s 0ms
Bit rate mode                            : Constant
Bit rate                                 : 1 536 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Stream size                              : 4.76 MiB (3%)
Alignment                                : Aligned on interleaves
Interleave, duration                     : 1000 ms (24.00 video frames)
Interleave, preload duration             : 1000 ms

For all of us 3D junkies with a Fuji 3D camera, this would just be an awesome addition to XBMC!

It would be GREAT to have the same possibilities as with other video files, like native support and the display options we now have for other videos, like output them as top-and-bottom or side-by-side.

Since most other 3D video types already work fine with XBMC, I assume the basic code is already there and must »only« be somehow adapted to work for this unusual format, too.

Whatever help I could offer to make this work, let me know! (Except, unfortunately, I'd not be apt enough to code it myself :-()
Reply
#2
Don't think that we can handle two video streams in parallel atm. Would at least outrule HW decoding, but I'm no expert on this.
Reply
#3
I wonder. I'm using a preferred video stereo mode of top-and-bottom and XBMC (Gotham) seems able to flawlessly re-pack and play (H)SBS videos into (H)TAB for my TV. Of course I don't know what exactly happens in this little high-efficiency machine called XBMC it SEEMS it can do wonders already … So why not one wonder more? ;-)

Regarding data rates and stuff, if it can play (full) SBS/TAB video I think it shouldn't take much more CPU to handle two streams, or am I wrong? Of course that might not be feasible on a DE3815TYKHE, but hey! These little machines become more powerful everyday …

Then, of course, I'm also still hoping for 1980x2205 playback … and auto-stereo mode on the TV, but THAT will require a GPU that can handle it, I guess.
Reply
#4
Interesting, I have a Fuji 3d camera, I usually plugin via HDMI direct to the TV.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#5
I think the problem is decoding two streams at once.

I might see if I can figure out how to turn these into SBS or TAB.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#6
Well I figured out how to turn it into an HSBS file. A bit messy, and could take a while with a longer file than the six second clip I tried it on. I'll try and get it into some sort of shape and let you guys know, unless I am preaching to the converted.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#7
Thanks for your feedback, nickr. Converting is actually quite easy. I only wonder how to have XBMC do it internally.

You can convert a FUJI Finepix 3D W3 AVI video to (full) SBS using avconv like this (I prefer H.264 and MKV containers):
Code:
avconv -i input.avi -filter_complex "[0:v:0]setpts=PTS-STARTPTS, pad=iw*2:ih[left]; [0:v:1]setpts=PTS-STARTPTS[right]; [left][right]overlay=w" output.mkv

Or, if you prefer, to HSBS:
Code:
avconv -i input.avi -filter_complex "[0:v:0]setpts=PTS-STARTPTS, scale=iw/2:ih, pad=iw*2:ih[left]; [0:v:1]setpts=PTS-STARTPTS, scale=iw/2:ih[right]; [left][right]overlay=w" output.mkv

Both filter chains assume left eye first, i.e., the left eye video from the camera will be the left image in the generated (H)SBS file.

WARNING: These commands actually re-encode the footage, so some quality loss is unavoidable. This is just my »quick & dirty« way to watch the camera video on my XBMC at the moment (and save some space). Feel free to modify above commands to your heart's content (i.e., use another audio codec or whatever), and leave some feedback. :-)

There might be better methods, that's why I was asking. The stream could be demuxed and displayed directly, probably without any reencoding, which could save time and yield a better picture quality, the Fuji not being a camera with the world-best HD video in the first place …

N.B.: I used »avconv« here since it's installed on my Linux box, but you can as well use ffmpeg.
Reply
#8
For those of you interested, I have put up a 27-second sample on my webspace:
On my Samsung TV, the HSBS and HTAB versions play in 3D from a USB stick, the original version is shown as 2D video. XBMC (Gotham) plays the original version as 2D, the (H)SBS and (H)TAB versions as 3D. For the full-SBS and full-TAB versions, I had to set the output video pixel size to 1280x720 in MKVmerge's Header Editor before they played with correct aspect ratio.

The MKV versions were created by avconv commands like in the above post.
Reply
#9
HSBS or FullSBS are only ONE video stream that's being decoded by the GPU (in case GPU/driver can handle FullSBS) and GUI renderer is using the hardware decoded image and cutting it in half. In your case you would have to render/decode TWO video streams at once, which AFAIK is not possible with hardware acceleration. So at least one would have to be decoded in software (CPU). So if the devices have enough omph it shouldn't be an issue - the PI otoh won't be able to decode two FullHD streams. Also, our internal players are AFAIK not made to handle two video streams - I could be wrong on that one though.

edit: thanks for the samples. And yes, output/render resolution has to be set to the full resolution of a single eye in MKV headers
Reply
#10
Thanks for your feedback. I wish I knew more about the internal workings of things like that … Sounds a little like BluRay 3D stuff: One image could be rendered using the GPU, the MVC part (right eye difference) would have to be decoded using the CPU.

If hope that maybe a more general/versatile solution comes out of this—so maybe we could also one day play BluRay 3D MKV rips (H.264+MVC) … another thing that's not yet possible.

So in the long run, I feel there is a need to be able to decode two video streams at once. At least for everything that is 3D. Somehow … :-)
Reply
#11
MVC is different from what we need here - at least from my understanding. (doesn't make much sense to decode the main picture a second time only to calculate the second eye from it - so it has to happen on one place in the same demuxer - that at least would be logical)
Reply
#12
Hi
very interesting topic, I have Fujifilm camera but one problem that I have received is that the videso are not compatible to play and therefore I have to convert them to other format so that it can play on any poratble devices. I have searched a lot and after sometime got a good converter to convert my videos. Among you all may some or the other day want to convert any Fujifilm videos to play on portable devices then I would suggest you to use this converter. This is just amazing and now I am enjoying the videos on my portable device.
Just have a look: http://www.video-converters.org/cameraco...verter.php
Reply

Logout Mark Read Team Forum Stats Members Help
Support for 3D Fuji Finepix 3DW3 video (AVI; 2 video streams)1