domingo, 8 de maio de 2011

tutorial:converting_to_dvd [Avidemux DokuWiki]

tutorial:converting_to_dvd [Avidemux DokuWiki]:

Converting to DVD

An interactive step-by-step guide created by LoRd_MuldeR is also available at http://mulder.dummwiedeutsch.de/etc/adm_wink/avi2dvd.htm (Flash required).

Creating a DVD

Let's review a couple of facts before going into the juicy details.

  • Avidemux will create the MPEG file for you.
  • You will need an authoring program to convert that MPEG to the DVD file hierarchy. Most of them are using dvdauthor. For example you could use Varsha, KDvdAuthor or whatever.

The mostly automatic way

Use the Auto→DVD menu. It will setup most of it with sensible defaults. The only thing left to you will be to set the video codec to 2pass mode and enter the desired final size.

Preparing the video

To be DVD compliant, the resolution must be :

  • 352*480 or 720*480 or 704*480 for NTSC
  • 352*576 or 720*576 or 704*576 for PAL/SECAM

How do i know if it is PAL or NTSC?

Click the info button (File→Properties). If the “Frame Rate” field is 25, it is PAL or SECAM. If it is 23.976 or 29.97, it is NTSC.

If it is not exactly one of these values, you will have to use the Resample fps filter to convert to either PAL or NTSC.

Now that you have identified the type of video, you have to resize it to a proper width/height. The simpler way is to use the “DVD res” button in the Video Filter Manager dialog that will do that automagically.

Warning: You cannot blindly resize to 720*480 or whatever. You must take into account the aspect ratio to do it properly. And the aspect ratio is not the same for PAL and for NTSC. The best is to let “DVD res” do it for you.

Selecting the video encoder

You have two codec families that are suitable for DVD creation: “DVD (lavc)” which is using libavcodec, or “DVD” which is using libmpeg2enc. They both have their pros and cons:

  • DVD (lavc): Faster, good, use only in 2-pass mode for DVD.
  • DVD: Slower, good, can be safely used in CQ mode or in CBR mode.

For DVD the total bitrate must be below 9.8 Mb/s. So to put it simply a max bitrate around 9 Mb is okay. Assuming you will use 2-pass mode with DVD (lavc) you must enter the video only final size. So it is better to use the calculator first, that will compute the video size from the final size.

Preparing the audio

For DVD, audio must be 48 kHz and one of:

  • AC3 (FFmpeg AC3)
  • MP2 (FFmpeg MP2 or TwoLAME)
  • LPCM (WAV LPCM)

If the audio track from the source video is suitable, the best might be to use it and let the audio to Copy. Else select your favorite encoder (for me it would be TwoLAME).

Don't forget to setup the audio filter. Setup downmixing if needed and don't forget that the audio must be 48 kHz. Use a resampling filter if needed.

So for example, you will set downmixing to Dolby Prologic 2, resampling to 48 kHz, TwoLAME encoder at 160 kb/s.

Selecting the output format, simple case

For DVD, if you are happy with one audio track and no subtitle, the best would be to select “MPEG PS A+V” as output format using the format menu. The resulting MPEG file will be suitable to authoring. Just hit the Save button and you will get foo.mpeg which can be authored afterward with your favorite authoring program.

Selecting the output format, elaborate case

Doing a multi track audio is a bit different, but not complicated. First you will save the audio, using the Audio→Save menu (of course, all of the above concerning audio is needed). You will get foo_1.mp2 file for example.

Repeat for all tracks you want to convert, changing the audio track using Audio→Main Track. At the end you will have foo_1.mp2, foo_2.mp2 etc…

Now select “MPEG video” as output container and hit the Save button. You will save as foo.m2v for example.

Once you have all your files, time to fire up mplex to create the MPEG file. The syntax will be

mplex -f 9 -i final.mpg foo.m2v foo_1.mp2 foo_2.mp2

etc…

final.mpg is then suitable for authoring.

INSERT com SELECT

INSERT com SELECT

Por Luiz Paulo de Oliveira Santos

Data de Publicação: 17 de Setembro de 2006

Uma possibilidade interessante e desconhecida de muitos desenvolvedores que utilizam SQL é o uso de duas instruções SQL em uma única chamada. Por exemplo: A instrução INSERT que é responsável por inserir registros em tabelas, e, pode ser utilizada em conjunto com outras instruções, como o SELECT, por exemplo.

A instrução SELECT do SQL é além de polêmica bastante complexa. Com ela podemos extrair informações dos mais diversos tipos, ou seja, podemos utilizar o SELECT para obter desde resultados de cálculos básicos até buscas complexas e mais elaboradas, como nos exemplos a seguir:

  SELECT 1+1 

ou

  (SELECT * FROM `xoops_users` where (uid >1) and (uid < 5)) 

