Smoothing time-lapse videos with AviSynth - page 2 - Creative Uses of CHDK - CHDK Forum  

Smoothing time-lapse videos with AviSynth

  • 40 Replies
  • 24662 Views
*

Offline Paco

  • **
  • 77
Re: Smoothing time-lapse videos with AviSynth
« Reply #10 on: 25 / November / 2013, 14:54:52 »
Advertisements
Well, I tried ConvertFPS with a 1920x1080 H264 video and AviSource gives error "The source image format is not acceptable".
I tried resizing to 1280x720 but same problem.
Try using DirectShowSource. I'm pretty sure that AviSource only opens AVI files. Also, be sure to heed this warning when using ConvertFPS:
Quote
In Blend Mode, new_rate must be at least 2/3 (66.7%) of the source frame rate, or an error will occur.
You're trying to get 25% of the source frame rate so maybe you can specify an fps of 36% of the original frame rate in DirectShowSource and go for 70% of this with ConvertFPS to get 25%. You could also specify 25% in DirectShowSource and use FRC with a factor of 4 to get back the original frame rate with smoothing. I suspect that this will look better but try both and compare.

Quote
I suspect you edited a previous post because I thought you referred to seamless panning of multiple images.

Did you have 'second thoughts' ?

If so, how would you do it ?

The images can have overlapping areas if necessary.


David
Yes, I though about it and I tried concatenating clips but it can't work because you end up with separate frames that way. The only way I can think of doing this is by using the original large image, but I'm not sure of the size limitations of ImageSource. Or you could concatenate separate images being careful to deal with the overlaps, but again, not sure about size restraints. You could first resize the large image to the final height, maintaining the same aspect ratio. The best way to do it would be to insure that each sequential image contains the last frame of the previous image. Then you can make separate panned videos and concatenate them at the end. You'd have to advance the Crop window by one frame at the beginning of successive images.

Re: Smoothing time-lapse videos with AviSynth
« Reply #11 on: 25 / November / 2013, 16:28:34 »
I'm pretty sure that AviSource only opens AVI files.

It is an AVI file.

I will respond to other issues later or tomorrow, as I am trying to get my old microcontroller programmer to work and I did not document how it works.


*

Offline Paco

  • **
  • 77
Re: Smoothing time-lapse videos with AviSynth
« Reply #12 on: 26 / November / 2013, 10:50:33 »
I'm pretty sure that AviSource only opens AVI files.

It is an AVI file.

I will respond to other issues later or tomorrow, as I am trying to get my old microcontroller programmer to work and I did not document how it works.

Post the MediaInfo data on this file. Not all AVI is created equal. Still try using DirectShowSource. It opens almost anything. See:

Just starting to learn Avisynth, can't open mjpeg avi and others.

using the DirectShowSource plugin.
« Last Edit: 26 / November / 2013, 10:52:41 by Paco »

Re: Smoothing time-lapse videos with AviSynth
« Reply #13 on: 26 / November / 2013, 11:03:38 »
Good timing, I have just been playing with this.
I gave-up on AVISource() but will check-out the links shortly.

Instead, I used QTSource() to load the original mov file.

ConvertFPS did not appear to do anything although no warning messages displayed.

I am now trying to find-out why.

The 1920x1080 mov movie is rgb colour space if that makes any difference.


Re: Smoothing time-lapse videos with AviSynth
« Reply #14 on: 26 / November / 2013, 11:18:49 »
Code: [Select]
General
Complete name                            : K:\SX50hs_2D_Movies\digizoom.avi
Format                                   : AVI
Format/Info                              : Audio Video Interleave
File size                                : 110 MiB
Duration                                 : 2mn 36s
Overall bit rate                         : 5 880 Kbps
Writing library                          : VirtualDub build 32842/release

