Sunday, October 28, 2007

Exporting youtube videos to dvd format

Hey guys, a while I haven't been here. Since two weeks ago I started going to a capoeira class here in UK, maybe trying to get back to my roots : ) I found some good lessons on youtube and other similar sites, but as my room is not that big to train capoeira inside : ) I had thought in recording them into dvd format. It came out quite tricky to find the right set of tools to do the job.

So here goes my how-to:

1- Downloading youtube videos in flv format:

You need first to get the video from any video website. For this we will use a firefox plugin called Video DownloadHelper. If you are not using firefox, a good chance for you to get rid of evil ms iexplorer. Install the plugin in the following page:
https://addons.mozilla.org/en-US/firefox/addon/3006

After installing it and going to your favorite video page, you will see an animated icon at the right side of the address bar:

Don't get scared with the image above, that's me playing harmonica with a sort of Andy Warhol's painting filter to the camera :)

2- Converting from flv to mpg4

This one was the hardest to find. There is quite a lot of apps that do the job, but most that i found you could use for free with a logo watermark on it, so not that useful, or you would have to pay for it. well, I ended up finding SUPER, which is a Universal Player Encoder & Renderer. It does the job well, even working in batch mode with loads of files, as it was my case. They have a good slogan which i confirm as true : "SUPER © does for FREE what other encoders CAN'T do for money.". So if you want to donate and make them happy, click here :) and if you want to make me happy, please check the google links on the top or botton :P Finding the link to download that would work was the trickest part. You can try the following ones:
http://www.erightsoft.info/GetFile.php?SUPERsetup.exe
http://www.erightsoft.net/S6Kg1.html
If it doesn't work, try in another browser, i had to use evil ms internet explorer, can you believe it? : ) well, nothing can be so easy, isn't? Just to give some challenge to the task :)

They say the following related to the problem of downloading:

To download from this site without looping back to the same page you need to:
Enable your JavaScript, clear your MSIE cache, do not block your http_referrer (with ZoneAlarm or similar), do not use a proxy.
Queries concerning this issue will not be answered. We do not know any other answer to give.


After installing, when running, to do a quick transformation use the following settings:

Actually the only thing I've changed was the first line: output container -> MPG4, output video codec -> DIVX and output audio codec-> AAC. The rest was default already. One thing that is not so intuitive is how to set the output folder. You need to right click and choose the "Output File Save Management". To choose the files you want to convert, you can right click and choose "Add Multimedia File(s)". After everything ready, hit "Encode (Active files)" button and wait the files to be processed.

3- Creating a dvd with the files

Up to this moment you could already burn a CD with the files and play at most of new dvds. But if you want to burn a DVD you will need an app that can convert conventional MPG files into DVD format. Most os applications that burn DVD are paid, like nero. But as I wouldn't let you without an alternative, I discovered this really cool opensource project that came out quite good and easy to use. It's called dvdflick, an opensource project from sourceforge. Use the following link to download it:
http://www.dvdflick.net/download.php
It was released last month (september), but it looks really good and stable, and with the same features of the other apps.

  • Main window- Adding media files



  • Configuring the project:
You need to choose the second option only (burn the project to the disc), if you choose both you will get an error message and if you don't choose any nothing will be saved in the DVD.



  • Generating the dvd.
This following windows will appear when you press the "Create DVD" button in the main window:


Conclusion

As you could see, it's not rocket science to get a bunch of videos from youtube playing in a DVD. It's just about finding the right tools for the right job : ) And all free (and mainly: without limitations) tools so that might facilitate things for everyone.

Also, most of the previous softwares shown here use ffmpeg command line tool. This is the big guy when talking about sound and video conversion.

Hope this might be useful to you guys, feel free to leave suggestions or critics.

Emerson

Monday, October 15, 2007

Oracle and Dates

Something i usually suffer is on how to format date on Oracle. Here goes some tips on fomatting, inserting and comparing oracle dates:

The following brings the current date/time:

SELECT sysdate FROM dual;

SYSDATE
———
14-SEP-05

This simple select statement returns the date in the standard format (typically DD-MON-YY.)

SELECT systimestamp FROM DUAL;

SYSTIMESTAMP
—————————————————————————
14-SEP-05 04.06.31.264201 PM -04:00

Here we see that systimestamp reports more detail than sysdate, including the offset from GMT.

Displaying Dates

The to_char function will allow you to describe how you want dates displayed and will convert them to a character string in that format. For Oracle , the default is DD-MON-YY.

SELECT to_char(sysdate, 'MM/DD/YYYY') FROM dual;

TO_CHAR(SYSDATE,'mm/DD/YYYY')
———-
09/14/2005

the to_char function requires two parameters: a date to display, and the format you want it to be in. There are several formatting options, but here are some common ones:

SELECT to_char(sysdate, 'MM/DD/YY') FROM dual;

09/14/05

SELECT to_char(sysdate, ‘MM/DD/YYYY HH:MI:SS’) FROM dual;

09/14/2005 04:09:03

SELECT to_char(sysdate, ‘DAY, MONTH DD, HH12:MI AM’) FROM dual;

WEDNESDAY, SEPTEMBER 14, 04:09 PM

SELECT to_char(sysdate, ‘YYYY BC’) FROM dual;

2005 AD

SELECT to_char(systimestamp, ‘HH24:MI:SS.FF3′) FROM dual;

16:09:24.606

Inserting Dates

