Monday, October 29, 2012

Commands for ffmpeg to speed up or slow down framerate

http://blog.grio.com/2012/01/fast-and-slow-motion-video-with-ffmpeg.html

That link points to the right and proper way to do speed ups and slow motion with ffmpeg.

I might actually go a little further and post another explanation of the command.

ffmpeg -i input.mp4 -vf “setpts=(1/X)*PTS” output.mp4

details:

ffmpeg        - calls ffmpeg program 
-i input.mp4  - file input name of the
-vf           - command required for the

"setpts=      - command sets the type.
(1/x)         - speeds up the  video
(x/1)         - slows down the video
*PTS"         - closes command.

output.mp4    - file name of output video


There are some refinements to this command, though. 


You can set the framerate stamped on the output video with 
-r   to stop ffmpeg dropping frames, with a bit of math. 

What good is all this without a few examples.

My GoPro Hero3 will output 240fps in WVGA mode. 

To convert that to 25fps slomo, I use the following command:
ffmpeg -i input.mp4 -r 25 -vf "setpts=(9.6/1)*PTS" output.mp4


That's maybe a little extreme... say you want to take some 960p footage down from 100fps to 25fps slowmo:


ffmpeg -i input.mp4 -r 25 -vf "setpts=(4/1)*PTS" output.mp4


Experiment with it a little. I already have two scripts to make conversion easy for the two commonly available GoPro Hero3 output framerates available in Europe. Americans might have to do a little more math to get a clean conversion with no frames dropped or duplicated, as far as slomo goes. 


For some reason I am unable to reply to comments. So, in response to the comment below:

Nope, forget completely about duration.
Old fps is 6, new fps is 24. 24/6 = 4, so you want your video to play 4 times as fast.

You would use something like this command:

ffmpeg -i input.mp4 -r 25 -vf "setpts=(1/4)*PTS" output.mp4

Good luck!
P.S. Sorry for the long time to reply. I had to figure out how....


Wednesday, September 26, 2012

Sorcerer Changes

Recently Kyle has been investigating ways of reducing disk I/O in Sorcery.

I have been testing his changes, and breaking my Sorcerer box often.

For those who don't know, Sorcerer is a Linux distribution.
What sets it apart from the other distro's out there is not that it's source-based. There are a few other distrobutions out there that downloads sources directly from the software author's released source code.

Sorcerer has the unique ability to create patches to source code on the fly, and updates to software that is already installed comes in the form of a really tiny sdelta file that is compressed with xz, and it updates the local tarball to the latest released version.

However, not even that is it's most distinguishing feature. It's most distinguishing feature is it's rapid evolution. Looking back at when Lunar Linux and SourceMage forked and Sorcerer changed it's license, a recent Sorcerer install only bears a slight resemblance.

We have started using cgroups and cpu.shares to finely control Sorcerer's impact on user experience while updating software. Init-scripts were changed almost beyond recognition, and while technically still a System V type init, it's much improved, and more dynamic.

Git support was built into the grimoire recently, and Sorcerer now supports pulling git updates directly from git repositories. There is still some kinks in the system, but it already works.

So, back to the latest disk I/O focus.
Kyle wrote a utility to limit disk I/O, but I have it uninstalled as I run my disks flat out for a long time, and don't want it limited. Different strokes for different folks, I guess. Anyways, we have moved the compilation location from /usr/src/sorcery to /var/cache/sorcery. Ccache implementation has been broken and fixed a few times, and right now we are working the last kinks out of the brand new "familiar" feature.

So...it's evolving, very quickly. Not many people like this type of fluidity, as weird things break all the time. Hence the Sorcerer community is tiny, and we don't do web updates all too often. Even documentation is neglected as whatever is written is out of date almost as soon as it was written. So, even though Sorcerer might appear dead to the world, it's actually quite active.

I learned more about Linux running Sorcery than any manual could ever teach.

Just to add a piccy, here is a recent screenshot of mine:























While this snapshot was taken on the 25th of September, and it's now only the 27th of September, it's out of date again, as the scry utility changed, and it's output now looks different. Which just underlines my point about the rapid evolution of Sorcerery. 

Sunday, July 15, 2012

Sand Storm...

There is this sand storm ravaging our home town of Walvis Bay, and with my house right on the edge of the desert, it's taking the full brunt of the storm. 


Isolde was sweeping up some of the sand today, as the wind does not start until midday, and mentioned that our house reminded her of Kolmanskuppe, a ghost town that we went to see on our tour of the South of Namibia in 2010. 

So, here are a couple from that town. 
:)


 







Our house does not look quite as bad, but only because we are very diligent in removing the sand when it blows in. 



Wednesday, June 20, 2012

Living Software...

Here is something that I noticed that I am sure will unnerve a few people.

With the sources-based Linux that I am using, I see updates all the time... Buttons shifting, colors changing. Dynamic. My desktop is almost never the same two days in a row. The most stable thing is my desktop background... it has not changed in more than a year!

I remember not too long ago that software felt like it was cast in stone. Windows 95 was just that... sure, you could move your icons around on the desktop, but generally the thing stayed the way it was made, and any update is a major disruption.

These days, I pull updates at least once a week, and I see small, incremental changes all over the place as developers fine-tune the applications that have taken their fancy.

I'm starting to wonder what the next constant is... What are all these people coding to? Why does my computer still feel useful, even though it's changing all the time? It's like there is a deeper intuition going on, and that everyone subtly share it, even without knowing.

Or is it simply that humans are basically all made the same way, and that the place a developer puts a new button is just where I would look for it? Maybe we are all getting a sense of a computer mind....


;)

Friday, June 8, 2012

My head in the clouds...

While I am at work I am not really allowed to photograph & share the tech that we use... However, we are at sea, and the clouds are as free as they ever were.

I spend quite a bit of time looking at them, and dreaming about being home.

 Here are some of the better cloud piccies:

What is that rainbow around the sun called?

The view from a 747 on my way to Frankfurt


Flying somewhere.....


These type of clouds always looks like the knights on a chessboard.

I like the contrast...

Sunset... .favorite time of the day!

There is a boat in this picture... it gives you a sense of scale.

More contrast!

I was looking for the green flash!

Wednesday, May 23, 2012

The past holiday, continued!

So, with the car fixed, we took an amazing drive to Betesda, 70km from Sossusvlei.
It was after the rains, so there was a lot of grass and greenery around. The drive up was amazing. Our Land Rover overheated once, and we had to stop for a little while to let her cool down.  This was the view from our stopping spot.
 There was quite a bit of wildlife standing around during our trip up, too.
 Some of the views along the way was just too amazing!
Isolde took most of the landscape photos, and they are amazing!










We finally arrived at our campsite. The campsite we had booked was taken, weirdly enough. Even more weird is that this is not the first time that Betesda messed up our bookings. However, the place is amazing enough to make of for it. In the end we all agreed that the campsite we eventually got was way better anyways:


 This was the view....

          This is what the campsite looked like when we finally had everything up:





Some more views of the campsite...













 

















One really nice campsite, huh? Anyways, the first day we just unpacked, and had a good nap. Aiden slept through for the first time on a camp on this night, too. He must have been really tired from exploring. The next day we just lazed around a little, and then we went to see the Hauchab fontein, and quiver tree forest.

The kids had a chance to nap in the car..

Aiden really enjoyed the fountain!


 We ran out of daylight before getting to the quiver tree forest, but we got this cool picture anyways:
 

 On the way back we stopped at the river crossing...




 Actually, we stopped about every five minutes!




 Aneske was along for this trip too, and she looks like she enjoyed it.







The next morning we kicked off early to go and see Sossusvlei.  

 It's 70km  from the campsite, and then there is another 70km of blacktop before getting to the vlei. The next time we will be camping inside the nature reserve!


Neverteless, there was plenty of pretty around... 
 Hmm.... it was lovely!
No matter where you point your camera, you get a nice picture. This place has to be visited to be believed!
 Finally we got to the dead valley itself. Does not look so dead now, after all the rains..
 Aiden wanted to crawl all the way, and was being a little pest about being carried.


Ah, water in the Sossus... this is truly rare, only for a few days per year, and not even every year....












It took us three hours to break camp the next morning, and the trip back was uneventful apart from the Land-Rover overheating almost constantly. Needless to say, I made some work of the cooling of the car later in my holiday...But for now, here are a few piccies of the trip back:


The rusty cars at the Solitaire petrol station are quite photogenic...
We stopped under the Kuiseb bridge for a breather. The Landy's one front brake de-laminated and I wanted to take it easy on the brakes. So, we decended the pass with a handbrake and in first gear. Isolde chewed up her fingers from stress, and a stop here was quite needed!













The rest of the holiday we chilled at home, doing some small odd jobs around the house. Eckie's Galenderwagen was also fixed, and we took the cars to the duns for some testing:

 The cars performed quite nicely, and we managed to get back home safely after following some route mapped out on my new GPS.
I picked up a crack on my windshield on the Sossus trip, so that will need replacement on my next holiday. So far I am quite proud of the Landy, even though she is quite thirsty!









Towards the end of the holiday, we managed to fit in a fishing trip. It was on mother's day, too..





 We dug a massive hole on the beach... It was freezingly cold, but this sort of thing has never stopped us.
It was nice to have Eckie and Helen along for this fishing trip...









 So.... finally, at the very end of the trip, I managed to get the Landy's cooling sorted, and we managed to make it all the way to the lighthouse... travelling an average of 40km/h over soft sand with the wind from behind....

We picked up a bit of driftwood and so on...

The last couple of days of my break was spent cleaning up the back yard. It took us quite a few loads to get rid of all the muck.

No before/after pictures, though. I guess there will be some in the video once I do finish that.