Video
ID                                       : 0
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High AT L4.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 2 frames
Codec ID                                 : H264
Duration                                 : 2mn 36s
Bit rate                                 : 6 000 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.121
Stream size                              : 110 MiB (100%)
Writing library                          : x264 core 811758668May 22 2010
Encoding settings                        : cabac=1 / ref=1 / deblock=0:0:0 / analyse=0x3:0x113 / me=hex / subme=5 / psy=1 / psy_rd=0.0:0.0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / threads=1 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=1 / wpredb=1 / keyint=250 / keyint_min=1 / scenecut=40 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=6000 / ratetol=1.0 / qcomp=0.50 / qpmin=2 / qpmax=31 / qpstep=4 / ip_ratio=1.40 / aq=1:0.30

*

Offline Paco

  • **
  • 77
Re: Smoothing time-lapse videos with AviSynth
« Reply #15 on: 26 / November / 2013, 11:28:32 »
Good timing, I have just been playing with this.
I gave-up on AVISource() but will check-out the links shortly.

Instead, I used QTSource() to load the original mov file.

ConvertFPS did not appear to do anything although no warning messages displayed.

I am now trying to find-out why.

The 1920x1080 mov movie is rgb colour space if that makes any difference.

I thought you said it was an AVI. Also, DirectShowSource should open MOV files. It is fairly universal. Post your code so I can see what you're trying. Try AssumeFPS. That may be all you need.

*

Offline Paco

  • **
  • 77
Re: Smoothing time-lapse videos with AviSynth
« Reply #16 on: 26 / November / 2013, 11:34:31 »
Code: [Select]
Format                                   : AVI
Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High AT L4.0

It is AVC High profile. That's probably the problem. That is probably too advanced for this old filter. In any case DirectShowSource should work.

*

Offline Paco

  • **
  • 77
Re: Smoothing time-lapse videos with AviSynth
« Reply #17 on: 26 / November / 2013, 17:05:41 »
OK, I tried doing a smooth zoom at 25% fps from a crappy YouTube video (it's the best I could find to demonstrate). Much to my consternation, I could not open it with DirectShowSource. I couldn't open it with QTSource either. It is an MP4 and has similar specs to your file:

Code: [Select]
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 11.3 MiB
Duration : 29s 790ms
Overall bit rate mode : Variable
Overall bit rate : 3 195 Kbps

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 1 frame
Format settings, GOP : M=1, N=60
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 29s 778ms
Bit rate : 3 001 Kbps
Maximum bit rate : 4 939 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 fps
Color space : YUV

I found a very useful plugin for MPEG-2 and -4, MpegAutoIndex, that worked. Note that  VirusTotal found 5/45 possible malware results in MpegAutoIndex.zip but they look like typical false positives. They are all from minor virus scanners, two of which almost ALWAYS show false positives.

Here's the script I used:

Code: [Select]
v = MpegAutoIndexSource("HD video by Canon SX50 camera - 50x zoom example 1.mp4")
fps = v.FrameRate()
v = v.Trim(50, 200).AssumeFPS(fps/4)
v = v.ConvertToYV12().AutoCrop(0, wMultOf=16, hMultOf=16).MSU_FRC(4, "fast")

return v

This worked beautifully. Here is a comparison of the video at 100%, 25% using just AssumeFPS, and 25% using AssumeFPS with FRC:

zoom StackHorizontal 3

As always, it is much better to download this and view it properly on a real standalone player.

I tried using ConvertFPS but it was harder to use and the quality was horrible.



Re: Smoothing time-lapse videos with AviSynth
« Reply #18 on: 26 / November / 2013, 17:25:01 »
Yes, that works well.
Have not tried FRC yet.
How do I apply it to the beginning and end of the movie and not the middle ?

Maybe that is VDub's 'Mask' feature, I will check.



« Last Edit: 26 / November / 2013, 18:38:20 by Microfunguy »

*

Offline Paco

  • **
  • 77
Re: Smoothing time-lapse videos with AviSynth
« Reply #19 on: 26 / November / 2013, 18:16:52 »
Yes, that works well.
Have not tried FRC yet.
How do I apply it to the beginning and end of the movie and not the middle ?

Maybe that is VDub's 'Mask' feature, I will check.

I'm not sure what you mean. You mean FRC or AssumeFPS or both?

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal