Posts:
4,190
Registered:
4-Aug-2006
|
|
|
Re: Images to movie with ffmpeg
Posted:
29 Jun 17, 13:51
in response to: karlmistelberger
|
|
|
Attached is an updated, renamed, version. On the Mac OS if I wrap the image directory in single quotes it fails, so I have set it to use quotes if the OS is Linux or Windows (which I can't test which is needed). Could someone try it on Windows and Linux to see if they both work now?
There is some problem with directory path. The new version tries to glob repeatedly album root, see attached log.
'/home/Albums/Sample Portfolio/*.jpg': No such file or directory
That is the error I was getting on my Mac when I tried to add the single quotes. Maybe I can just drop the OS test and leave out the quotes. Could you edit the .bsh file to test?
Change Boolean osQuote;
if(osName.indexOf("Mac") !=-1) {
osQuote = false;
}
else {
osQuote = true;
}
to Boolean osQuote;
osQuote = false;
}
|
|
|
Posts:
178
Registered:
5-Dec-2013
|
|
|
Re: Images to movie with ffmpeg
Posted:
29 Jun 17, 14:09
in response to: RobM
|
|
|
|
'/home/Albums/Sample Portfolio/*.jpg': No such file or directory
That is the error I was getting on my Mac when I tried to add the single quotes. Maybe I can just drop the OS test and leave out the quotes. Could you edit the .bsh file to test?
Made the changes and got some slideshow.mp4 in the album root only, see attachment.
|
|
|
Posts:
4,190
Registered:
4-Aug-2006
|
|
|
Re: Images to movie with ffmpeg
Posted:
29 Jun 17, 14:20
in response to: karlmistelberger
|
|
|
Made the changes and got some slideshow.mp4 in the album root only, see attachment.
Have you refreshed the views or looked in the actual image subfolders?
|
|
|
Posts:
178
Registered:
5-Dec-2013
|
|
|
Re: Images to movie with ffmpeg
Posted:
29 Jun 17, 14:26
in response to: RobM
|
|
|
Made the changes and got some slideshow.mp4 in the album root only, see attachment.
Have you refreshed the views or looked in the actual image subfolders?
I double checked:
karl@erlangen:~> find /home/Albums/Sample\ Portfolio/ -name '*mp4'
/home/Albums/Sample Portfolio/slideshow.mp4
karl@erlangen:~> grep jpg ffmpeg.txt
Input #0, image2, from '/home/Albums/Sample Portfolio/*.jpg':
Input #0, image2, from '/home/Albums/Sample Portfolio/*.jpg':
Input #0, image2, from '/home/Albums/Sample Portfolio/*.jpg':
Input #0, image2, from '/home/Albums/Sample Portfolio/*.jpg':
Input #0, image2, from '/home/Albums/Sample Portfolio/*.jpg':
karl@erlangen:~>
The script repeatedly works on the same directory.
|
|
|
Posts:
4,190
Registered:
4-Aug-2006
|
|
|
Re: Images to movie with ffmpeg
Posted:
29 Jun 17, 14:30
in response to: karlmistelberger
|
|
|
I double checked:
karl@erlangen:~> find /home/Albums/Sample\ Portfolio/ -name '*mp4'
/home/Albums/Sample Portfolio/slideshow.mp4
karl@erlangen:~> grep jpg ffmpeg.txt
Input #0, image2, from '/home/Albums/Sample Portfolio/*.jpg':
Input #0, image2, from '/home/Albums/Sample Portfolio/*.jpg':
Input #0, image2, from '/home/Albums/Sample Portfolio/*.jpg':
Input #0, image2, from '/home/Albums/Sample Portfolio/*.jpg':
Input #0, image2, from '/home/Albums/Sample Portfolio/*.jpg':
karl@erlangen:~>
The script repeatedly works on the same directory.
Weird, I will have another look later today and I'll strip out the superfluous code for different OS systems.
|
|
|
Posts:
4,190
Registered:
4-Aug-2006
|
|
|
Re: Images to movie with ffmpeg
Posted:
29 Jun 17, 14:41
in response to: RobM
|
|
|
|
Sorry, I have corrected the code, not sure though why it worked on my Mac before!
Fingers crossed 
|
|
|
Posts:
178
Registered:
5-Dec-2013
|
|
|
Posts:
4,190
Registered:
4-Aug-2006
|
|
|
Re: Images to movie with ffmpeg
Posted:
29 Jun 17, 16:14
in response to: karlmistelberger
|
|
|
Great, thanks for your help.
I will post the tool in the External tools & plugins forum shortly, I need to get together some screen grabs and instructions.
I might even add the function to my skins as an option.
|
|
|
Posts:
8,354
Registered:
31-Jan-2006
|
|
|
Re: Images to movie with ffmpeg
Posted:
29 Jun 17, 16:27
in response to: RobM
|
|
|
Nice, but what it really needs, IMO, is some image-to-image transitions.
|
|
|
Posts:
4,190
Registered:
4-Aug-2006
|
|
|
Re: Images to movie with ffmpeg
Posted:
29 Jun 17, 16:55
in response to: JeffTucker
|
|
|
Nice, but what it really needs, IMO, is some image-to-image transitions.
As you can see by the length of this thread, getting it to work at all was a minor miracle.
Image transitions seem a lot more complex and probably needs a ffmpeg experienced coder. Can I volunteer you 
|
|
|
Posts:
8,354
Registered:
31-Jan-2006
|
|
|
Re: Images to movie with ffmpeg
Posted:
29 Jun 17, 16:57
in response to: RobM
|
|
|
|
|
Posts:
178
Registered:
5-Dec-2013
|
|
|
Posts:
4,190
Registered:
4-Aug-2006
|
|
|
Re: Images to movie with ffmpeg
Posted:
29 Jun 17, 18:12
in response to: karlmistelberger
|
|
|
Failed at the first hurdle, although I gave it several attempts. "-vf", "framerate='fps=30':interp_start=64:interp_end=192:'scene=100'"
"-vf", "framerate=fps='30':interp_start=64:interp_end=192:scene='100'"
"-vf", "framerate=fps='30':interp_start='64':interp_end='192':scene='100'"
I think I'm well and truly stuck at this stage. I can update the code to offer effects if the effects themselves are translated from esoteric command line to nicely formatted Java process strings.
When I do post the tool in the other forum it will have an update not to process excluded folders and the 'res' folder. Also likely to add a GUI field for the name of the output movie, to cater for non-english slide show naming.
|
|
|
Posts:
178
Registered:
5-Dec-2013
|
|
|
Re: Images to movie with ffmpeg
Posted:
29 Jun 17, 20:19
in response to: RobM
|
|
|
Failed at the first hurdle, although I gave it several attempts. "-vf", "framerate='fps=30':interp_start=64:interp_end=192:'scene=100'"
"-vf", "framerate=fps='30':interp_start=64:interp_end=192:scene='100'"
"-vf", "framerate=fps='30':interp_start='64':interp_end='192':scene='100'"
I think I'm well and truly stuck at this stage. I can update the code to offer effects if the effects themselves are translated from esoteric command line to nicely formatted Java process strings.
Tried successfully in bash:
ffmpeg -y -v debug -framerate 0.25 -pattern_type glob -i "*.jpg" -vf framerate=fps=30:interp_start=64:interp_end=192:scene=100 -s 480x360 slideshow.mp4 2>ffmpeg.txt
-v debug gives useful information:
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-framerate' ... matched as AVOption 'framerate' with argument '0.25'.
Reading option '-pattern_type' ... matched as AVOption 'pattern_type' with argument 'glob'.
Reading option '-i' ... matched as input url with argument '*.jpg'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'framerate=fps=30:interp_start=64:interp_end=192:scene=100'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '480x360'.
Reading option 'slideshow.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url *.jpg.
Successfully parsed a group of options.
Opening an input file: *.jpg.
[image2 @ 0x55b76570c660] Opening 'p1150390.jpg' for reading
...
Thus my guess is: "-vf", "framerate=fps=30:interp_start=64:interp_end=192:scene=100"
I am no Java programmer. In case one of the above characters fails to show up in ffmpeg's debug output it needs escaping.
|
|
|
Posts:
4,190
Registered:
4-Aug-2006
|
|
|
Re: Images to movie with ffmpeg
Posted:
29 Jun 17, 21:13
in response to: karlmistelberger
|
|
|
Thus my guess is: "-vf", "framerate=fps=30:interp_start=64:interp_end=192:scene=100"
I am no Java programmer. In case one of the above characters fails to show up in ffmpeg's debug output it needs escaping.
Tried changing the end of the code to , "-vf", "framerate='fps=30':interp_start'=64':interp_end'=192':scene'=100'", "-y", "-shortest", videoOut, "-v", "32"
This makes the video but there are no images, 100% transparent maybe?
The console output is ffmpeg version N-80343-g645f7c1-tessus Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --as=yasm --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb
libavutil 55. 24.100 / 55. 24.100
libavcodec 57. 43.100 / 57. 43.100
libavformat 57. 37.101 / 57. 37.101
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 46.100 / 6. 46.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/robert/My Albums/Sample Portfolio/People/slideshow.m4a':
Metadata:
major_brand : M4A
minor_version : 0
compatible_brands: M4A mp42isom
creation_time : 2017-06-28 20:40:52
iTunSMPB : 00000000 00000840 000003E7 00000000001D7BD9 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Duration: 00:00:40.26, start: 0.044000, bitrate: 254 kb/s
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 252 kb/s (default)
Metadata:
creation_time : 2017-06-28 20:40:52
handler_name : Core Media Audio
Input #1, image2, from '/Users/robert/My Albums/Sample Portfolio/People/*.jpg':
Duration: 00:00:20.00, start: 0.000000, bitrate: N/A
Stream #1:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 900x693, 0.25 fps, 0.25 tbr, 0.25 tbn
[Parsed_framerate_0 @ 0x7fa769c0d640] time base:4/1 -> 1/30 exact:1
[Parsed_framerate_0 @ 0x7fa769c0d640] fps -> fps:30/1 scene score:100.000000 interpolate start:64 end:192
[swscaler @ 0x7fa76a053c00] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x7fa76a021000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7fa76a021000] profile High, level 5.0
[libx264 @ 0x7fa76a021000] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[mp4 @ 0x7fa76a003600] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Last message repeated 1 times
Output #0, mp4, to '/Users/robert/My Albums/Sample Portfolio/People/slide-show.mp4':
Metadata:
major_brand : M4A
minor_version : 0
compatible_brands: M4A mp42isom
iTunSMPB : 00000000 00000840 000003E7 00000000001D7BD9 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
encoder : Lavf57.37.101
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1920x1920, q=2-31, 30 fps, 15360 tbn
Metadata:
encoder : Lavc57.43.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2017-06-28 20:40:52
handler_name : Core Media Audio
encoder : Lavc57.43.100 aac
Stream mapping:
Stream #1:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Stream #0:0 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
Input stream #1:0 frame changed from size:900x693 fmt:yuvj420p to size:491x720 fmt:yuvj420p
[Parsed_framerate_0 @ 0x7fa769c0de40] time base:4/1 -> 1/30 exact:1
[Parsed_framerate_0 @ 0x7fa769c0de40] fps -> fps:30/1 scene score:100.000000 interpolate start:64 end:192
[swscaler @ 0x7fa76a053c00] deprecated pixel format used, make sure you did set range correctly
Input stream #1:0 frame changed from size:491x720 fmt:yuvj420p to size:900x677 fmt:yuvj420p
[Parsed_framerate_0 @ 0x7fa76b101900] time base:4/1 -> 1/30 exact:1
[Parsed_framerate_0 @ 0x7fa76b101900] fps -> fps:30/1 scene score:100.000000 interpolate start:64 end:192
[swscaler @ 0x7fa76a823a00] deprecated pixel format used, make sure you did set range correctly
Input stream #1:0 frame changed from size:900x677 fmt:yuvj420p to size:508x720 fmt:yuvj420p
[Parsed_framerate_0 @ 0x7fa769c0ca20] time base:4/1 -> 1/30 exact:1
[Parsed_framerate_0 @ 0x7fa769c0ca20] fps -> fps:30/1 scene score:100.000000 interpolate start:64 end:192
[swscaler @ 0x7fa76c000000] deprecated pixel format used, make sure you did set range correctly
Input stream #1:0 frame changed from size:508x720 fmt:yuvj420p to size:610x720 fmt:yuvj420p
[Parsed_framerate_0 @ 0x7fa76b0066a0] time base:4/1 -> 1/30 exact:1
[Parsed_framerate_0 @ 0x7fa76b0066a0] fps -> fps:30/1 scene score:100.000000 interpolate start:64 end:192
[swscaler @ 0x7fa76d801000] deprecated pixel format used, make sure you did set range correctly
frame= 1 fps=0.0 q=0.0 size= 10kB time=00:00:10.62 bitrate= 7.6kbits/s speed=21.2x
frame= 1 fps=0.0 q=29.0 Lsize= 329kB time=00:00:16.04 bitrate= 167.9kbits/s speed=21.7x
video:72kB audio:252kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.301902%
[libx264 @ 0x7fa76a021000] frame I:1 Avg QP:25.91 size: 73341
[libx264 @ 0x7fa76a021000] mb I I16..4: 13.1% 84.8% 2.1%
[libx264 @ 0x7fa76a021000] 8x8 transform intra:84.8%
[libx264 @ 0x7fa76a021000] coded y,uvDC,uvAC intra: 56.2% 27.7% 0.3%
[libx264 @ 0x7fa76a021000] i16 v,h,dc,p: 19% 25% 5% 51%
[libx264 @ 0x7fa76a021000] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 22% 15% 6% 8% 6% 9% 5% 8%
[libx264 @ 0x7fa76a021000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 24% 8% 5% 12% 7% 13% 4% 6%
[libx264 @ 0x7fa76a021000] i8c dc,h,v,p: 65% 17% 16% 2%
[libx264 @ 0x7fa76a021000] kb/s:17601.84
[aac @ 0x7fa76a816200] Qavg: 353.999
I still don't have a clue what to do next, except quit while I'm ahead 
|
|
|
|
Legend
|
|
Forum admins
|
|
Helpful Answer
|
|
Correct Answer
|
|