UNION

  (SELECT * FROM `xoops_users` where (uid >10) and (uid < 15))   ORDER BY uname; 

Podemos utilizar o SELECT para extrair informações e canalizar o resultado obtido para outra instrução SQL. É o proposto no título do artigo, e o que será demonstrado a seguir.

Em uma situação onde existe a necessidade de gerar uma tabela de dados para ser trabalhada, e, ao final dos trabalhos ser exportada para outro sistema, por exemplo. Necessita-se importar dados de diferentes tabelas ou intervalos da tabela e colocar tudo em uma única tabela (tabela resposta). Logo teremos que inserir registros na tabela que armazenará a resposta.

A inserção dos dados é efetuada com a instrução INSERT, que é bastante simples. Basicamente informa-se a tabela que receberá os dados, os campos que serão preenchidos (e podem ser omitidos caso todos os campos sejam preenchidos) e a massa de dados que preencherá os campos, conforme o exemplo:

  INSERT INTO  (lista de campos,...)      VALUES (massa de dados); 

Sendo que a massa de dados deve obedecer a lista de campos informada.

Supondo que exista a tabela respostas com a seguinte estrutura:

Campo Tipo
IDENVIO INT(11)
NOME VARCHAR(50)
IDDESTINO INT(11)

Para inserirmos um registro na tabela respostas a instrução INSERT terá a seguinte sintaxe:

  INSERT INTO respostas (IDENVIO, NOME, IDDESTINO)   VALUES (11,"lpaulo",132); 

Para efetuarmos a importação devida, deve-se obter os campos IDENVIO e NOME da tabela xoops_users (nos campos uid e uname respectivamente) e o campo IDDESTINO da tabela xoops_xoopscomments (campo com_id). Logo, necessitam-se buscar dados em duas tabelas e armazenar a resposta na tabela respostas. Para buscar os dados nas tabelas utilizaremos um SELECT. Porém deve-se filtrar os registros da tabela xoops_xoopscomments, de forma que para cada registro de xoops_users seja exibido com seu equivalente em xoops_xoopscomments.

A seguir temos a instrução que faz a extração dos dados:

  SELECT xoops_users.uid, xoops_users.uname,          xoops_xoopscomments.com_id          FROM xoops_users, xoops_xoopscomments          WHERE xoops_users.uid = xoops_xoopscomments.com_uid 

No SELECT acima obtemos 3 campos, sendo dois deles INTEGER e um VARCHAR.

Agora será unido o SELECT ao INSERT:

  INSERT INTO `respostas`  (IDENVIO, NOME, IDDESTINO)   SELECT xoops_users.uid, xoops_users.uname,          xoops_xoopscomments.com_id          FROM xoops_users, xoops_xoopscomments          WHERE xoops_users.uid = xoops_xoopscomments.com_uid 

Desta forma será inserido na tabela respostas os registros obtidos na consulta com SELECT. Observe que a clausula VALUES foi omitida. Em alguns casos a clausula VALUES pode ser omitida e em outros casos não. Em uma próxima oportunidade o assunto será estudado.

E as variações e aplicações para esse tipo de sintaxe são simplesmente ilimitadas! O limite é a necessidade e criatividade de cada um.

Nota: O uso do INSERT em conjunto com SELECT é muito útil, porém deve-se lembrar sempre das formas normais que foram empregadas para normalização do banco de dados. Se as formas normais não forem respeitadas, redundâncias podem aparecer em seu banco! Mas formas normais é assunto para outro bate papo.

Espero que essa pequena dica seja útil quando precisar "importar" dados provenientes de tabelas que já existam.

Um forte abraço e até mais!

segunda-feira, 25 de abril de 2011