The function to_date works similarly to the to_char function above. You must specify a date, typically enclosed by single quotes, then describe the format with the date components as above. To demonstrate this let's create a table we can insert some dates into.

CREATE TABLE dates
(
entry NUMBER,
entry_date DATE,
CONSTRAINT pk_dates PRIMARY KEY (entry)
);

Now a few inserts:

INSERT INTO dates (entry, entry_date)
VALUES (1, sysdate);

Inserts the current date and time to the second.

INSERT INTO dates (entry, entry_date)
VALUES (2, to_date(’09/27/05′, ‘MM/DD/YY’));

INSERT INTO dates (entry, entry_date)
VALUES (3, to_date(’10/02/2005 10:05:33 PM’, ‘MM/DD/YYYY HH:MI:SS AM’));

INSERT INTO dates (entry, entry_date)
VALUES (4, to_date(’17:01:24′, ‘HH24:MI:SS’));

INSERT INTO dates (entry, entry_date)
VALUES (5, to_date(’Monday, September 12, 2:30 PM’, ‘DAY, MONTH DD, HH:MI AM’));

COMMIT;

Now let’s take a look at the data in the dates table:

SELECT entry, to_char(entry_date, 'MM/DD/YYYY HH:MI:SS AM')
FROM dates;

1 09/14/2005 09:08:32 PM
2 09/27/2005 12:00:00 AM
3 10/02/2005 10:05:33 PM
4 09/01/2005 05:01:24 PM
5 09/12/2005 02:30:00 PM

We can see that the current date and time was entered in entry 1 down to the second.

Entry 2 contains the date we entered, but since we did not specify the time it has defaulted to midnight.

Entry 3 shows a complete timestamp exactly as we specified.

In entry 4 we see the time as we specified, but since we didn’t specify a date it has defaulted to the first of this month. I have a feeling this varies from database to database. Probably best not to rely on this.

Entry 5 shows the date and time, however since we did not specify seconds they display as :00.

Comparing Dates

Dates can be compared much like other values. To demonstrate this we’ll do some quick selects on the table we just created.

select entry, to_char(entry_date, 'MM/DD/YYYY HH:MI:SS AM')
from dates
where entry_date > to_date(’09/20/2005′, ‘MM/DD/YYYY’);

2 09/27/2005 12:00:00 AM
3 10/02/2005 10:05:33 PM

select entry, to_char(entry_date, ‘MM/DD/YYYY HH:MI:SS AM’)
from dates
where entry_date <>

1 09/14/2005 09:08:32 PM
4 09/01/2005 05:01:24 PM
5 09/12/2005 02:30:00 PM

select entry, to_char(entry_date, ‘MM/DD/YYYY HH:MI:SS AM’)
from dates
order by entry_date;

4 09/01/2005 05:01:24 PM
5 09/12/2005 02:30:00 PM
1 09/14/2005 09:08:32 PM
2 09/27/2005 12:00:00 AM
3 10/02/2005 10:05:33 PM

These are the main things you can do with dates in Oracle, if you think of anything else, please let me know.


Emerson

Monday, October 08, 2007

Tropa de Elite, the new (and the best, according to some) brazilian movie

Hi guys, yesterday I've finished watching the movie "Tropa de Elite", a new brazilian movie just released a couple of days ago. This movie created such a comotion even before been released, been so by far the most copied (brazilian) movie in brazil. Because of this the movie was re-scheduled to the 5th of October instead of 2th, the original schedule.
The movie is a story based on real facts about the BOPE, in english "Especial Operations Police Battalion", a special police of Rio de Janeiro city. It shows the cruel reality of the poverty in the favelas of Rio de Janeiro, where the criminality and drug dealing goes along (and well) with the police, that by getting such a small salary almost always end up getting corrupted. The BOPE isn't like that (at least in the movie), and it's feared by the other kinds of police and the criminals in the favelas, giving a hope that not all police would be corrupt. But this special operations group also show a different view that seems to be more and more accepted by the society, not that this movie created, but just made it brought it up: the acceptance of the rule of "an eye for an eye and a tooth for a tooth" (Hammurabi's law). As the brazilian people see their corrupt politicians (pleonasm?) not been punished, the drug dealers commanding the favelas and the police charging to do their work, people start to accept this radical way of solving things.

Following is the first 7 minutes of the movie, with subtitles in English. Some weird translations here and there : )



Before anything I would like to highlight that the reality shown in this movie is NOT what you will see everywhere in Brazil. Even in Rio de Janeiro, apart if you really look for trouble, you won't see things that happen in this movie, as police and criminals going around shooting randomly.

The danger of movies that explore the extremes of Brazil's poverty and criminality like "City of God" or now "Tropa de Elite" is that people will create this stereotype that Brazil is just that everywhere. I lost count of how many times people told me in Europe: "Are you brazilian? Ahhh, I've seen 'City of God', is it really like that? ". At least it doesn't go the the extremes as the movie "Tourists", which shows americans and british tourists been kidnapped and having their organs taken alive... Really something I've NEVER heard about....

People don't know that for example, in the south of Brazil we have places that you would just feel like being in Germany, from the architecture or even from the language in some places. Blumenau, for example, a city founded by Germanic immigrants, 140 kms from my city Florianopolis, has an Oktoberfest every year, that is one of the biggest parties in Brazil.

People outside Brazil use to have a stereotype of brazilian been people that just know how to play football and dance samba. I hope I had done my job so far of showing to people in Europe that Brazil and brazilian people has much more to offer than only this.

To finish, the official trailer of the movie, unfortunately only in portuguese: