Editing video using commands

In this section I’ll show you a way to treat the videos as would make any program for video processing that are out there, this way is original and invented by myself so anyone to publish it in some other site I hope to show their origin.

 

Well that modify the video by commands when professionals and non-professionals for this program is simple to explain, as we will see, the combinations you can make using the commands are endless.

No professional program it may make as many combinations.

For our example we will leave a video cast by me on the coast of Gijon in Spain

From this video or any other video that we ourselves, ensure that not too large for example 20, 30 or 60 seconds.

1) create a temporary folder using:

mkdir /temp
2) We put the video call eg “video1.mov” inside this folder does not have to be in mov format, can be in ts format, mpeg, flv, avi etc ..

3) Open a terminal in the temporary directory where the video is.
There should be no other file in this folder except the video.
And execute the following command:

ffmpeg -i video.mov -qscale 0 imagen%d.jpg

We will see that many files * .jpg ie that shows all the frame containing the video images are created.

4) Then apply a filter to each of the images that were created with the nconvert command.

nconvert -out png -grey 256 -embossmore -balance 2 2 2 -autocontrast *.jpg

Create a comic-like effect and png image type is generated for each of the jpg images that had before.

5) delete all images “jpg”

rm * .jpg

6) Now we will package all png images with filter in a video for this run the following command:

ffmpeg -f image2 -i imagen%d.png -target pal-dvd -aspect 16:9 out.mpeg

out.mpeg obtain a video that contains the original video comic type

Well the resulting video is as follows.

7) Remove the images png

rm * .png

FILTER2

Doing the same steps as in the previous case but shortening the explanation:

1)  mkdir /temp         moving   video.mov  to   /temp

2) open terminal in temporal and type:

ffmpeg -i video.mov -qscale 0  imagen%d.jpg

3) After the terminal type from the following filter to convert images to png:

nconvert -out png -grey 256 -embossmore  -grey 256 -balance 30 30 30 -gamma 3.0 -contrast 20 -hls -904 -20 100  *.jpg

4) Deleting all  «jpg» images    rm *.jpg

6) Packing again imagens all png by:

ffmpeg  -f image2 -i imagen%d.png  -target pal-dvd  -aspect 16:9 final.mpeg

Deleting all  «png» images     rm *.jpg

Well the resulting video is as follows.

FILTER 3

more abbreviated
1) mkdir /temp     video.mov  a temp
2) terminal    : ffmpeg -i video.mov -qscale 0  imagen%d.jpg
3) Filter:   nconvert -out png  -eedge 100  -eedge 100 -levels 1 30  -contrast 60 *.jpg
4) rm *.jpg
5) Terminal:  ffmpeg  -f image2 -i imagen%d.png  -target pal-dvd  -aspect 16:9 final.mpeg
6)  rm *.png
7) The final video es:

 

FILTER4

1) mkdir /temp     video.mov  a temp
2) terminal    : ffmpeg -i video.mov -qscale 0  imagen%d.jpg
3) Filter:   nconvert -out png -grey 10 -eedge detect -eedge detect  *.jpg
4) rm *.jpg
5) Terminal:  ffmpeg  -f image2 -i imagen%d.png  -target pal-dvd  -aspect 16:9 final.mpeg
6)  rm *.png
7) The final video es:

FILTER5

1) mkdir /temp     video.mov  to temp
2) terminal    : ffmpeg -i video.mov -qscale 0  imagen%d.jpg
3) Filter:  nconvert -out png -sepia 90  *.jpg
4) rm *.jpg
5) Terminal:  ffmpeg  -f image2 -i imagen%d.png  -target pal-dvd  -aspect 16:9 final.mpeg
6)  rm *.png
7) The final video:

 

FILTER6

1) mkdir /temp     video.mov  to  temp
2) terminal    : ffmpeg -i video.mov -qscale 0  imagen%d.jpg
3) Filter:   nconvert -out png  -binary nodither  *.jpg
4) rm *.jpg
5) Termianal:  ffmpeg  -f image2 -i imagen%d.png  -target pal-dvd  -aspect 16:9 final.mpeg
6)  rm *.png

FILTER7

One of the wonders of the commands is that we can create script for command as in this case combined.

The following filter is not a filter but the application of a script for images.

We need to create a script on behalf eg “convert” and contains the following:

for F in *.jpg
do
archivo=$F

if [ $P -lt 91 ] && [ $M -eq 0 ]; then echo $F $S; nconvert -out png -mosaic $S $F; let P=$P+1;  fi

if [ $P -lt 11 ] && [ $M -eq 0 ]; then let S=$S+1; let P=0; fi

if [ $S -eq 40 ] && [ $M -eq 0 ]; then let M=1 ; let P=0; let S=$S-2; fi

if [ $P -lt 91 ] && [ $M -eq 1 ]; then nconvert -out png -mosaic $S $F; let P=$P+1; fi

if [ $P -lt 11 ] && [ $M -eq 1 ]; then let S=$S-1; let P=0; fi

if [ $S -eq 1 ] && [ $M -eq 1 ]; then let M=0 ; let P=0; let S=2; fi

rm $F
done

This script basically what it does is start counting the images and apart from a certain number will increase the filter value “-mosaic” within the nconvert command:

The effect is that the image is pixelando mosaic of more to less and less to more.

I do not stay very well why not me I’ve worked hard but good effect can be seen.

To create the video do the following:

1) mkdir /temp     video.mov   to  /temp
2) terminal    : ffmpeg -i video.mov -qscale 0  imagen%d.jpg
3) Filter:  Run in the same directory   ./nconvert
4) Terminal:  ffmpeg  -f image2 -i imagen%d.png  -target pal-dvd  -aspect 16:9 final.mpeg
5)  rm *.png
5)  The final video in:

 

 

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s