RIP McCabe's
Jason Paul wanted us to know that there was a sad sign posted on McCabe's this week:
Jason Paul wanted us to know that there was a sad sign posted on McCabe's this week:
Intrepid KWLUG members have diligently searched for a new physical home for our group. Thus far we have two candidates that are likely available.
This is a community meeting room on the third floor of a condo. A KWLUG member lives in the building and has agreed to host us each month.
The building is a 5-10 minute walk from Victoria and King in Kitchener, so is close to downtown.
Capacity: 15 people comfortably, 20 at most. The space is pretty small and there is furniture there we cannot move.
Availability: There is no formal booking system, so there is some chance we could be displaced. However, the host thinks this is not likely.
Reliability: We are reliant on the host to be present for every meeting.
Access: The building is wheelchair accessible. To get to the meeting room one has to be let in the door (there is controlled access) and go up an elevator. It is not clear whether we can put up signs on meeting nights, but the host thinks it may be possible.
Washrooms: There is a washroom right beside the meeting room.
Internet: There is public wifi, and possibly a second wifi we can use for streaming. There is no wired internet available.
Parking: The City of Kitchener operates a parking lot on Bramm Street, which is free after 5pm.This is directly behind the condo complex. There is an underground parking garage at the condo which costs $2.50 for 30 minutes, so the average KWLUG attendee can expect to pay $12.50 per meeting. There is also a small amount of on-street parking on Oak Street.
Transit: there is an LRT station at Victoria and King St.
Streaming/Equipment: We would have to provide a projector, and whatever equipment we want to use for streaming. The host may be able to store some equipment at their condo, but maybe not a lot.
COVID Safety: The room is small. There will not be much interaction with non-KWLUG members. HVAC status is unknown.
This is a classroom space in the Dana Porter library ("the sugar cube") at the University of Waterloo. The specific space is LIB 329. It is being offered by a KWLUG member who works at the university.
Capacity: 25 people. It is a full classroom with row seating.
Availability: It should be fairly reliably available, although there is no booking system. There is another classroom we might be able to use if we are displaced.
Reliability: Unclear. We are reliant on a UW employee, faculty member, or student club to host us. The proposing host has offered to host us, or help look for replacements if they are unable to attend. There are a few other people who work at UW.
Access: The building is wheelchair accessible. There are elevators to the space. We will probably not be able to put up signs. There is a clickable floor plan of the library's third floor to help people find their way around.
Washrooms: There is a washroom on the same floor.
Internet: There is wifi available that requires a name and email to use. People who are affiliated with a university can use Eduroam. There may be some chance of getting our own SSID but this is unlikely. Wired network for streaming might be possible, but is not arranged.
Parking: There is one parking lot -- Lot E, adjacent to the Waterloo-Laurier LRT station at Seagram Drive -- that is free after 6pm. This is about a 700m walk from the library. There are paid parking lots for $5/evening. Lots D and A are the closest to the library.
Transit: there is an LRT station at the university.
Streaming/Equipment: There is a projector with HDMI input. We would have to provide other streaming equipment, and carry it back and forth to meetings.
COVID Safety: The University of Waterloo is a busy campus, so there will be some interaction with students. As of this writing, the university is committed to MERV-13 filters with at least four air exchanges per hour per classroom.
This is not available Monday evenings. It could be a possibility if we were willing to switch meeting nights.
This is a new space. The booking fee for the large room is $400/hour. There is a smaller room for less, but they currently do not do evening bookings.
These may be available but not reliability. Prices vary from $50 at some remote libraries in Kitchener (eg Forest Heights), to $150 for two hours at the Waterloo Public Library.
In addition to a booking fee we would need to purchase liability insurance. This may be possible but it seemed frustrating the last time we looked because we are not a registered organization.
The space is inaccessible (on the second floor) and there are no large meeting spaces (maybe 15 people at most?). A KWartzlab member would have to host.
Neither the Queen St Commons building nor St Johnâs Kitchen is available. The front space at 58 Queen may be available, but it is small and not that accessible.
This would likely be expensive, but may be worth investigating.
These are likely not reliable, and there would be an expectation that people purchase food and drink.
The City of Waterloo publishes a list here: https://www.waterloo.ca/en/neighbourhoods/gathering-spaces.aspx
Here are some topics members have requested over the years. Can you present on one or more of them? If so get in touch. You may also request a topic, but please do this on the kwlug-disc mailing list, or during a meeting.
Newer requests are at the top of the list.
Paul Nijjar
2019-07-08
Kitchener-Waterloo Linux User Group
Why bother with terminal programs in 2019?
Maybe your computer is too slow for the modern internet
Maybe you have a tiling window manager
Maybe you want to get work done in an SSH window (with no X-forwarding)
Maybe you hate notifications
Maybe you are a dinosaur
(Mikalai) Maybe you are working inside containers
Give you nouns to search for, as opposed to keystrokes
What are the quirks?
Me: maybe get suggestions for other useful tools
I run old old Debian
I am not a computer genius
I am not a life hacker/optimizer
These are the programs I actually use, not always the ones I ought to use
Muscle memory is a walled garden
I did not bother preparing more slides!
What now?
Let's improvise!
Addendum to Khalid's Microcontrollers and the Internet of Things (IOT) presentation (October 1, 2018).
With this blog entry, I thought I would provide some comments as an addendum to Khalid's presentation.
Please note that these comments are purposely limited in scope. Interested parties are free to contact me and, of course, consult with The Google.
I will start with memory which can be basically classified into two groups, non-volatile memory and volatile memory.
The definitions of non-volatile memory and volatile memory are as follows.
Simply put non-volatile memory retains its data when power is removed.
And volatile memory, usually called RAM, does not retain its data when power is removed.
The non-volatile memory used for program storage these days is Flash memory.
Modern microcontrollers and microprocessors typically do not use EEPROM for program storage.
Modern microcontrollers and microprocessors may or may not use EEPROM and / or EAROM for non-volatile storage of parameters and/or data.
And from the above, now we have some definitions that are needed.
Simply described, Flash, EEPROM and EAROM are different semiconductor technologies that are used to implement non-volatile memory.
I will skip their predecessors PROM and EPROM.
I will also skip the expansion of the acronyms RAM, PROM, EPROM, EEPROM and EAROM. Flash is not an acronym.
Aside: Flash memory technology is also used in USB Flash Memory sticks, hence, the name.
OK!. Now we have the terms microcontroller and microprocessor.
A Microprocessor is a complete processing device made from a small chunk of semiconductor and housed in one package, e.g. Dual In-Line Package (DIP) or Quad Flat Pack (QFP) or other.
Microcontrollers are basically microprocessors (see below) with integrated peripheral devices such as UART, ADC, DAC, SPI, I2C, PWM, etc.
I will skip the expansion of the acronyms UART, ADC, DAC, SPI, I2C, and PWM. I will also skip the explanations of the devices associated with these terms.
The first semiconductor processing device to come along, circa 1970, was the microprocessor, simply described as a small scale processing device without integrated peripherals (see above).
Systems designed around a microprocessor that required one or more peripherals typically implemented this requirement with external devices.
Pentium processors are microprocessors. As are AMD processors. As are the 8080, 8085, 8086, 8088, 80286, 80386 and 80486 predecessors.
Most of the processors used in most cell phones, tablets, notebooks, laptops, etc. are microprocessors, even if these processors may include a small degree of peripheral integration.
Variants of ARM processors may or may not be microcontrollers as the ARM architecture was designed to support a considerable amount of peripheral integration.
Variants of ARM processors may be classified as microprocessors or microcontrollers depending on the degree of peripheral integration.
Last in this blog entry I will describe the GPIO or General Purpose Input Output port.
The GPIO is typically a one bit wide port or physical pin that and be programmed as either a digital (binary) input or output.
As an input the GPIO, when read will return a 0 when the voltage on the pin is Low or near 0 Volts DC, and will return a 1 when the voltage on the pin is High or near 5 DC Volts or 3.3 Volts DC with some devices.
As an output the GPIO, when written with a 0, will output a Low or 0 Volts, and when written with a 1, will output a Low or 5 Volts DC or 3.3 Volts DC with some devices.
Note: GPIO circuitry can be damaged if the voltage applied to the pin exceeds specified limits; same for the current drawn by or sourced from the pin.
Caution: Do not let the smoke out.
There are (and have been) many microprocessors to choose from and study.
There are (and have been) many microcontrollers to choose from and study.
As always, there are exceptions. And opinions which may differ.
- 30 -
JohnJ
This blog entry collects possible new homes for KWLUG meetings. If you have some options to add, use the contact link to submit them.
We went through this exercise when the Heuther Hotel got mad at us. There was a relevant discussion thread on kwlug-disc.
We went through this exercise again in 2019. Here is the discussion thread on kwlug-disc.
There is a site called SpaceFinder Waterloo which lists a bunch of rental spaces. Most of them cost money, however.
These locations have been suggested but nobody has offered to follow up on them yet. If you would like to help then please volunteer to look into one or more of them.
Adam Glauser says that he can likely arrange gratis meeting rooms at Laurier
(formerly Thalmic Labs)
As of January 2019, North is not available, but Tim Laurence says that it is possible the space will become available within a few months.
Formerly SweetTooth
(Eric Gerlach or Darcy Casselman might be contacts here.)
Jason Eckert is a contact here. WWITPro uses this space.
The space is at Frederick and King. TriOS is willing to let us use the space for no charge.
Parking is available in the parking lot. Free parking is questionable.
We met here for 6 months. It is the old Boehmer Box building.
Somebody has started to look into these locations, and they have not been ruled out yet. Often there are details that are missing about them; please fill in details if you can.
Brian Bentley is the contact here, via the Bits and Bytes Computer Club.
This would be at the Tannery building.
This is at the Zehrs Laurentian, 750 Ottawa Street South.
The KW-RASC group uses this meeting space.
This is a meeting room the floor above the Queen Street Commons.
Here is a map. The address is 26 William Street West, at the corner of King and William in Waterloo.
The website is http://www.firstunitedchurch.ca.
This is at 119 King Street W
Here are a few notes for those who wish to log into the website.
You do not need a website login to access most (all?) content. You want a login if:
To get access to the website, talk to one of the meeting organizers or website admins at a meeting or via e-mail. Not everybody gets website access.
To log in, use the Drupal login link at https://kwlug.org/user .
To add content, use the "Shortcuts" link you see when you log in. There should be a shortcut to "Add content".
To log out, click on your username in the top bar, and click "Log out".
Be sure to use the correct "Page Category" setting when creating content. For some content types (agendas, podcasts) this is filled for you. For others you need to set the category explicitly (vidcasts, blog posts).
If you do not like the WYSIWYG editor you can change the text format from "Basic HTML" to "Restricted HTML".
KWLUG is switching web hosts on Tuesday, March 14. This site will be unavailable for most of Tuesday afternoon. The mailing lists will also be unavailable during the migration.
We expect that the new, redesigned website will be up and running by Wednesday morning. The canonical status page is http://pnijjar.freeshell.org/2017/kwlug-migration-status/. Check that page if you are wondering why things are taking so long.
We may also try to publish updates to Twitter and the Fediverse, but we cannot guarantee this.
Once the migration is complete old RSS feeds should work, but there may be a bunch of duplicated entries in your feeds. Unfortunately iCal feeds will break.
There is a testing version of the new KWLUG website available at https://d8.kwlug.org . Please explore the new website and report issues using the Contact Us page.
I just know people will be asking for these links during the WatCamp Calendar presentation...
Main WatCamp site: http://watcamp.com/
The Calendar: http://watcamp.com/calendar
The HTML-only Calendar: https://calendar.google.com/calendar/htmlembed?src=nlkc39jt4p0nbc4pk9pj7p5fh0@group.calendar.google.com&ctz=America/New_York&wkst=1
(added Monday, 12 Sept 2016) WatCamp's GitHub page: https://github.com/spaetzel/ical2json
--Bob.
Hi all: I've completed my presentation notes; if you have any questions, confusions, clarifications or requests for additional stuff let me know by about 3:00pm on Monday.
See you all Monday night! Bring your laptops, phones, and other web-enabled devices so you can join in the demonstration.
--Bob.
bjonkman@sobac.com
Continuing Adventures with Ubuntu and Apache.
In a previous blog post "Installing LAMP on Ubuntu 11.04 aka The Natty Narwhal" I documented my start with Ubuntu and the Apache webserver suite.
see: http://kwlug.org/node/824
This blog post was updated a few times as the installation was updated.
Recently, I went through another update exercise and instead of updating the previous blog post, I elected to make another blog post.
I am sure that this is "old hat" to many on this list.
But this work is not "old hat" to me.
And I would suspect that I am not alone in this.
As I recall, the previous updates to Ubuntu and especially to Apache were not trouble free.
I had been running Ubuntu 12.04 LTS since the last update in 20140525 or so.
(My bad: The other blog post does not explicitly say when 12.04 LTS was up and running.)
For some time I had been seeing Ubuntu notices that 14.04 was available. And when I tried to execute the update I saw an error message informing me that the Apache webserver was interfering with the update process. Fearing having a broken system I deferred the update for a while.
A few days ago, I bit the bullet and decided to update both Ubuntu and Apache starting with Ubuntu.
To update Ubuntu and according to various bits of advice on stackoverflow, askubuntu, apachefriends and elsewhere I needed to disable the Apache webserver.
ref: sudo service apache2 stop
ref: sudo update-rc.d apache2 disable
After a few runs at the update exercise the update from Ubuntu 12.04 LTS to 14.04 LTS was successful. The reasons why a few runs at the update exercise and details of which now elude me.
It may be needless to say that the the update to 14.04 LTS was not smooth as it could be.
But compared to the exercise in updating Apache the Ubuntu update was a whole lot smoother.
Restarting the Apache webserver was successful.
ref: sudo update-rc.d apache2 enable
ref: sudo service apache2 start
Continuing with the Apache update is where I ran into some real troubles.
Recalling that I had troubles with Apache updates over the past few years I saved a copy of /etc/apache2 in /usr (i.e. outside of /etc).
Again referring to the usual reference websites (see above) I executed apt-get.
ref: sudo apt-get install apache2
And, as I feared, I wound up with a broken system.
Apache simply would not start and, at times, would return error messages like:
The following packages have unmet dependencies: [ edit ]
Unable to correct problems, you have held broken packages.
The error messages referred to problems with the installation of php5.
Using our old sage, The Google, I looked for advice.
Somewhere there was a suggestion to use aptitude instead of apt-get.
No luck.
After attempting some repairs I trashed the broken /etc/apache2 installation.
And attempted to attempted a fresh install, again using apt-get.
And, in another run at this, using aptitude.
Result: "you have held broken packages" and again with references to php5.
I attempted to restore /etc/apache2 from a git repo created and maintained by etckeeper.
(Ref: discussions re: etckeeper in the KWLUG email list. And thanks to all who contributed.)
Result: "you have held broken packages" and again with references to php5.
Evidently, the issues with php5 are outside of /etc/apache2
I was not having much success with these repairs and looked again to The Google.
And I came across an entry about ppa repositories and how these can interfere with apt-get and aptitude.
ref: http://askubuntu.com/questions/540423/libapache2-mod-php5-depends-php5-…
After running through the advice given near the end of this askubuntu post it looked like the issues with php5 were solved.
And after I restarting the Apache webserver (an important step) the Apache webserver was running without errors.
Testing with /var/www/test.php containing <?php phpinfo(); ?> and executing FF: //http:/localhost/test.php.
The Apache phpinfo page is displayed.
Success.
My Linux PC is now running Ubuntu 14.04 LTS.
And Apache 2.4.7 is running - with php5
Notes:
The apache2.conf file in the new install of /etc/apache2 does not have any of the local configurations that were in the configuration file prior to the update.
TODO: Restore the apache2.conf file as required from either the saved copy of the old /etc/apache2 or from the git repo created and maintained by etckeeper.
From a tip as seen on askubuntu re: fqdn below:
"It's a personal preference that keeps my configuration changes separated from the distribution package. So updates are less complicated."
Ref:
sudo update-rc.d apache2 < enable : disable >
sudo service apache2 < start | stop | restart >
Re: errors with servers-fully-qualified-domain-name
see: http://askubuntu.com/questions/256013/could-not-reliably-determine-the-…
service apache2 restart
Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
Ubuntu 14.04:
echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/fqdn.conf
sudo a2enconf fqdn
Re: etckeeper
From the KWLUG list:
http://joey.kitenet.net/code/etckeeper/
On 2010-02-26 13:08, Andrew Cant wrote (re: etckeeper)
> So I have not see any big benefits yet, but it requires little effort
> to maintain, and having the history of my changes makes me happy.
This is a dummy post to upload the Software Freedom Day poster.
Tim Laurence's presentation on LDAP was both well-received and well-documented.
Here are the slides of the talk in ODP format.
Here is a tarball containing the slides above, and configuration snippets from his presentation.
Here is some video of the presentation, split up into several (overlapping?) parts: Part 1?, Part 2?, Part 3?.
As a single guy (AKA geek) just out of school, I tried to keep up on all the cool and upcoming tech. Over the past 15 years, I got married, had a kid, had several different roles at work and pursued a few different hobbies which steered me away from a lot of the fun I used to have with technology. I kept up enough to be proficient at work and to be the go-to tech guy of friends and family but I didn't have the drive or time to experiment as much.
The Raspberry Pi has piqued my interest again in some experimentation. It's an affordable way to mess around with a cool piece of technology and teach others about programming, hardware and open source software. I noticed the next meeting will be discussing the Pi so I won't go into it too much - attend the meeting to find out more. I may see you there if I get off work early enough.
Sometimes, you want to edit multiple videos in a similar way. For that, I've found that the best way is to create a script that you can run consistently on those videos and get a consistent ouptut. For example, recordings from a conference or a day by day video log of your family vacation.
I have created some scripts using ffmpeg and ImageMagick for my some of my videos, saving me hours in the process.
The main advantages I've found are:
In this posts I will show some of the commands I've found most useful, these are very basic commands that can be improved by people more creative than me.
For this example I will use a script I created to edit my Toastmasters videos. You can find the full script attached to this post along with an explanation of each one of the components of the script
To test the script, just extract the attached sample file and execute the following command
./VideoEdit.sh sample.prm
This script does the following:
It receives as parameters a file that contains the actual editing parameters:
Here is an example of my parameters file:
INPUTFILE="/media/cdrom0/VIDEO_TS/VTS_01_1.VOB"
LOGO="../TM-titleLogo.png"
LOGOLENGHT="5"
SPEAKER="Raul Suarez"
TITLE="The dreaded empty page"
DATE="July 28, 2011"
SCENESTART="00:06:58"
SCENEDURATION="00:07:20"
OUTPUTFILE="TM2"
Extract Video:
Extracts a portion of video from the input file converting the video to frame files one PNG file per frame and splitting the audio to to an mp3 file
mkdir -p "${OUTPUTFILE}-frames"
ffmpeg -loglevel quiet -threads 4 \
-i ${INPUTFILE} -ss ${SCENESTART} -t ${SCENEDURATION} \
-f image2 -y "${OUTPUTFILE}-frames"/frame%d.png \
-acodec copy -sameq -y "${OUTPUTFILE}.mp3"
-loglevel : defines how verbose I want the console output
-threads : If allows using multiple cores in a multicore processor. Can speed up some tasks
-i : The name of the input file
-ss : Indicates when does the segment of video we want start
-t : Indicates the duration of the segment of video we want
-f : Format of the output. In this case the format is image as we are extracting to one frame per file
-y : Overwrites files without asking
"${OUTPUTFILE}-frames"/frame%d.png : This part of the command tells ffmpeg to extract each frame to a file named frame1.png, frame2.png, etc
-acodec copy : extract the audio without re-encoding
-sameq : do not loose quality (may not be necessary here but I left it just in case)
"${OUTPUTFILE}.mp3" : is the name of the audio file we are saving
I could have done this with three commands, which is more readable, but takes more time
# Extract the video
ffmpeg -i ${INPUTFILE} -ss ${SCENESTART} -t ${SCENEDURATION} \
-acodec copy -vcodec copy -sameq -y "${OUTPUTFILE}-1.mpg"
# Split the audio to preserve it
ffmpeg -i "${OUTPUTFILE}-1.mpg" -acodec copy -sameq -y "${OUTPUTFILE}.mp3"
# Convert the video to frame files one PNG file per frame
mkdir -p frames
ffmpeg -i "${OUTPUTFILE}-1.mpg" -f image2 -y frames/frame%d.png
Create Introduction
Uses the ImageMagick convert command to create the introduction image by merging the logo file with the titles for the video
convert ${LOGO} -gravity Center -font DejaVu-Sans-Book \
-pointsize 20 -fill gray -draw "text 1,21 'Talk of the Town Toastmasters'" \
-fill white -draw "text 0,20 'Talk of the Town Toastmasters'" \
-pointsize 50 -fill gray -draw "text 2,72 '${SPEAKER}'" \
-fill white -draw "text 0,70 '${SPEAKER}'" \
-pointsize 30 -fill gray -draw "text 1,131 '${TITLE}'" \
-fill white -draw "text 0,130 '${TITLE}'" \
-pointsize 20 -fill gray -draw "text 1,171 '${DATE}'" \
-fill white -draw "text 0,170 '${DATE}'" \
"${OUTPUTFILE}-intro.png"
ImageMagick can, in a single instruction add multiple lines of text. It has different ways of doing this. For this example I used the "draw" command. To see other methods you can go to http://www.imagemagick.org/Usage/text/
This command gets the ${LOGO} file and overlays the text on top of it.
As you can see in this example, I have two "draw" commands for each line, I do this to create a "gray shadow" effect on the text.
The resulting image will be saved as "${OUTPUTFILE}-intro.png"
Create video from an image adding a silent sound track
ffmpeg -loglevel quiet -threads 4 \
-loop_input -i "${OUTPUTFILE}-intro.png" -qscale 1 -r 29.97 -t ${LOGOLENGHT} \
-ar 48000 -t ${LOGOLENGHT} -f s16le -acodec pcm_s16le -i /dev/zero -ab 64K -f mp2 -acodec mp2 \
-map 0.0 -map 1.0 -sameq -f mpegts -y "${OUTPUTFILE}-intro.mpg"
The first section of the command defines the video portion of the file
-loop_input will loop over the following file to create the output
-r : The output video will be 29.97 frames per second. This is the framerate for NTSC
The second portion defines the audio portion of the file: The silence. It is important to add a sound track or we will have problems concatenating at the end.
-ar : audio sampling frequency of the audio
-f : format, Note how when the format and codec are before -i, they refer to the input format, if they are after, they refer to the ouptut format.
-acodec : Audio codec
-i /dev/zero : This is where we take the "silence". Of course, if you want a real audio file you can use it here.
-ab : Audio bitrate
Finally we assemble the input video and audio into the ouput file
-map : These map parameters say: take the first channel of the first input (video) and the first channel of the second input (audio)
(I've explained the rest of the parameters in previous commands)
This is equivalent to the following three commands
# create proper lenght of silence
ffmpeg -ar 48000 -t ${LOGOLENGHT} -f s16le -acodec pcm_s16le -i /dev/zero -ab 64K -f mp2 -acodec ac3 -y silence.mp2
# Create still logo video
ffmpeg -loop_input -i "${OUTPUTFILE}-Logo.png" -qscale 1 -r 29.97 -t ${LOGOLENGHT} -y -f mpegts "${OUTPUTFILE}-logo1.mpg"
# Assemble still logo and silence
ffmpeg -loglevel error -i "${OUTPUTFILE}-logo1.mpg" -i "silence.mp2" \
-vcodec copy -acodec copy -map 0.0 -map 1.0 -sameq -threads 4 \
-y -f mpegts "${OUTPUTFILE}-intro.mpg"
The exit video is created in a similar way
FadeOut introduction
You may be wondering why we extracted all the frames to PNG files. The main reason is that it allows us to manipulate them however we want using ImageMagick. We can rotate them, mix, change colors, add overlays. Your imagination is the limit.
In this case I am disolving the intro image progressivelly into the corresponding input video frames.
mkdir -p "${OUTPUTFILE}-frames2"
for i in {1..90}; do
percent=$(echo "scale=3; ${i}*100/90" | bc )
convert -compose dissolve -gravity center -define compose:args=${percent} \
-composite "${OUTPUTFILE}-intro.png" "${OUTPUTFILE}-frames"/frame${i}.png "${OUTPUTFILE}-frames2"/frame${i}.png
done
for i in {1..90} : The loop will operate in the first 90 frames (3 seconds at 29.97 frames per second ~ 90 )
percent=$(echo "scale=3; ${i}*100/90" | bc ) : calculates the percentage we want to use to disolve. From 0 to 100% in 90 steps
The convert command disolves the "intro" image into each of the frames applying the corresponding disolve percentage.
Each of the resulting frames is written to another temporary folder.
Overlay an image
If you want to overlay an image on a section of video, you need to calculate the starting and ending frames so you can loop through those images doing the overlay:
I created a function to do the overlay, so I can overlay different images at different points in the video:
overlayImage () {
# Overlays an image on top of each frame in a range.
FILE="${1}"
GRAVITY=$2
START_FRAME=$(echo "scale=0; ${3}*29.97/1" | bc )
END_FRAME=$(echo "scale=0; ${4}*29.97/1" | bc )
for (( i=${START_FRAME} ; i<=${END_FRAME} ; i++ )) ; do
convert -compose dissolve -gravity ${GRAVITY} -define compose:args=90 \
-composite "${OUTPUTFILE}-frames"/frame${i}.png "${FILE}" "${OUTPUTFILE}-frames2"/frame${i}.png
done
}
The overlayImage function receives as parameters
The loop disolves the overlay image into each of the frames for the section of video we want
Reassemble the video
# Copy the modified frames on top of the original frames
cp "${OUTPUTFILE}-frames2"/frame*.png "${OUTPUTFILE}-frames"
# Reassembles the frames and the audio into an output video
ffmpeg -loglevel quiet -threads 4 \
-r 29.97 -f image2 -i "${OUTPUTFILE}-frames"/frame%d.png \
-i "${OUTPUTFILE}.mp3" -acodec copy \
-map 0.0 -map 1.0 -sameq -f mpegts -y "${OUTPUTFILE}.mpg"
# Concatenates the introduction, video and closing
ffmpeg -loglevel quiet -threads 4 \
-i concat:"${OUTPUTFILE}-intro.mpg"\|"${OUTPUTFILE}.mpg"\|"${OUTPUTFILE}-exit.mpg" \
-r 29.97 -sameq -y "${OUTPUTFILE}.mp4"
And that's it. As you can see, with small modifications to these commands you can edit your video however you want.
If you search the internet you will find plenty of examples for ffmpeg for example
http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs
While the ImageMagick documentation is the best source for more examples.
http://www.imagemagick.org/Usage/
While you can do it using a GUI video editor such as Kino, Cinelerra or final cut. I found that the flexibility and repeatability of scripting it simplified my life.
I hope it simplifies yours too.
If you have any comments you can email me at
rarsa --at-- yahoo.com