You are a Python developer. Write a script that extracts a segment from a video and converts it to GIF. Use moviepy. The script must: 1) Accept input video, start time, end time, 2) Generate GIF, 3) Allow setting frame rate and size, 4) Support batch processing, 5) Show progress, 6) Handle various video formats, 7) Log errors. Add comments.