{"id":15286968,"url":"https://github.com/shivabhusal/erika-slideshow","last_synced_at":"2025-04-13T03:57:44.527Z","repository":{"id":57714738,"uuid":"204628806","full_name":"shivabhusal/erika-slideshow","owner":"shivabhusal","description":"A CLI Ruby Gem to generate slideshow videos with bg-audio from images in sequence. Also supports subtitle/captions.","archived":false,"fork":false,"pushed_at":"2022-10-02T07:50:28.000Z","size":56684,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T03:57:39.007Z","etag":null,"topics":["ffmpeg","ruby","slideshow","subtitles","video"],"latest_commit_sha":null,"homepage":"https://shivab.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shivabhusal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-27T05:47:29.000Z","updated_at":"2022-07-24T09:06:51.000Z","dependencies_parsed_at":"2022-09-26T21:30:59.958Z","dependency_job_id":null,"html_url":"https://github.com/shivabhusal/erika-slideshow","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivabhusal%2Ferika-slideshow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivabhusal%2Ferika-slideshow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivabhusal%2Ferika-slideshow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivabhusal%2Ferika-slideshow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shivabhusal","download_url":"https://codeload.github.com/shivabhusal/erika-slideshow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661705,"owners_count":21141450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffmpeg","ruby","slideshow","subtitles","video"],"created_at":"2024-09-30T15:19:45.596Z","updated_at":"2025-04-13T03:57:44.502Z","avatar_url":"https://github.com/shivabhusal.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# video-generator\nThis is tested in macOS Mojave `10.14.6 (18G87)`\n\n## Installation\nPlease make sure you install `FFMPEG` library in your machine before using this gem.\n\n\n```bash\n    gem install erika   \n\n```\n## Requirements\n### FFMPEG\nA complete, cross-platform solution to record, convert and stream audio and video.\n#### MacOSx\n```bash\nbrew install ffmpeg\n```\n\n#### Ubuntu\n```bash\napt-get install ffmpeg\n```\n\n\n## Usage\nTo compile images in `~/pictures/birthday`, you need to make sure files are named in proper order. \nI recommend you to prefix the files with number like\n```\n- 0 My first birthday.jpg\n- 1 My second birthday.jpg\n- 2 My second birthday.jpg\n- 3 My third birthday.jpg\n```\n\nsingle command to compile\n```bash\ncd ~/pictures\n\nerika g -s birthday -o mybirthday.mp4 \n\n# This will generate video called `mybirthday.mp4`\n```\n\n## Options\n```bash\n erika help g\nUsage:\n  erika g\n\nOptions:\n  -o, [--output=OUTPUT]                            # Output path; where to generate output movie\n  -s, [--source=SOURCE]                            # Input path; folder path where the images are located\n  -a, [--audio=AUDIO]                              # Audio path; the path to bg audio\n  -t, [--transition-duration=TRANSITION_DURATION]  # Transition animation duration between two images\n  -S, [--slide-duration=SLIDE_DURATION]            # Slide duration between two images\n\nGenerate movie\n\n```\nExample:-\n\n```ruby\n erika g -s happy -S=5 -t=4 -o=opt/mymovie.mp4\n\n```\n\n## How Slide Animation is implemented\nCreating intermediate mpeg's for each image and then concatenate them\n all into a `video`. \n \n**For example**, say you have `5` images; you would run this for each one of the \n images to create the intermediate mpeg's with a fade in at the beginning and a fade out at the end.\n\n```bash\nffmpeg -y -loop 1 -i \u003cyour-image\u003e -vf \"fade=t=in:st=0:d=0.5,fade=t=out:st=4.5:d=0.5\" -c:v mpeg2video -t 5 -q:v 1 image-1.mpeg\n```\n\nwhere `t` is the duration, or time, of each image. Once you have all of these mpeg's, you use\n ffmpeg's concat command to combine them all into an `mp4`.\n\n```bash\nffmpeg -y -i image-1.mpeg -i image-2.mpeg -i image-3.mpeg -i image-4.mpeg -i image-5.mpeg -filter_complex '[0:v][1:v][2:v][3:v][4:v] concat=n=5:v=1 [v]' -map '[v]' -c:v libx264 -s 1280x720 -aspect 16:9 -q:v 1 -pix_fmt yuv420p output.mp4\n```\n\n## Components Used\n- get Image dimension\n    - [https://stackoverflow.com/a/32824749/3437900](https://stackoverflow.com/a/32824749/3437900)\n    - [https://askubuntu.com/a/577431](https://askubuntu.com/a/577431)\n- IMAGE SCALING\n    - [https://www.bogotobogo.com/FFMpeg/ffmpeg_image_scaling_jpeg.php](https://www.bogotobogo.com/FFMpeg/ffmpeg_image_scaling_jpeg.php)\n- FFMPEG filters\n    - [https://ffmpeg.org/ffmpeg-filters.html#subtitles-1](https://ffmpeg.org/ffmpeg-filters.html#subtitles-1)\n    \n- Resizing and padding image\n    - [https://superuser.com/a/991412](https://superuser.com/a/991412)\n    \n- Capturing STD Streams to prevent logs being cluttered\n    - [https://ruby-doc.org/stdlib-1.9.3/libdoc/open3/rdoc/Open3.html#method-c-capture3](https://ruby-doc.org/stdlib-1.9.3/libdoc/open3/rdoc/Open3.html#method-c-capture3)\n- Animation in Slide Transition\n    - [https://stackoverflow.com/questions/30974848/animation-between-images-using-ffmpeg](https://stackoverflow.com/questions/30974848/animation-between-images-using-ffmpeg)\n    - [https://superuser.com/questions/833232/create-video-with-5-images-with-fadein-out-effect-in-ffmpeg/834035#834035](https://superuser.com/questions/833232/create-video-with-5-images-with-fadein-out-effect-in-ffmpeg/834035#834035)\n- Image to Video Guide FFMPEG\n    - [https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/image_sequence](https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/image_sequence)\n- Repeat Audio and generate a new audio file\n    - [https://stackoverflow.com/a/8017021/3437900](https://stackoverflow.com/a/8017021/3437900)\n- Add Subtitles to the video\n    - [https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo](https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo)\n    \n    https://superuser.com/questions/547296/resizing-videos-with-ffmpeg-avconv-to-fit-into-static-sized-player/1136305#1136305\n    https://trac.ffmpeg.org/wiki/Concatenate","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivabhusal%2Ferika-slideshow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshivabhusal%2Ferika-slideshow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivabhusal%2Ferika-slideshow/lists"}