tanersener / ffmpeg-video-slideshow-scripts Goto Github PK
View Code? Open in Web Editor NEWShell scripts to create video slideshows using images and videos
License: MIT License
Shell scripts to create video slideshows using images and videos
License: MIT License
Thank you and your team for all the scripts provided. I've learnt a lot from your work.
But I found that when I improve the quality of my input image and other parameters remain unchanged, the image quality of each frame of the video and the size of the video itself hardly changes. (The image quality improves, and the video size should also be expected to increase a lot in my mind). In fact, I want every frame image quality stay the same as the original image but it seems as if the quality of the image has lost in the process of making the video.
Is there any way to change the image quality of each frame in the generated video to keep it consistent with the original image? (such as adding ffpmeg parameter at the end of the script)
Thank you
"'
Hello!
How to change zoom scale in zoom_in_and_pan_with_fade_in_out_one script?
Do you can do it in variable in settings?
P.S. Do you can do all transitions in one script with random choice? It would be great
Hi
How I can make the random transition to the slideshow?
I already have the release version of "Video Slideshow Script Generator"
And I have many images to add to video slideshow but I don't how to make the random transition.
Thanks!
How to create this type of transition in ffmpeg. Any idea please help out.
https://youtu.be/WUuk4fkjz58
Hi
These scripts seems to be awesome.
I need to implement these scripts in my android app to create slideshow with these effects and export as mp4 file.
please help
When running advanced_video_scripts/blurred_background.sh, with the 3 sample videos linked to from the README, all downloaded at 1280x720 resolution, the script fails (on Ubuntu w/ ffmpeg 2.8.15 and on Mac as well).
[trim @ 0x229cd00] [Eval @ 0x7ffd128a5220] Invalid chars 'q-0.0sizeN/Atime00' at the end of expression '340.0q-0.0sizeN/Atime00'
[trim @ 0x229cd00] Unable to parse option value "340.0q-0.0sizeN/Atime00"
7775q-0.0sizeN/Atime00" as durationoption value "01.13bitrateN/A
12179q-0.0sizeN/Atime00' @ 0x7ffd128a5220] Invalid chars 'bitrateN/A12179q-0.0sizeN/Atime00' at the end of expression '02.56bitrateN/A
12179q-0.0sizeN/Atime00"e to parse option value "02.56bitrateN/A
16581q-0.0sizeN/Atime00' @ 0x7ffd128a5220] Invalid chars 'bitrateN/A16581q-0.0sizeN/Atime00' at the end of expression '04.03bitrateN/A
16581q-0.0sizeN/Atime00"e to parse option value "04.03bitrateN/A
20781q-0.0sizeN/Atime00' @ 0x7ffd128a5220] Invalid chars 'bitrateN/A20781q-0.0sizeN/Atime00' at the end of expression '05.50bitrateN/A
20781q-0.0sizeN/Atime00"e to parse option value "05.50bitrateN/A
25082q-0.0sizeN/Atime00' @ 0x7ffd128a5220] Invalid chars 'bitrateN/A25082q-0.0sizeN/Atime00' at the end of expression '06.90bitrateN/A
25082q-0.0sizeN/Atime00"e to parse option value "06.90bitrateN/A
636-30'0.0sizeN/Atime00:00:20.00bitrateN/Ae near '00:08.33bitrateN/A
636-30'0.0sizeN/Atime00:00:20.00bitrateN/Azing filter 'trim' with args 'start_frame=0:end_frame=340.0q-0.0sizeN/Atime00:00:01.13bitrateN/A
Error initializing complex filters.
Invalid argument
Slideshow creation failed
Hi Taner,
I bought this https://github.com/tanersener/ffmpeg-video-slideshow-scripts/tree/master/advanced_video_scripts and I love to have it to create video faster. When I use the script, I see these:
When I compare code of 2 scripts, I see the different at here:
Could we mix like:
I try to do this but I can't so would you please help. I think this is your scripts so this will be done easier than I do. Or you can email vohoangan gmail.com
Again, thank you very much.
Hi Bro !
I'm creating videos from multiple images and using the code here: https://github.com/tanersener/ffmpeg-video-slideshow-scripts/tree/master/transition_scripts
I have the problem that when creating videos from more than 30 images, I get an error: Failed to inject frame into filter network: Out of memory. Please help me in this case. Thank you!
Hello,
I'm trying to adapt the script to use it with fewer images, after modifying the script, removing the stream that I do not need, I get this error:
Filter split: output1 has a unconnected output
This in my modified script:
ffmpeg -y
-loop 1 -i ../photos/1.jpg
-loop 1 -i ../photos/2.jpg
-filter_complex "
[0:v]setpts=PTS-STARTPTS,scale=w='if(gte(iw/ih,1920/1280),min(iw,1920),-1)':h='if(gte(iw/ih,1920/1280),-1,min(ih,1280))',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,format=rgba,split=2[stream1out1][stream1out2];
[1:v]setpts=PTS-STARTPTS,scale=w='if(gte(iw/ih,1920/1280),min(iw,1920),-1)':h='if(gte(iw/ih,1920/1280),-1,min(ih,1280))',scale=trunc(iw/2)*2:trunc(ih/2)2,setsar=sar=1/1,format=rgba,split=2[stream2out1][stream2out2];
[stream1out1]pad=width=1920:height=1280:x=(1920-iw)/2:y=(1280-ih)/2:color=#00000000,trim=duration=3,select=lte(n,90)[stream1overlaid];
[stream1out2]pad=width=1920:height=1280:x=(1920-iw)/2:y=(1280-ih)/2:color=#00000000,trim=duration=1,select=lte(n,30)[stream1ending];
[stream2out1]pad=width=1920:height=1280:x=(1920-iw)/2:y=(1280-ih)/2:color=#00000000,trim=duration=2,select=lte(n,60)[stream2overlaid];
[stream2out2]pad=width=1920:height=1280:x=(1920-iw)/2:y=(1280-ih)/2:color=#00000000,trim=duration=1,select=lte(n,30),split=2[stream2starting][stream2ending];
[stream1ending][stream2starting]overlay=y='-h+t/11280':x=0,select=lte(n,30)[stream2blended];
[stream1overlaid][stream2blended][stream2overlaid]concat=n=3:v=1:a=0,format=yuv420p[video]"
-map [video] -vsync 2 -async 1 -rc-lookahead 0 -g 0 -profile:v main -level 42 -c:v libx264 -r 30 ../transition_wipe_in_vertical.mp4
Hi bro!
Your codes are awesome. Please show me how to make these codes worked with a folder of image, and the number of images is random.
So thank you!
Invalid stream specifier: stream0out0.
Last message repeated 1 times
Stream specifier 'stream0out0' in filtergraph description [0:v]setpts=PTS-STARTPTS,scale=w='if(gte(iw/ih,1280/720),-1,1280)':h='if(gte(iw/ih,1280/720),720,-1)',crop=1280:720,setsar=sar=1/1,fps=30,loop=loop=3*30:size=1:start=0[stream0out0];[3:v]fps=30,setpts=PTS-STARTPTS,pad=w=1280:h=720:color=#00000000[random0];[stream0out0][random0]overlay=x=5:y=10,setpts=PTS-STARTPTS[random1];[4:v]fps=30,setpts=PTS-STARTPTS,pad=w=1280:h=720:color=#00000000[random2];[random1][random2]overlay=x=15:y=020,setpts=PTS-STARTPTS[random3];[stream0out0]trim=start_frame=0:end_frame=90-0,setpts=PTS-STARTPTS[stream0static];[stream0static]concat=n=1:v=1:a=0[video] matches no streams.
.\script_1.sh: [[: command not found
when we apply Transition effects on 2 video It's remove original sound of video.
How to prevent this apply Transition effect on 2 videos with original sound of video
Hi @tanersener
Thanks for the awesome repository. I don't have working knowledge of shell scripts but I have working knowledge of Python. It would be great if you could spare some time to guide me about how can i implement zoom and pan effects in Python.
It would be a great help. Thanks
I've "bought" the binary and FFMPEG has issues with too many arguments. This is normally because the filter is colossal.
I fixed it by moving the filters into a separate file "filter.txt" and then replacing the environment variables for transition durations with the explicit values, eg. ${ELEMENT_235_FRAME_COUNT} is replaced with the value 180, which can be done for everything by doing a regex replace ELEMENT_(.*?)_FRAME_COUNT with 180, then replacing ${180} with 180. (In my case all durations were identical).
I then used -filter_complex_script filter.txt instead of a call to -filter_complex "${COMPLEX_FILTER}"
I wonder if the generated script could instead:
Is it possible to add the text overlay on certain slides?
While having roundabout 100 input images for the slideshow, the script crashes once it starts encoding the video file:
frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
./fade_in_one.sh: line 115: 4283 Killed
I think, I might have run out of memory.
Any ideas for a workaround (except for getting more RAM)?
We Are Developing a Mobile App where we need to use ffmpeg but there not much on the Internet on how to use it, can you point to some reference or documentation
Please make ffmpeg for
gl-transitions i need this kind of transition in android but i can't built so please can you make it for all?
Hello, can someone suggest me how to add white border to each image in a slideshow and how to indent from screen edges, so that no one image touches any edge of the screen. Thank you!
Hi Taner,
Thank for sharing your work. I use all your scripts successfully, all scripts generate great video. I bought VSSG and it generates script_1.sh . When I run script1 in same linux box, it shows issue:
bash: ./script_1.sh: /bin/bash^M: bad interpreter: No such file or directory
Head of script is like following:
START_TIME=$SECONDS
declare ELEMENT_0_FRAME_COUNT=100
declare ELEMENT_0_INCLUDES_AUDIO=
declare ELEMENT_0_DURATION=4
declare ELEMENT_1_FRAME_COUNT=100
declare ELEMENT_1_INCLUDES_AUDIO=
declare ELEMENT_1_DURATION=4
eval "null\ffmpeg -hide_banner -i 'demo/1-test-vid2' -map 0: v: 0 -vf fps=25 -f null - 2>/tmp/.mf.counter"
declare ELEMENT_2_FRAME_COUNT=$(cat -v -e /tmp/.mf.counter | sed 's/.^M//' | grep -Eo "frame=." | grep -Eo ".*fps" | sed 's/fps//g;s/frame//g;s/=//g;s/\ //g')
declare ELEMENT_2_INCLUDES_AUDIO=$(null\ffprobe -i 'demo/1-test-vid2' -show_streams -select_streams a -loglevel error)
declare ELEMENT_2_DURATION=$(null\ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 'demo/1-test-vid2.mp4')
Or the simple script has same issue as well.
Would you please help. Thanks
Hi @tanersener ,
I'm trying to use the effects described here https://ffmpeg.org/ffmpeg-filters.html#Examples-113 but it doesn't work.
I add x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
to file zoom_in_and_pan_with_fade_in_out_one.sh but it doesn't work. Could you please help me with this?
It takes too much time to generate a video from pictures
How can I reduce the conversion time?
Has anyone given thought to enabling the mixing of short videos together with photos?
Hello again
Please help me! How to add mp3 file to video background?
IImmediately with one command and a slideshow and audio
Is it possible?
how can we use .sh file into Android. how can we run this using FFMPEG command & get output for specific input
Suggest code and explain
exp = "((-0.5*H * (Y - 0.5*H))/(0.5*H * sqrt((X - 0.5*W)*(X - 0.5*W) + (Y - 0.5*H)*(Y - 0.5*H))))"
"all_expr=if(lt(T,${TRANSITION_DURATION}),if(lte(if(gte(X,W/2),acos(${exp}),2*PI-acos(${exp})),T*2*PI/${TRANSITION_DURATION}),A,B),B)"
Hello, I would like to use this library to create a transparent slideshow with transparent png. How can we create a transparent .mov video. I have tried to set BACKGROUND_COLOR to "[email protected]" then add c:v png but did not work. Please help
this shell script is make for linux
can it use at windows?
I have no idea..
The scripts do not handle filenames with spaces.
(BTW: thanks for the great collection of scripts!)
Itry to pay for videoscripts with Paypal , and I can not pay successfully. Is there another payment method?
Here is an example of overlay font effects: https://www.youtube.com/watch?v=Ifvrt-G9-nE
When using the advanced_video_scripts, the source audio is dropped from the result video. It would be nice to have audio kept, and silence be used for photos and source videos w/o an audio track.
How can we Merge 2 videos with one Video have Sound & another Video is silent there is no any audio file
please Provide FFMPEG command for this
I just downloaded scripts bundle v4 and trying to concatenate 2 videos from https://pixabay.com/videos/wheat-wheat-field-nature-17285 and I always got "Error initializing complex filters. Result too large" message.
Scripts I've tried to execute are
Environment
Full logs from fade-in
script
Video Slideshow Info
------------------------
Media count: 2
Dimension: 1280x720
FPS: 30
Image duration: 4 s
Transition duration: 1 s
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.1 (GCC) 20200726
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'media/field.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41isomavc1
creation_time : 2018-07-15T03:19:17.000000Z
Duration: 00:00:28.23, start: 0.000000, bitrate: 2491 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 2485 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 120k tbc (default)
Metadata:
creation_time : 2018-07-15T03:19:17.000000Z
handler_name : L-SMASH Video Handler
encoder : AVC Coding
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'media/field2.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41isomavc1
creation_time : 2018-07-15T03:19:17.000000Z
Duration: 00:00:28.23, start: 0.000000, bitrate: 2491 kb/s
Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 2485 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 120k tbc (default)
Metadata:
creation_time : 2018-07-15T03:19:17.000000Z
handler_name : L-SMASH Video Handler
encoder : AVC Coding
Input #2, lavfi, from 'aevalsrc=0':
Duration: N/A, start: 0.000000, bitrate: 2822 kb/s
Stream #2:0: Audio: pcm_f64le, 44100 Hz, mono, dbl, 2822 kb/s
[trim @ 0596d640] Value -30.000000 for parameter 'end_frame' out of range [0 - 9.22337e+18]
Last message repeated 1 times
[trim @ 0596d640] Error setting option end_frame to value -30.
[Parsed_trim_15 @ 0594f840] Error applying options to the filter.
[AVFilterGraph @ 05908640] Error initializing filter 'trim' with args 'start_frame=0:end_frame=-30'
Error initializing complex filters.
Result too large
If you want to or need to implement an animation/transition, please don't ask me to do it for you. Scripts in this repository already shows many different animations/transitions. Look at them and try to implement it yourself.
I want to use multiple effects for one video.
For an instance,
Push-box for image 1, Sliding bars for image 2, Photo collection for image 3, Zoom in for image 4, Zoom out for image 5.
Thanks in Advance
By executing the script you generated, the generated video will drop frames.
I tried to solve it by increasing the FPS, but nothing worked.
Is there a solution?
If you have questions about FFmpeg or need help about commands, filters, devices, etc. please ask your questions to ffmpeg-user mailing list.
PLease help? how to do zoompan duration acording to duration slide
in this script for example
https://github.com/tanersener/ffmpeg-video-slideshow-scripts/blob/master/advanced_scripts/zoom_in_and_pan_with_fade_in_out.sh
I was try to change parameter d in zoompan, but this didn't work
FULL_SCRIPT+="[stream$((c+1))fadein][stream$((c+1))][stream$((c+1))fadeout]concat=n=3:v=1:a=0,scale=${WIDTH}*5:-1,zoompan=z='min(pzoom+0.002,2)':d=1:${POSITION_FORMULA}:s=${WIDTH}x${HEIGHT}[stream$((c+1))panning];"
I would be very grateful!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.