Code Monkey home page Code Monkey logo

ffmpeg-video-slideshow-scripts's Issues

Is there any way I can control the image quality of each frame in the result video?

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

How to change zoom scale

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

How to random transition to the slideshow?

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!

Invalid chars when running samples

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

Could we mix Zoom in & pan #1 for Image, and Zoom in & pan #2 for Video in one script

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:

  • I like the zoom in & pan of Zoom & Pan with Fade In/Out Transition # 1 for IMAGE, because we can see images move all the times in video
  • I like the zoom in of Zoom & Pan with Fade In/Out Transition # 2 for VIDEO, because if duration of video is long, video will NOT be zoomed in to much so can not see video clearly

When I compare code of 2 scripts, I see the different at here:

diff-one-vs-two

Could we mix like:

  • if Object if IMAGE, FULL_SCRIPT will call part of the zoom & pan in Script # 1
  • if Object if VIDEO, FULL_SCRIPT will call part of the zoom & pan in Script # 2

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.

Transitions with fewer images

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/1
1280':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

More image

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:

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

Video removes original sound

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

How Can I Replicate These Scripts in Python

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

Argument list too long for video-slideshow-script-generator

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:

  • Dump all the values for each duration explicitly into the filter
  • Generate the filter file, eg. cat MASSIVEFILTER > filter.txt
  • Refer to the filter file using filter_complex_script filter.txt
  • Delete the filter file afterwards

Background color does not change

How can we change background color to affect all images and translations in: advanced_push_box_horizontal.
For example, if I change background color to green, some black box is still there. It looks like in this gif:
optimize

Script crashes on large image input count

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)?

Borders on photos

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!

/script_1.sh: /bin/bash^M: bad interpreter: No such file or directory

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:

head-script1-Screenshot 2021-06-30 11 04 32

START_TIME=$SECONDS

VARIABLE DECLARATIONS

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.
SIMPLE-SCRIPT-Screenshot 2021-06-30 11 29 32

Would you please help. Thanks

How to add audio to script

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?

[Suggest] clock smooth

clock.sh

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)"

Test Result

Transparent mov with transparent png

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

Include original video audio in slideshow videos

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.

Concatenating video files are always throws an error

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

  • box*.sh
  • collapse*.sh
  • clock.sh
  • fade*.sh
  • rotate*.sh
  • push*.sh
  • wipe*.sh

Environment

  • Windows 10 64bit
  • 16 GB RAM
  • FFmpeg 4.3.1

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

Do not request new transitions

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.

Multiple Transitions in one video

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

dropped frame

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?

Pagination?

Is there any way to implement pagination for images?

such as this:
qq_pic_merged_1693120308553

Zoompan duration acording to duration slide

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.