Coder Social home page Coder Social logo

ultramango / gear360pano Goto Github PK

View Code? Open in Web Editor NEW
224.0 25.0 55.0 748 KB

Simple script to create equirectangular panorama by stitching images from Samsung Gear 360

License: MIT License

Batchfile 3.21% HTML 0.17% JavaScript 86.66% CSS 5.59% Shell 4.37%
panorama hugin video video-stitching ffmpeg linux windows stitching image-stitching

gear360pano's People

Contributors

habi avatar neuhaus avatar ultramango avatar xiota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gear360pano's Issues

aspect ratio 2:1

I read in the facebook doc (for 360 photo upload) that the file must have 2:1 aspect ratio

i test the script and the original file are 7776x3888 but the stitched are 7776x2246

This issue sems to cause to facebook do not detect as panorama photo

Video Stitching is not working for Gear360(R210) 2017 model video

Image Stitching is working fine. During executing command for video Stitching, it is failing:
Here is the command output :

~/StitchingPoC/gear360pano$ ./gear360pano.cmd 360_7690.MP4File not found: 360_7690.MP4
Processing panofile: 360_7690.MP4
Processing input images (nona)
nona: using graphics card: NVIDIA Corporation GeForce GTX 1050 Ti/PCIe/SSE2
caught exception:
Precondition violation!
Unable to open file '360_7690.MP4'.
(/build/libvigraimpex-dp3J2t/libvigraimpex-1.10.0+dfsg/src/impex/codecmanager.cxx:203)

Error while running nona

Please help.

Crash after 10 minutes

hi,

photo stitching works brilliantly!

video stitching seems to work first, it creates tons of images, but finally after 10 minutes for a 6 seconds clip it crashes with this output:

.....
Stitching input images (enblend)
enblend: info: loading next image: ./tmp.DYg4ZYsa3Q/out0000.tif 1/1
enblend: info: loading next image: ./tmp.DYg4ZYsa3Q/out0001.tif 1/1
enblend: info: writing final output
Bogus input colorspace
Panorama written to ./tmp.iKrSsLZtwY/image00056.jpg, took: 20 s
Frame: ./tmp.9d4ESk3sGA/image00057.jpg
Processing input images (nona)
ContractViolation:
Precondition violation!
Unable to open file '/home/ubuntu/Projekte/Reise/Asia3D/gear360pano-master/converter/dummy.jpg'.

ContractViolation:
Precondition violation!
Unable to open file '/home/ubuntu/Projekte/Reise/Asia3D/gear360pano-master/converter/dummy.jpg'.

Stitching input images (enblend)
enblend: info: loading next image: ./tmp.Os5CJy2DS4/out0000.tif 1/1
enblend: info: loading next image: ./tmp.Os5CJy2DS4/out0001.tif 1/1
enblend: info: writing final output
Bogus input colorspace
Panorama written to ./tmp.iKrSsLZtwY/image00057.jpg, took: 21 s
Frame: ./tmp.9d4ESk3sGA/image00058.jpg
Processing input images (nona)
ContractViolation:
Precondition violation!
Unable to open file '/home/ubuntu/Projekte/Reise/Asia3D/gear360pano-master/converter/dummy.jpg'.

ContractViolation:
Precondition violation!
Unable to open file '/home/ubuntu/Projekte/Reise/Asia3D/gear360pano-master/converter/dummy.jpg'.

Stitching input images (enblend)
enblend: info: loading next image: ./tmp.sgLjoSfqp0/out0000.tif 1/1
enblend: info: loading next image: ./tmp.sgLjoSfqp0/out0001.tif 1/1
enblend: info: writing final output
Bogus input colorspace
Panorama written to ./tmp.iKrSsLZtwY/image00058.jpg, took: 20 s
Frame: ./tmp.9d4ESk3sGA/image00059.jpg
Processing input images (nona)
ContractViolation:
Precondition violation!
Unable to open file '/home/ubuntu/Projekte/Reise/Asia3D/gear360pano-master/converter/dummy.jpg'.

ContractViolation:
Precondition violation!
Unable to open file '/home/ubuntu/Projekte/Reise/Asia3D/gear360pano-master/converter/dummy.jpg'.

Stitching input images (enblend)
enblend: info: loading next image: ./tmp.91KxgrRl6Q/out0000.tif 1/1
enblend: info: loading next image: ./tmp.91KxgrRl6Q/out0001.tif 1/1
enblend: info: writing final output
Bogus input colorspace
Panorama written to ./tmp.iKrSsLZtwY/image00059.jpg, took: 20 s
Recoding the video...
ffmpeg version N-81995-gd790e48 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab --enable-libwavpack --enable-nvenc
libavutil 55. 32.100 / 55. 32.100
libavcodec 57. 61.103 / 57. 61.103
libavformat 57. 52.100 / 57. 52.100
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 64.100 / 6. 64.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 2.100 / 2. 2.100
libpostproc 54. 0.100 / 54. 0.100
[image2 @ 0x3118fe0] Could find no file with path '"./tmp.iKrSsLZtwY/image%05d.jpg"' and index in the range 0-4
"./tmp.iKrSsLZtwY/image%05d.jpg": No such file or directory

Error while running ffmpeg
Removing temporary directories...

processed video has longer duration and audio get out of sync

Camera: 2016 model

I have noticed that when using gear360video.cmd without the --speed switch (ie using the slower, higher quality preset), the final video is slightly stretched, but the audio has correct length. So if I process a 46mn 47s long video, the final processed video is 56mn 5s long and audio goes out of sync.

Original video

General
Complete name                            : party.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 7.25 GiB
Duration                                 : 46mn 47s
Overall bit rate                         : 22.2 Mbps
Writing application                      : Lavf56.4.101

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency 
Format profile                           : [email protected]
Codec ID                                 : hev1
Codec ID/Info                            : High Efficiency 
Duration                                 : 46mn 47s
Bit rate                                 : 22.0 Mbps
Width                                    : 2 560 pixels
Height                                   : 1 280 pixels
Display aspect ratio                     : 2.000
Frame rate mode                          : Constant
Frame rate                               : 29.970 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 0.224
Stream size                              : 7.18 GiB (99%)

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio C
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 46mn 47s
Bit rate mode                            : Constant
Bit rate                                 : 192 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 64.1 MiB (1%)

Processed video:

General
Complete name                            : party_pano.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 3.41 GiB
Duration                                 : 56mn 5s
Overall bit rate                         : 8 708 Kbps
Writing application                      : Lavf57.56.101

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : [email protected]
Codec ID                                 : hev1
Codec ID/Info                            : High Efficiency Video Coding
Duration                                 : 56mn 5s
Bit rate                                 : 8 593 Kbps
Width                                    : 2 560 pixels
Height                                   : 1 280 pixels
Display aspect ratio                     : 2.000
Frame rate mode                          : Constant
Frame rate                               : 29.970 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.087
Stream size                              : 3.37 GiB (99%)

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 46mn 47s
Bit rate mode                            : Constant
Bit rate                                 : 129 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 43.1 MiB (1%)

With the fast preset (--speed), the video is processed correctly.

Any ideas why?

On Ubuntu 16.04 "xargs: run_command: No such file or directory"

Hi,

I'm running the video script on Ubuntu LTS 16.04 with bash, using the "master.zip" as of yesterday.
Something is wrong with "xargs" and possibly "ffmpeg":

$ ./gear360video.cmd -s -t ./tmp/ 360.mp4
DEBUG: Output filename: ./html/data/360_pano.mp4
DEBUG: Running command:  notify-send -a ./gear360video.cmd Starting panoramic video stitching..
Extracting frames from video (this might take a while)...
DEBUG: Running command:  ffmpeg -y -i 360.mp4 tmp/tmp.PihX3Qdgm7/image%05d.jpg
ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
[...cut...]
DEBUG: Input video size: 2560:1280
DEBUG: PTO template: gear360video2k.pto
Stitching frames...
xargs: run_command: No such file or directory
Recoding the video...
DEBUG: Stream: 0 FPS: 30000/1001
DEBUG: Input video FPS: 30000/1001
DEBUG: Running command:  ffmpeg -y -f image2 -i tmp/tmp.0MpP9oRFLX/image%05d_pano.jpg -r 30000/1001 -s 2560:1280 -vcodec libx264 tmp/tmp.0MpP9oRFLX/tmpvideo.mp4
ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
[...cut...]
[image2 @ 0xca6940] Could find no file with path 'tmp/tmp.0MpP9oRFLX/image%05d_pano.jpg' and index in the range 0-4
tmp/tmp.0MpP9oRFLX/image%05d_pano.jpg: No such file or directory
Error while running ffmpeg
DEBUG: Running command:  notify-send -a ./gear360video.cmd Error while running ffmpeg
Removing temporary directories...
DEBUG: Removing frames directory: tmp/tmp.PihX3Qdgm7
DEBUG: Removing output directory: tmp/tmp.0MpP9oRFLX

The xargs line in the script is this:

if [ -z "${USEPARALLEL+x}" ]; then
  # No parallel
  find $FRAMESTEMPDIR -type f -name '*.jpg' | xargs -Ipanofile run_command "$DIR/gear360pano.cmd" -r -m -o "$OUTTEMPDIR" "panofile" "$PTOTMPL"
else

The ffmpeg error occurs in this line:

run_command ffmpeg -y -f image2 -i "$OUTTEMPDIR/$IMAGETMPLENC" -r "${SRCFPSSTR}" -s "${SRCVIDEOSIZE}" $FFMPEGQUALITYENC "$OUTTEMPDIR/$TMPVIDEO"`

Any ideas how this can be fixed?

RL.

Script is not working with Ubuntu 16.04

Hugin and imagemagick installed.
I dropped a jpg from the Gear VR in the gear360pano folder and launched the script :

./gear360pano.sh 360_0001.JPG ./gear360pano.sh: 19: ./gear360pano.sh: function: not found ./gear360pano.sh: 23: ./gear360pano.sh: Syntax error: "}" unexpected

Let me know if I can provide additional informations

btw, thanks a lot for your script!

How to create an initial template using Hugin

I am creating own template using Hugin, because generated picture was misaligned when using the template uploaded on Github.
I created it by watching the tutorial video uploaded to Youtube, but I do not know how to create control points.

There was no change when creating control points and not creating.

resized

I read the note written in the description section of Youtube.
Is the version of Hugin I use bad? (The version is 2013.0.0.4692917e7a55.)
If there is no problem, would you like to upload the file including 360_0529.JPG described in the template(gear360tmpl.pto)?
Accordingly, I want to confirm this problem.

Also, how accurate is the image created by Hugin stitched?
I am glad if you show me the example of the result.

I appreciate your help.
Thank you.

Videos failing (Nona)

Hello, guys.
I'm having a problem when trying to convert videos (photos are ok).

dev@dev-mac:~/Desktop/panoWork/gear360pano$ ./gear360video.cmd video.MP4


DEBUG: output filename: ./video_pano.mp4
Extracting frames from video (this might take a while)...
ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.MP4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: qt  isomhvc1
    creation_time   : 2016-01-02 12:03:13
  Duration: 00:00:15.62, start: 0.000000, bitrate: 30209 kb/s
    Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 2560x1280, 29993 kb/s, 59.94 fps, 59.94 tbr, 120k tbn, 120k tbc (default)
    Metadata:
      creation_time   : 2016-01-02 12:03:13
      handler_name    : VideoHandler
      encoder         : DRIMeV HEVC Encoder
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 190 kb/s (default)
    Metadata:
      creation_time   : 2016-01-02 12:03:13
      handler_name    : SoundHandler
[swscaler @ 0x1249ba0] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to './tmp.2tg8rHluFx/image%05d.jpg':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: qt  isomhvc1
    encoder         : Lavf56.40.101
    Stream #0:0(eng): Video: mjpeg, yuvj420p(pc), 2560x1280, q=2-31, 200 kb/s, 59.94 fps, 59.94 tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2016-01-02 12:03:13
      handler_name    : VideoHandler
      encoder         : Lavc56.60.100 mjpeg
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> mjpeg (native))
Press [q] to stop, [?] for help
key    function= 21 q=24.8 size=N/A time=00:00:01.11 bitrate=N/A    
?      show this help
+      increase verbosity
-      decrease verbosity
c      Send command to first matching filter supporting it
C      Send/Que command to all matching filters
D      cycle through available debug modes
h      dump packets/hex press to cycle through the 3 states
q      quit
s      Show QP histogram
frame=  936 fps= 24 q=24.8 Lsize=N/A time=00:00:15.61 bitrate=N/A    
video:88824kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Stitching frames...
Frame: ./tmp.2tg8rHluFx/image00001.jpg
Processing input images (nona)
caught exception: 
Precondition violation!
RemappedPanoImage<RemapImage,AlphaImage>::remapImage(): image sizes not consistent
(/build/hugin-xzKV1g/hugin-2015.0.0+dfsg/src/hugin_base/nona/RemappedPanoImage.h:452)

Error while running nona
Error while running /bin/bash
Removing temporary directories...

Preliminary support for 2560x1280 video

I've got some preliminary control points here that seem to stitch together pretty well. These were all done by hand using my own images, so I'm not sure if there is a more rigorous way of coming up with them or not.

c n0 N1 x118 y302 X2404 Y318 t0
c n0 N1 x1260.50736957882 y718.499647294616 X1326 Y722 t0
c n0 N1 x100 y477.333333333333 X2533 Y452 t0
c n0 N1 x117.854893798074 y330.293872950354 X2430 Y321 t0
c n0 N1 x14 y473 X2465 Y494 t0
c n0 N1 x893 y1179 X1637 Y1220 t0
c n0 N1 x1189 y406 X1350 Y408 t0
c n0 N1 x30.4484529469869 y575.91995423234 X2520 Y607 t0
c n0 N1 x1039.00000915503 y146.000010896103 X1574 Y206 t0
c n0 N1 x67 y887 X2469 Y884 t0
c n0 N1 x39 y406 X2443 Y435 t0
c n0 N1 x35 y752 X2504 Y752 t0
c n0 N1 x269 y126 X2253 Y161 t0
c n0 N1 x872 y124 X1642 Y62 t0

Problem uploading to Google photo

Thank you for very nice scripts.
I want to connect Gear 360 to my PC directly and upload the picture to Google photo without using Gear 360 Manager.
For the reason, I found this repository.
I have an question.

After creating equirectangular panorama with the following command, I uploaded it to Google photo.
But the picture is not recognized as 360ยฐ photography.

gear360pano.cmd 360_0001.JPG

I know that there is not a problem with your script.
Could you tell me if you have some information about this problem?
Thank you in advance.

stitching not working too well

Hi,
sorry for this unspecific request, but I found some sample photos where stitching is working very poorly.
For example this one
With enblend and multiblend both, the results have clear borders
Could you have a look at it please?
Thanks

Add support for geotagging from GPX

Hi,

here's a feature request. There is some software that does this but perhaps you are inclined to merge it into your project:

Add GPS location to EXIF data from a separate GPX file.

With this new feature your script would be a good solution for batch processing of pictures taken prior to uploading them to Mapillary.

Unable to stitch 2017 video

At first I ran into a PTO file naming issue:

error while parsing panos tool script: gear360video.pto

Changing line 307 in gear360video.cmd from PTOTMPL=gear360video.pto to: set PTOTMPL=gear360video4k.pto resolved that issue. But then I run into this error:

Processing took: 0 s
Processed files are in frames_stitched
Processing frame frames\image00015.jpg
Processing file: frames\image00015.jpg
Processing input images (nona)
nona.exe: using graphics card: NVIDIA Corporation GeForce GTX 1060/PCIe/SSE2
caught exception:
Precondition violation!
RemappedPanoImage<RemapImage,AlphaImage>::remapImage(): image unexpectedly changed dimensions.
(C:\Prog\Hugin\dynamic_vs2015\hugin-hg\src\hugin_base\nona/RemappedPanoImage.h:443)

Apologies for putting two issues in one ticket, but I'm not sure if I somehow caused the second one by using a different PTO file. Any thoughts as to what is causing this issue?

improve quality of final output

Hi there.
Since this script is getting so good on quality, it's a shame to throw it away at the end.
I use the following as my output command:
run_command ffmpeg -y -f image2 -r 30 -i "$OUTTEMPDIR/$IMAGETMPLENC" -r 30 -s 3840:1920 -c:v libx265 -x265-params crf=18 "$OUTTEMPDIR$

From here I do more video editing on Blender/Kdenlive, so I want the maximum quality. Some others might want lower bitrates, but even at crf=26 (default for x264) the x265 encoding has twice the quality of x264

-Evert-

compiling multiblend

I followed the installation guide, but was unable to compile multiblend using the g++ invocation example given in the readme. Anyways, I eventually managed to do it. If anybody encounters similar problems and the compilation fails, try reordeing the g++ parameters like this and it should succeed:

g++ -msse2 -O3 multiblend.cpp -o multiblend -ltiff -ltiffxx -ljpeg -lpng

Script adds extra frames to my video

The ffmpeg command that stitches the video from frames is causing extra frames to be inserted into the output video when compared to the input video.

In my case I have a test video, 449 frames long. After processing, it was 539 frames long.

The root cause of this is that ffmpeg assumes the input framerate to be 25, and the script sets the output framerate to 30.

The quick and easy fix is to put the -r 30 before the -i in that command. This then tells ffmpeg that the input framerate is 30, and it will preserve that unless told otherwise.

Kind regards,
-Evert-

output not treated as 360 by google photos

I'm very new to the gear360 (2017) and ran into an odd issue that I didn't see already in the repo. Sorry if it already came up.

When I run gear360pano, e.g., google photos does not detect the resulting file as a panorama. But if I open gear360sm-r210.pto in hugin and add some source images, the resulting output is recongized.

This is with master and hugin 2018.0.0.5abfb4de7961 (on Ubuntu 17.04).

Any pointers would be much appreciated.

preserve exif tags

Is posible to retain the exif tags from the original image?

Original:

ExifTool Version Number         : 10.36
File Name                       : 360_0002.JPG
Directory                       : .
File Size                       : 9.3 MB
File Modification Date/Time     : 2017:01:01 16:15:14-03:00
File Access Date/Time           : 2017:01:04 23:26:56-03:00
File Inode Change Date/Time     : 2017:01:02 17:28:00-03:00
File Permissions                : rwxr-----
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Big-endian (Motorola, MM)
Image Description               : SAMSUNG
Make                            : SAMSUNG
Camera Model Name               : SM-C200
Orientation                     : Horizontal (normal)
X Resolution                    : 350
Y Resolution                    : 350
Resolution Unit                 : inches
Software                        : 0.76
Modify Date                     : 2017:01:01 16:15:13
Y Cb Cr Positioning             : Co-sited
Exposure Time                   : 1/30
F Number                        : 2.0
Exposure Program                : Program AE
ISO                             : 320
Exif Version                    : 0230
Date/Time Original              : 2017:01:01 16:15:13
Create Date                     : 2017:01:01 16:15:13
Components Configuration        : Y, Cb, Cr, -
Exposure Compensation           : 0
Max Aperture Value              : 1.0
Metering Mode                   : Multi-segment
Light Source                    : Unknown
Flash                           : No Flash
Focal Length                    : 1.2 mm
Maker Note Version              : 0100
Device Type                     : High-end NX Camera
Samsung Model ID                : Various Models (0x5001038)
Smart Album Color               : n/a
Picture Wizard Mode             : Standard
Picture Wizard Color            : 65535
Picture Wizard Saturation       : -4
Picture Wizard Sharpness        : -4
Picture Wizard Contrast         : -4
White Balance Setup             : Auto
Raw Data Byte Order             : Little-endian (Intel, II)
Camera Temperature              : undef
Face Detect                     : Off
Face Recognition                : Off
Face Name                       : 
Pitch Angle                     : -3.5
Roll Angle                      : -0.2
Firmware Name                   : 0
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 7776
Exif Image Height               : 3888
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
Sensing Method                  : One-chip color area
Exposure Mode                   : Auto
White Balance                   : Auto
Digital Zoom Ratio              : 1
Focal Length In 35mm Format     : 6 mm
Scene Capture Type              : Standard
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : Normal
Compression                     : JPEG (old-style)
Thumbnail Offset                : 36146
Thumbnail Length                : 13889
MPF Version                     : 0100
Number Of Images                : 2
MP Image Flags                  : Dependent child image
MP Image Format                 : JPEG
MP Image Type                   : Large Thumbnail (VGA equivalent)
MP Image Length                 : 729680
MP Image Start                  : 9026302
Dependent Image 1 Entry Number  : 1920
Dependent Image 2 Entry Number  : 960
Image Width                     : 7776
Image Height                    : 3888
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
Time Stamp                      : 2017:01:01 16:15:14-03:00
Aperture                        : 2.0
Image Size                      : 7776x3888
Preview Image                   : (Binary data 729680 bytes, use -b option to extract)
Megapixels                      : 30.2
Scale Factor To 35 mm Equivalent: 5.0
Shutter Speed                   : 1/30
Thumbnail Image                 : (Binary data 13889 bytes, use -b option to extract)
Circle Of Confusion             : 0.006 mm
Field Of View                   : 143.1 deg
Focal Length                    : 1.2 mm (35 mm equivalent: 6.0 mm)
Hyperfocal Distance             : 0.12 m
Light Value                     : 5.2

Processed:

ExifTool Version Number         : 10.36
File Name                       : 360_0002_pano.jpg
Directory                       : .
File Size                       : 5.6 MB
File Modification Date/Time     : 2017:01:04 23:30:13-03:00
File Access Date/Time           : 2017:01:04 23:30:35-03:00
File Inode Change Date/Time     : 2017:01:04 23:30:13-03:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Resolution Unit                 : None
X Resolution                    : 1
Y Resolution                    : 1
Image Width                     : 7776
Image Height                    : 2246
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:4:4 (1 1)
Image Size                      : 7776x2246
Megapixels                      : 17.5

Hugin window opens and makes computer unusable

Hi! First of all, thank you so much: this script is great. It even stitches the panorama better than the one that comes with the camera!

I have a problem running the video script (though this happens also with the panorama script, but in that case doesn't bother): when the panorama scripts (which is called by the video script for each frame) runs Hugin, that opens for a second a window. The problem is this turns impossible to use the computer, because that window gets the focus and I can't do anything on other windows.

Is there any workaround for this?

Edit: this happens using Ubuntu 16.04, with the Hugin from the official repo.

Thank you so much!

Command Not Found in Mac

Hi,

After installation, path modification on .bash_profile, and chmod the gear360pano.cmd to executable, I tried to run your script in Mac.

However, I got
"-bash: gear360pano.cmd: command not found"

Do you know why ?
Thanks,
Paul

Audio Video async (solved)

Hi,

I realized that the output videos had a slight AV-Desync problem. I figured out that the ffmpeg parameters were wrong; the -r 30 was ignored, and the videos only had 25 frames per second.

The following commands work as expected; you might consider using one of the "cheaper" codecs, cause using the h264 codec, even my Quadcore pc cannot play back the videos in real time using the GoProVRPlayer. (Any suggestions are welcome!)

Anyways: these are the variants I tested:

#full size, full quality. No Idea how to play back the video file.
run_command ffmpeg -f image2 -framerate 30 -i "$OUTTEMPDIR/$IMAGETMPL" -s 3840:1960 -vcodec libx264 "$OUTTEMPDIR/video.mp4"

#medium size with 264 compression - small video, choppy playback
run_command ffmpeg -f image2 -framerate 30 -i "$OUTTEMPDIR/$IMAGETMPL" -s 1920:960 -vcodec libx264 "$OUTTEMPDIR/video.mp4"

#cpu-friendly codec; bigger files, but runs smooth on a quadcore cpu. RECOMMENDED
run_command ffmpeg -f image2 -framerate 30 -i "$OUTTEMPDIR/$IMAGETMPL" -s 2880:720 -vcodec mpeg2video -qscale:v 4 "$OUTTEMPDIR/video.mp4"

#cpu friendly low resolution: runs on a netbook.
run_command ffmpeg -f image2 -framerate 30 -i "$OUTTEMPDIR/$IMAGETMPL" -s 1920:960 -vcodec mpeg2video -qscale:v 4 "$OUTTEMPDIR/video.mp4"

Framestempdir not removed.

When framestempdir is created, the variable is
"FRAMESTEMPDIR"
However, when the clean_up procedure runs, it tries to clean
"FRAMESTMPDIR"

Just add the "E" in TMP, and you are all set.
:)

Time Lapse video does not encode

Hi there.
When using the Gear 360 in time lapse mode, the video does not have an audio component.
When running gear360video.cmd on it, the video encodes the frames properly, and stitches them in a video. However, when trying to extract the audio from the original (which does not have an audio stream) the script produces this error:

Output #0, adts, to './tmp.0twQCgYXU3/tmpaudio.aac':
Output file #0 does not contain any stream
Error while running ffmpeg
Removing temporary directories...

It then very helpfully removes the properly encoded output video.
It should be possible to detect whether a video has an audio stream, and just skip this step if there is no audio to be encoded.

-Evert-

Speed improvements

Can we keep an issue open on the topic of speed improvements?
Currently stitching takes around 12 seconds per image which seems ... less than ideal. ๐ŸŒ

add documentation

Please, add a wiki page with the step-by-step workflow to use the hugin template.
Thanks!

Crash on long video processing

Hi there....
I routinely take clips that are many thousands of frames.
With the default setup, /tmp is used for the blended images, and this directory is mounted in memory on linux, at least.
Once the memory filesystem runs out of space, the script fails.

I suggest putting the blended images in a subdirectory of the directory the source clip is in, just like the the extracted frames are. The chances are that the file system where the raw video is kept has a lot more space than the ram of the system. This does not seem to impact the speed of the script at all.

I like that the intermediate frames from Nona is being put into ram, it does speed things up a bit.

Kind regards,
-Evert-

Error on video

Hi,

I have tried your work on W7.

It works lovely for photos but I can't use it on video. :

Converting video to images...
Stitching frames...
Processing frame frames\image00001.jpg
Processing input images (nona)
nona failed, panorama not created

"Reencoding video..."
ffmpeg failed, video not created

error.txt
capture cmd

Twice the size as ActionDirector and less quality

I've compared the image stiching of ActionDirector and this script. The image stiched by the script was almost twice the size of the ActionDirector file. (12 MB instead of 6 MB)
Also the image quality is not as good as in ActionDirector. When zooming in on one of the images from the script the picture gets very pixelated. On the image from ActionDirector the images are much smoother. (Maybe due to interpolation?)

Could this be improoved or is this just not possible using those sitching tools?

Script to remove yourself from images

I have created a quick nautilus script to remove yourself from images by using two halves from two raw images.
https://paste.ubuntu.com/26319454/
This goes to ~/.local/share/nautilus/scripts/ as an executable .sh file

Move in front of lens 1, take a picture, move in front of lens 2 (without moving the camera in between), take a picture
Select the two files that "match" in nautilus and run the script, it drops one image in which you are twice in /tmp/stitchpath and one in which you are removed.

I am sure it could be written more elegantly, but it works

Typo in gear360pano, wrong pto

I encountered two small issues during video processing:
First one,

WARN: 21:34:11.630426 (/build/hugin-4U_FiW/hugin-2016.2.0~rc2+dfsg/src/hugin_base/panodata/Panorama.cpp:2054) readData(): Failed to read from dataInput. error while parsing panos tool script: ./gear360sm-c210.pto Error while running nona
Fix:

Line in gear360pano.cmd:

PTOTMPL_SM_C200="$DIR/gear360sm-c210.pto" should be:
PTOTMPL_SM_C200="$DIR/gear360sm-c200.pto"

Second one:
remapImage(): image sizes not consistent

The video script tried to use gear360sm-c200.pto instead gear360video.pto for some reason.

html gallery file not found

Lost css/valiant360.css required file.

127.0.0.1 - - [27/May/2017 23:59:12] code 404, message File not found
127.0.0.1 - - [27/May/2017 23:59:12] "GET /css/valiant360.css HTTP/1.1" 404 -

pano tool - Unable to open file '/tmp/tmp.4VL5Wv4sQr/split-0.tif'

Hi! I'm running you tool in Windows 10. yes!! :)

Im using cygwin, Hugin for windows installer and dependencies.

$ export PATH=$PATH:/cygdrive/c/Program\ Files\ (x86)/Hugin/bin

But there is an error on running gear360pano.sh

$ ./gear360pano.sh 360_0001.JPG
Splitting input image
Processing input images
caught exception:
Precondition violation!
Unable to open file '/tmp/tmp.4VL5Wv4sQr/split-0.tif'.
(d:/Works/vigra-1.11.0/src/impex/codecmanager.cxx:203)

Error when running nona

So, the solution I found is simple:

$ diff gear360pano.sh.ori gear360pano.sh
41c41,42
< TEMPDIR=`mktemp -d`

---
> if [ ! -d ./tmp ] ; then mkdir ./tmp; fi
> TEMPDIR=`mktemp -d -p ./tmp`

Can you include this change? Thanks a lot!

Excelent tool !!!

Detailed manual?

As a newby to cygwin and hugin i would love to see a detailed manual on how to run this script.

Ive tried to start it from cygwin terminal but than get an error on line 5.

$ gear360pano.sh 360_150.JPG
/usr/bin/gear360pano.sh: regel 5: syntaxfout nabij onverwacht symbool 'newline'
/usr/bin/gear360pano.sh: regel 5: `'

So i would like to learn where exactly put the .sh and .pto files and how to run it/them.

Batch Video Stitching

Hi,
I am doing VR filmmaking with a Samsung gear 360 and sometimes produce 100s of MP4s in a day. I am looking for a command line solution that would allow me to batch stitch videos to a directory overnight. Something like:

Videostitcher.cmd c:/source_directory c:/target_directory.

Can your code do this? And if it doesn't, are u considering adding that feature?

Script will not work when run from a different path

Script will not work when run from a different path because it will not find pto template file.

Solution: there's a way of detecting location of the script and the template file should be taken from there (the answer is somewhere on stackoverflow).

Does not run in Z Shell (zsh)

If I run the script from my shell "Z shell" (zsh) I get the following error message.

./gear360video.cmd: 73: ./gear360video.cmd: Syntax error: "(" unexpected (expecting "}")

As I get the same error when run in a posix shell, I assume this might be due to the use of bashisms.

The quick fix is to either add #!/bin/bash to the top of the file (which might break Windows support) or to run the script in bash with bash -c ./gear360pano ....

Alternatively one could also make the script fully posix compliant.

I am happy with the first fix and mostly want to document this error and fix.

Exporting videos with audio, and much more (solved!)

Hi,

I sat down this night and improved the code a lot. These are my changes:

  • Video output now includes Audio
  • Nautilus "Open With" compatibility - so now you can batch stitch just by selecting many files in nautilus and click "open with"!
  • Bugfixes concerning spaces in directory or file names that confused the toolchain.
  • Bugfixes concerning the script living in a different directory than the current directory
  • Bugfix that Video mode wouldn't delete its temporary files
  • Desktop notifications when the job starts and stops or you invoke the executable without parameters
    (in open-with-mode, you don't have a terminal and don't really see anything)

the only open issue is the distortion. I figured out that the temporary .tif pictures that are produced show that one camera fills 66% of the screen while the other camera only covers 33% of the image area - this might be the cause.

Find my update here:
update.zip

improve image quality of extracted frames

Hi there.
Ffmpeg uses standard compression for the extracted .jpg files from the video. Since we will be doing transforms on it, it is better to use a highest quality possible.
Please consider changing
run_command ffmpeg -y -i "$1" "$FRAMESTEMPDIR/$IMAGETMPL"
to
run_command ffmpeg -y -i "$1" -q:v 2 "$FRAMESTEMPDIR/$IMAGETMPL"

Kind regards,
Evert

Video stitching disconcerting

Enblend uses some fancy procedure to pick a seam between two images that it stitches.
This produces superior results for stills.

However, due to the small differences between video frames, the stitching seam jumps around and the effect is quite disconcerting on near objects in video.

I have been doing a little bit of testing, and multiblend is visually quite superior, as it just does a straight blend between the images. It is slightly faster too.
In Arch, multiblend is easy to install, I don't know about other distrobutions.
The command for multiblend is not quite a drop-in replacement.

All the options has to be specified before the output file. Also, I was using enblend "-w", which turned into "--wideblend" for multiblend.

Lastly, --compression=jpeg "$JPEGQUALITY" needs to be turned into --compression=$JPEGQUALITY
It looks like this is because multiblend reads the compression type from the file extention.

Please consider adding multiblend as an option for video stitching.
-Evert-

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.