This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, resize the video to a reasonable size. Here only the width is specified, and the height is determined by the | |
# aspect ratio. | |
ffmpeg -i input.mp4 -vf scale=1024:-2 -an input_resized.mp4 | |
# Here a bitrate of 300k is used. To calculate the right bitrate, use the formula: | |
# bitrate = FILE_SIZE*8192*1000/LENGTH | |
# where FILE_SIZE is in MB and LENGTH is in seconds, and the output bitrate is in kilobits. | |
# e.g. for a 137s video and a desired file size of 5MB, the bitrate should be around 5*8192*1000/137 ~ 300k | |
ffmpeg -y -i input_resized.mp4 -c:v libx264 -preset medium -b:v 300k -pass 1 -an -f mp4 /dev/null | |
ffmpeg -i input_resized.mp4 -c:v libx264 -preset medium -b:v 300k -pass 2 -an input_compressed.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import numpy as np | |
import cv2 | |
import argparse | |
import ruamel.yaml | |
def main(): | |
parser = argparse.ArgumentParser(description="Converts a cam info in kalibr yaml format to the expected ROS format for camera_info_manager.") | |
parser.add_argument("--camchain", dest="camchain", | |
help="Camchain yaml file with camera info.", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert -delay 1x60 -loop 0 *.png video.gif |