# create the destiny dir data_2d_pano=data_2d_pano mkdir -p $data_2d_pano cd$data_2d_pano for sequence in${file_list[@]}; do mkdir -p $sequence cd$sequence mkdir -p pano cd pano mkdir -p data_rgb cd ../.. done
cd ../data_2d_pano echo"Current dir:" pwd
# #ffmpeg operation for sequence in${file_list[@]}; do # create the path and move into cd$sequence # 1. fetch images and merge into videos ffmpeg -f image2 -r 1 -i ../../data_2d_raw/$sequence/image_03/data_rgb/%10d.png -vcodec libx265 -pix_fmt yuv420p -b:v 40000k -bufsize 5000k -preset fast -c:a copy -y -r 1 fisheye_rgb_sequence_r.mp4 ffmpeg -f image2 -r 1 -i ../../data_2d_raw/$sequence/image_02/data_rgb/%10d.png -vcodec libx265 -pix_fmt yuv420p -b:v 40000k -bufsize 5000k -preset fast -c:a copy -y -r 1 fisheye_rgb_sequence_l.mp4 # 2. merge two videos into one video ffmpeg -i fisheye_rgb_sequence_l.mp4 -i fisheye_rgb_sequence_r.mp4 -filter_complex hstack -y dual_fisheye_image.mp4 # 3. transform to equirectangular video ffmpeg -y -i dual_fisheye_image.mp4 -vf v360=dfisheye:e:yaw=-90:ih_fov=187.8:iv_fov=185 -c:v libx265 -b:v 40000k -bufsize 5000k -preset ultrafast -c:a copy equirectangular_image_sequence.mp4 # 4. Equirectangular video to separate images ffmpeg -i equirectangular_image_sequence.mp4 -r 1 -q:v 1 -start_number 0 ./pano/data_rgb/%10d.png cd .. done