Mono WebBrowser with WebKit [Gtk# not WinForms]

Mono WebBrowser with WebKit [Gtk# not WinForms]: "– Enviado usando a Barra de Ferramentas Google"

Everaldo's Weblog: Mono Bindings in 5 minutes

Everaldo's Weblog: Mono Bindings in 5 minutes:

Mono Bindings in 5 minutes

Last month at FISL 9 I met again with my good friend Henri Bergius, and he told me about Midgard news and showed me some changes on version 2 of Midgard Core. Midgard Core is a glib based library that could be used to persist glib objects on databases. Since it uses the GLib object model it is very easy to create binding for Mono, and that's what we did it at FISL days.

That was not the first time that I created Mono bindings for GLib libraries, I had done it before for Maemo libraries, and this weekend again for WebKit, but at this time I decide to create a project skeleton so everybody that is interested in creating Mono binding for Glib based libraries could use this skeleton for easy bindings creation.

The steps below describe how I easily created WebKit bindings without typing any lines of C# code.

First, download the skeleton file, unpack it and rename it to "webkit-sharp":

# wget http://anonsvn.mono-project.com/viewcvs/trunk/monoskel-gapi.tar.gz
# tar -xzf monoskel-gapi.tar.gz
# mv monoskel-gapi webkit-sharp

Now, go into this new directory and run the script that will perform the magic:
# cd webkit-sharp
# chmod +x autogen.sh skel-create.sh
# ./skel-create.sh webkit-sharp
# ./autogen.sh

We now have our source tree ready with autotools and makefiles. In the next step we must tell gapi where the C header files of the library that we want to make bindings for are. Open sources/webkit-sharp-sources.xml with your preferred text editor and type the following content:






/usr/include/webkit-1.0/webkit





Here, the important information is "WebKit" that will be used as our namespace and "dir" that indicates the directory where our header (.h) files are.

And that is all, no changes needed anymore, you just need to run "make api" on the sources directory every time you change "webkit-sharp-sources.xml".
# cd sources
# make api

You can now follow the normal procedure to compile and install the linux package. On the package root directory, just type:
# ./configure
# make
# make install

If you are a developer, it should be easy to understand and create more samples in "samples" dir. There are also some "Package settings" that can be changed on top of "configure.in".

I did some other changes in my webkit-sharp like creation of webbrowser sample and checking for installed WebKit in configure.in. On my next post I will show webkit-sharp in action.

More information about GAPI could be found here.

ApplicationsGtk – WebKit

ApplicationsGtk – WebKit:

Applications using WebKit/GTK+

This is a list of applications known to be using WebKit/GTK+.

Browsers

All the browsers in this list use WebKit at the core of the application, unless otherwise stated.

Epiphany - GNOME

  • Open Source

Epiphany, Epiphany WebKit

Element Browser - Element Software LLC

  • Freeware
  • MS-Windows, Mac (Universal Binary)

Element Browser is a stylistic, modern and powerful web browser. It features unmatched security, an intuitive user interface and great features.

Midori

  • Open Source

Midori

Kazehakase

  • Open Source
  • Supports WebKit/Gecko

Kazehakase

WebKit EAL - Maemo

  • Open Source(?)
  • For mobile devices

WebKit EAL (repository has gone non-public)

Web Browser - OpenMoko

  • Open Source
  • For mobile devices

Web Browser

Web - Poky Linux

  • Open Source
  • For mobile devices

Poky

Skipstone

  • Open Source
  • Supports WebKit/Gecko

Skipstone

OLPC Sugar WebKit Browse activity

  • Open Source
  • For mobile devices

WebKit Browse

DeforaOS Surfer

  • Open Source
  • Supports WebKit, Gecko, GtkHtml
  • Features a variant for mobile devices

http://www.defora.org/os/project/340/Surfer

Widget Toolkits

SeedKit

http://live.gnome.org/SeedKit/

As a developer, SeedKit gives you a way to define you UI in pure standard web technologies (as supported by WebKit) bound to pure GObject/DBus symbols as exposed by Seed.

Pyjamas Desktop

PyjamasDesktop provides a simpler and more powerful alternative to python-wxWidgets, PyGtk2 and PyQt4. PyWebkitGtk is the current basis for PyjamasDesktop.

http://pyjd.org

SWT

SWT is the Eclipse project's widget toolkit, and can be used by anyone to build java apps with native platform integration. As of Eclipse 3.7 the SWT Browser control embeds WebKitGtk as its native renderer.

http://www.eclipse.org

E-Mail Clients

Claws Mail

  • Open Source
  • WebKit support available as a plug-in

Claws Mail, Fancy plugin

tinymail UI library

  • Open Source
  • Library toolkit for building mail clients

Tinymail, libtinymailui-webkit

Evolution - GNOME

  • Open Source
  • Experimental WebKit support (patch, not yet merged)

Evolution

Balsa

  • Open Source
  • WebKit support includes text search, printing, and user control of image downloads

Balsa

Postler

  • Open Source
  • WebKit is used for rendering and composing messages

Postler

Language bindings

Ok, those are not exactly applications, but can be used to build them.

Python bindings

http://live.gnome.org/PyWebKitGtk

Vala bindings

http://live.gnome.org/Vala

Perl bindings

http://search.cpan.org/dist/Gtk2-WebKit/

C++ / gtkmm bindings

git clone git clone http://www.gnome.org/~jjongsma/git/webkitmm.git/ 

Ruby bindings

http://github.com/russ/rbwebkitgtk/tree/master

Instant Messenger/Chat Clients

All Instant Messenger and Chat clients in this section use WebKit to render and style messages, unless otherwise stated. This allows messages to be styled using a stylesheet language such as CSS. This enables customised message layout to be developed easily using web technology, without touching a line of code in the application.

Pidgin

  • Open Source
  • Experimental WebKit support (not yet merged)

Pidgin

Galaxium

  • Open Source
  • Uses webkit-sharp

Galaxium

Gwibber

  • Open Source
  • Microblogging client for GNOME developed with Python and GTK
  • Experimental WebKit support

Gwibber

Empathy

  • Open Source
  • Uses the telepathy framework
  • Experimental WebKit support to render Adium themes (not yet merged)

Empathy

RSS Readers

All the RSS Readers in this section use WebKit to display the news summaries, and the full articles that the RSS feeds link to.

Feed Reader - OpenMoko

  • Open Source
  • For mobile devices

Feed Reader

Liferea

  • Open Source
  • Supports WebKit/Gecko/GtkHtml

Liferea

Straw - GNOME

  • Open Source

Straw

Evolution RSS Reader Plugin

  • Open Source
  • Supports WebKit/Gecko

http://gnome.eu.org/index.php/Evolution_RSS_Reader_Plugin

NewsKit

  • Open Source
  • Uses webkit-sharp

NewsKit

Blam

  • Open Source
  • Uses webkit-sharp

Blam

Help Viewers

All applications in this section use WebKit to display HTML based help files.

Devhelp - GNOME

  • Open Source

Devhelp

Yelp - GNOME

  • Open Source
  • Experimental WebKit support (SVN branch, not yet merged)

Yelp

monodoc - Mono

  • Open Source
  • Supports WebKit/Gecko/GtkHtml

monodoc

ilcontrast - Mono

  • Open Source

http://www.mono-project.com/

GIMP (Help viewer)

  • Open Source

GIMP

Media players

Rhythmbox

  • Open Source
  • Experimental WebKit support (patch, not yet merged)

MPX

  • Open Source

MPX

Banshee

  • Open Source
  • Experimental WebKit support (patch, not yet merged)

Banshee

Media center

Clutter

Rich OpenGL UI platform.

  • Open Source
  • Experimental WebKit support

Clutter, Clutter WebKit

Other

Conduit - GNOME

  • Open Source
  • Synchronization framework

Conduit

RedNotebook

  • Open Source
  • RedNotebook is a graphical diary and journal to keep track of notes and thoughts throughout the day.

RedNotebook

Mono WebBrowser with WebKit [Gtk# not WinForms] « configuration: debug

Mono WebBrowser with WebKit [Gtk# not WinForms] « configuration: debug: "– Enviado usando a Barra de Ferramentas Google"

For long time I have looking for displayin web pages on Mono by using Gtk#…And thanks to this post I came across with WebKit solution!

monologo

WebKit is as they define in their page:

WebKit is an open source web browser engine. WebKit is also the name of the Mac OS X system framework version of the engine that’s used by Safari, Dashboard, Mail, and many other OS X applications. WebKit’s HTML and JavaScript code began as a branch of the KHTML and KJS libraries from KDE. This website is also the home of S60‘s S60 WebKit development.

Well after looking to the simple solution that is made in shana.worldofcoding.com, I give a try to my solution and here it is:

01
using System;
02using Gtk;
03using WebKit;
04
05namespace browserapp {
06 class browser {
07
08 public static void Main () {
09 Application.Init ();
10 Window window = new Window ("BROWSER");
11 window.SetSizeRequest(240,300)
12
13<div id=":h0">
14
;
15 window.Destroyed += delegate (object sender, EventArgs e) {
16 Application.Quit ();
17 };
18 ScrolledWindow scrollWindow = new ScrolledWindow ();
19 WebView webView = new WebView ();
20 webView.SetSizeRequest(240,250);
21 webView.Open ("mono-project.com");
22 scrollWindow.Add (webView);
23
24 Label name=new Label();
25 name.Text="BrowserExample:";
26
27 Fixed fixed1=new Fixed();
28 fixed1.SetSizeRequest(240,300);
29
30 fixed1.Put(name,0,0);
31 fixed1.Put(scrollWindow,0,50);
32
33 window.Add (fixed1);
34 window.ShowAll ();
35 Application.Run ();
36 }
37 }
38}
39
40

In my Debian Lenny:

“apt-get install mono-2.0-devel gtk-sharp2 libwebkit1.0-cil”

“gmcs -pkg:gtk-sharp-2.0 -pkg:webkit-sharp-1.0 web.cs”

“mono web.exe”

The Ouput:

Reference:

[1.] http://shana.worldofcoding.com/en/browser.html

quinta-feira, 14 de abril de 2011

Click Start > Run.

Enter ipconfig /flushdns in the Open: textbox.

Click the OK button.

http://www.tacktech.com



Note: This does not modify your host file entries. If you run ipconfig /displaydns entries in the host file will still be listed.