Friday, April 30, 2010

Compile wxDownload Fast for Windows

I once used wxDownload Fast as a tool for getting something off the Web quickly. But it crashes every once in a while. So I stopped using it long ago. Now I am compiling wxDownload Fast only to test my static wxMSW library.



I am using MinGW GCC compiler to build wxDownload Fast. I downloaded the source for wxDownload Fast. I unpacked the source and configured it:



tar xzvf wxdfast_0.6.0.tar.gz
cd wxdfast-0.6.0/
./configure --prefix=/mingw --enable-win32build


I got some errors during the final linking stage. I had to modify src/Makefile to fix the errors. The end of Makefile was modified.



wxDFast.res: wxDFast.rc
windres -i $< -J rc -O coff -o $@ --include-dir=/mingw/include/wx-2.8


The other fix involves linking with expat because my wxMSW library depends on expat.



wxdfast$(EXEEXT): $(wxdfast_OBJECTS) $(wxdfast_DEPENDENCIES) 
@rm -f wxdfast$(EXEEXT)
$(CXXLINK) $(wxdfast_LDFLAGS) $(wxdfast_OBJECTS) $(wxdfast_LDADD) $(LIBS) -lexpat


Then, I started make.



make
make install


I double-clicked wxdfast and it started alright. The following files are installed onto the system (under the MinGW folder).



./bin/wxdfast.exe
./share/applications/wxdfast.desktop
./share/locale/cs/LC_MESSAGES/wxDFast.mo
./share/locale/de/LC_MESSAGES/wxDFast.mo
./share/locale/es/LC_MESSAGES/wxDFast.mo
./share/locale/fr/LC_MESSAGES/wxDFast.mo
./share/locale/hu/LC_MESSAGES/wxDFast.mo
./share/locale/id/LC_MESSAGES/wxDFast.mo
./share/locale/nl/LC_MESSAGES/wxDFast.mo
./share/locale/pl/LC_MESSAGES/wxDFast.mo
./share/locale/pt_BR/LC_MESSAGES/wxDFast.mo
./share/locale/ru/LC_MESSAGES/wxDFast.mo
./share/locale/tr/LC_MESSAGES/wxDFast.mo
./share/man/man1/wxdfast.1
./share/man/pt_BR/man1/wxdfast.1
./share/pixmaps/wxdfast.png
./share/wxdfast/RipStop/icon/dfast48x48.png
./share/wxdfast/RipStop/icon/wxdfast.ico
./share/wxdfast/RipStop/icon/wxdfast.png
./share/wxdfast/RipStop/license.txt
./share/wxdfast/RipStop/logo/about.png
./share/wxdfast/RipStop/menubar/about.png
./share/wxdfast/RipStop/menubar/completed.png
./share/wxdfast/RipStop/menubar/copydata.png
./share/wxdfast/RipStop/menubar/copyurl.png
./share/wxdfast/RipStop/menubar/details.png
./share/wxdfast/RipStop/menubar/downloading.png
./share/wxdfast/RipStop/menubar/error.png
./share/wxdfast/RipStop/menubar/find.png
./share/wxdfast/RipStop/menubar/graph.png
./share/wxdfast/RipStop/menubar/help.png
./share/wxdfast/RipStop/menubar/new.png
./share/wxdfast/RipStop/menubar/options.png
./share/wxdfast/RipStop/menubar/pasteurl.png
./share/wxdfast/RipStop/menubar/pause.png
./share/wxdfast/RipStop/menubar/progressbar.png
./share/wxdfast/RipStop/menubar/properties.png
./share/wxdfast/RipStop/menubar/quit.png
./share/wxdfast/RipStop/menubar/remove.png
./share/wxdfast/RipStop/menubar/schedule.png
./share/wxdfast/RipStop/menubar/scheduled.png
./share/wxdfast/RipStop/menubar/start.png
./share/wxdfast/RipStop/menubar/startall.png
./share/wxdfast/RipStop/menubar/stop.png
./share/wxdfast/RipStop/menubar/stopall.png
./share/wxdfast/RipStop/preview/ripstop.png
./share/wxdfast/RipStop/preview/wxdownloads_small.png
./share/wxdfast/RipStop/readme.txt
./share/wxdfast/RipStop/svg/ripstop.svg
./share/wxdfast/RipStop/svg/wxdownloads_small.svg
./share/wxdfast/RipStop/toolbar/download_info.png
./share/wxdfast/RipStop/toolbar/download_move_down.png
./share/wxdfast/RipStop/toolbar/download_move_up.png
./share/wxdfast/RipStop/toolbar/download_new.png
./share/wxdfast/RipStop/toolbar/download_remove.png
./share/wxdfast/RipStop/toolbar/download_schedule.png
./share/wxdfast/RipStop/toolbar/download_start.png
./share/wxdfast/RipStop/toolbar/download_start_all.png
./share/wxdfast/RipStop/toolbar/download_stop.png
./share/wxdfast/RipStop/toolbar/download_stop_all.png
./share/wxdfast/boxabout.xrc
./share/wxdfast/boxnew.xrc
./share/wxdfast/boxoptions.xrc
./share/wxdfast/images.xrc
./share/wxdfast/mainwindow.xrc
./share/wxdfast/menubar.xrc
./share/wxdfast/toolbar.xrc
./share/wxdfast/xpm/big/close.xpm
./share/wxdfast/xpm/big/down.xpm
./share/wxdfast/xpm/big/new.xpm
./share/wxdfast/xpm/big/properties.xpm
./share/wxdfast/xpm/big/remove.xpm
./share/wxdfast/xpm/big/schedule.xpm
./share/wxdfast/xpm/big/start.xpm
./share/wxdfast/xpm/big/startall.xpm
./share/wxdfast/xpm/big/stop.xpm
./share/wxdfast/xpm/big/stopall.xpm
./share/wxdfast/xpm/big/up.xpm
./share/wxdfast/xpm/small/error.xpm
./share/wxdfast/xpm/small/exit.xpm
./share/wxdfast/xpm/small/graph.xpm
./share/wxdfast/xpm/small/new.xpm
./share/wxdfast/xpm/small/noresume.xpm
./share/wxdfast/xpm/small/ok.xpm
./share/wxdfast/xpm/small/options.xpm
./share/wxdfast/xpm/small/paste.xpm
./share/wxdfast/xpm/small/progress.xpm
./share/wxdfast/xpm/small/properties.xpm
./share/wxdfast/xpm/small/queue.xpm
./share/wxdfast/xpm/small/remove.xpm
./share/wxdfast/xpm/small/resume.xpm
./share/wxdfast/xpm/small/schedule.xpm
./share/wxdfast/xpm/small/start.xpm
./share/wxdfast/xpm/small/startall.xpm
./share/wxdfast/xpm/small/stop.xpm
./share/wxdfast/xpm/small/stopall.xpm
./share/wxdfast/xpm/small/wxdfast.xpm
./share/wxdfast/xpm/wxdfast.ico
./share/wxdfast/xpm/wxdfast.xpm

Sunday, April 25, 2010

Setting Up Codecs For Windows 7

Although Windows 7 provides wider support for multimedia files, including H.264, XviD, DIVX and AAC, Windows Media Player 12 has some bugs, such as jittery DVD sound. For satisfying multimedia experience in Windows 7, one needs to take some steps to set up additional codecs. Though ffdshow is a comprehensive codec package, I am going to use alternative codecs other than ffdshow.




  1. Go to C:\Windows\System32 and rename msmpeg2adec.dll and msmpeg2vdec.dll. Alternatively, run Win7DSFilterTweaker and check both Disable Microsoft DTV-DVD Audio decoder and Disable Microsoft DTV-DVD Video decoder.

    Win7DSFilterTweaker 3.0


  2. Install DirectShow FilterPack (DSFP.zip) which only contains DirectShow source filters and splitters, but no codecs. Unpack the package (DSFP-3.32.exe) into C:\Program Files. Start the Command Prompt (cmd.exe) as administrator and run the batch file DSFP_inst.bat.

    cd "C:\Program Files\DirectShow FilterPack"
    DSFP_inst.bat


  3. Install XviD codec.

  4. Install AC3filter which allows Media Player to play AC3 and DTS sound.

  5. Install DirectShow filters for Ogg Vorbis, Speex, Theora and FLAC from xiph.org.

  6. Obtain CLVsd.ax from the Web and run the following command in an elevated Command Prompt.

    regsvr32 CLVsd.ax

    CLVsd.ax can be obtained this way:


    • Download PowerDVD from filehippo.
    • Right-click the installer (CyberLink.1705(Trial)_DVD100510-04.exe) and open it with 7-zip.
    • Right-click data1.cab and choose Open Inside.
    • Extract the file _64A6CC87C2FD46EDBDBCC13164131D6A (1,086,832 bytes) to C:\Windows\System32 folder.
    • Rename _64A6CC87C2FD46EDBDBCC13164131D6A as CLVsd.ax.
    • Run "regsvr32 CLVsd.ax" as administrator.


  7. Open the registry editor (regedit) and navigate to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Decoder and find the entry PreferredMPEG2VideoDecoderCLSID. Double-click the entry and enter {516F1EFA-42F4-436E-801C-B752EB9343EB} (UUID for Cyberlink decoder). You can verify the CLSID with Radlight Filter Manager (DSFM.exe) that was installed by DirectShow FilterPack above.

  8. Download the DirectVobSub filter, also known as VSfilter. Copy VSFilter.dll to C:\Windows\System32 and run the following command:

    regsvr32 VSFilter.dll


Saturday, April 24, 2010

MinGW: To Compile Vorbis Tools

Vorbis tools include oggenc and vorbiscomment that can be used to produce Ogg-Vorbis music files. Ogg Vorbis provides people with free, open-source audio format and encoding algorithm. Because the MP3 algorithm is patented and creating MP3 exposes people to legal risks, use of the Ogg Vorbis format is a reasonable choice for legally conscious people. Besides its openness and patent-free characteristics, Ogg Vorbis offers good compression and sound quality, comparable to MP3 and AAC. Therefore, everyone is recommended to create, use and spread Ogg Vorbis music files, instead of MP3 and AAC.



To learn how to prepare a MinGW environment, read this post. Then, download the source for libogg, libvorbis and vorbis-tools from xiph.org.





To build Vorbis tools, libogg and libvorbis should be compiled first. Start the MinGW rxvt console from the Start menu. Unpack the libogg source and compile it as follows:



tar xzvf libogg-1.2.0.tar.gz
cd libogg-1.2.0/
./configure --prefix=/mingw
make
make install


libvorbis can be compiled likewise:



tar xzvf libvorbis-1.3.1.tar.gz
cd libvorbis-1.3.1/
./configure --prefix=/mingw
make
make install


Then, build vorbis-tools as follows:



tar xzvf vorbis-tools-1.4.0.tar.gz
cd vorbis-tools-1.4.0/
./configure --prefix=/mingw --disable-nls --enable-threads=win32
make
make install


When done, the following files are created in /mingw/bin:



libogg-0.dll
libvorbis-0.dll
libvorbisenc-2.dll
libvorbisfile-3.dll
oggdec.exe
oggenc.exe
ogginfo.exe
vorbiscomment.exe


Copy these files whereever you want. To create an Ogg Vorbis file from a .WAV file, use a command like this:



oggenc -q5 audio.wav


Related Posts


Wednesday, April 21, 2010

Using IFOEdit To Dump a DVD Stream

I was using MPlayer to rip a DVD, but had a trouble dumping the third DVD title that was stored in the same VOB stream as the second DVD title. Running mplayer dvd://2 -dvd-device E:\ -vf cropdetect -identify showed the following output:



Playing dvd://2.
ID_DVD_TITLES=3
ID_DVD_TITLE_1_CHAPTERS=2
ID_DVD_TITLE_1_ANGLES=1
ID_DVD_TITLE_2_CHAPTERS=6
ID_DVD_TITLE_2_ANGLES=1
ID_DVD_TITLE_3_CHAPTERS=6
ID_DVD_TITLE_3_ANGLES=1
ID_DVD_TITLE_1_LENGTH=0.800
ID_DVD_TITLE_2_LENGTH=3196.467
ID_DVD_TITLE_3_LENGTH=3167.333


As can be seen, the longest titles are the main titles. I could dump the second DVD title with the following command:



mplayer dvd://2 -dvd-device E:\ -v -dumpstream -dumpfile title2.vob


But running mplayer dvd://3 -dvd-device E:\ -v -dumpstream -dumpfile title3.vob or mplayer dvd://3 -dvd-device E:\ crashed mplayer with the following error:



DVD Seek! lba=0xFFF08207 cell=0 packs: 0x108207-0x11AFA8

stream_seek: WARNING! Can't seek to 0xFFFFFFFF84103800 !

Core dumped ;)


I supposed this error is due to DVD copy protection. In this case, the DVD had two episodes of a show, but the episodes were stored in the same set of *.VOB files, specifically:



VTS_01_0.IFO
VTS_01_0.VOB
VTS_01_1.VOB
VTS_01_2.VOB
VTS_01_3.VOB
VTS_01_4.VOB
VTS_01_5.VOB


The first episode was in VTS_01_1.VOB, VTS_01_2.VOB and the beginning part of VTS_01_3.VOB whereas the second episode was in the latter part of VTS_01_3.VOB, VTS_01_4.VOB and VTS_01_5.VOB. I tried mplayer but couldn't extract the DVD title I wanted.



So I started IfoEdit which is useful for DVD authoring and fixing. I opened VTS_01_0.IFO in IfoEdit and clicked the VOB Extras button at the bottom of IfoEdit window. Specify the destination directory and click OK.



VOB Extras Options

In the next dialogs, choose the Audio track and the video stream you want to include in the output.

Sunday, April 11, 2010

Tools for Downloading Stuff from the Internet

You can get a variety of software, music and movies from the Internet. Some of them are legally okay to download like open-source software and free publications, but there are things you're not legally allowed to download, such as most music and movies. However, with the increasing availability of high-speed Internet and P2P software, the Internet is exponentially growing in the number of downloadable stuff.

There are so many software for downloading stuff from the Net, but only a few good ones are listed here.



  • amule

    Multi-platform program for downloading from ed2k or Kad networks.
  • aria2

    Command-line tool for downloading from Web, FTP, Bittorrent and Metalinks. Very Light , Fast and Efficient.
  • eMule

    Old-school ed2k client for downloading from eDonkey or Kademlia networks.
  • Frostwire

    Limewire clone that allows you to download from Gnutella or Bittorrent network.
  • gtk-gnutella

    Open-source Linux/*BSD client for Gnutella network.
  • HalogenWare Retriever

    Java software for downloading from HTTP, FTP, Bittorrent and Metalinks.
  • MLDonkey and Sancho

    Yet another eDonkey client
  • Phex

    Gnutella client that keeps getting better
  • Transmission bittorrent client

    I like to compile transmission-daemon and use it with a GUI frontend, such as transmission-remote-gui
    and transmission-remote-dotnet.
  • wxDownload Fast

    simple wxWidgets application that lets you quickly download from FTP and HTTP. Read my guide to compiling it here.


Once you have P2P software installed, you'll want to know more about how to search for files on the Internet. The following is a list of search engines for P2P users.


Friday, April 9, 2010

MinGW: Building TwoLAME

TwoLAME is MPEG-2 audio encoder. First, compile libsndfile which is used is read sound files in various formats.


tar xzvf libsndfile-1.0.21.tar.gz
cd libsndfile-1.0.21/
./configure --prefix=/mingw --disable-shared --enable-static
make
make install

Then, build twolame.


tar xzvf twolame-0.3.12.tar.gz
cd twolame-0.3.12/
./configure --prefix=/mingw CPPFLAGS='-DLIBTWOLAME_STATIC'
make
make install

When linking a program with a static TwoLAME library, define LIBTWOLAME_STATIC with CPPFLAGS.


CPPFLAGS=' -DLIBTWOLAME_STATIC' ./configure --enable-static --enable-twolame

MinGW: MPlayer와 Mencoder 동적 컴파일하기

MinGW의 GCC 컴파일러를 사용하여 Windows용 MPlayer와 Mencoder를 컴파일해 보자. MPlayer는 동영상을 보는 프로그램이고 Mencoder는 동영상이나 음악을 인코딩하는 프로그램이다. 예전에는 정적으로 컴파일하였지만 이번에는 동적으로 컴파일해 보자.


우선 MinGW를 설치한다. MPlayer는 FFmpeg 라이브러리에 의존하므로 먼저 FFmpeg 라이브러리를 동적으로 컴파일하도록 한다.


시작 메뉴를 열어 MinGW (rxvt)를 실행한다. 노란 창이 나타날 것이다. 그럼 다음과 같이 MPlayer와 의존 라이브러리를 컴파일하자.



  1. LZO 압축 라이브러리 컴파일 (옵션)

    tar xzvf lzo-2.03.tar.gz
    cd lzo-2.03/
    ./configure --prefix=/mingw
    make
    make install


  2. Fribidi 라이브러리 컴파일 (옵션)

    Fribidi는 아랍어와 히브리어의 표시에 필요하다. 솔직히 이 기능은 빠뜨려도 된다.

    tar xzvf fribidi-0.19.2.tar.gz
    cd fribidi-0.19.2/
    ./configure --prefix=/mingw --disable-debug
    make
    make install

    자세한 내용은 Fribidi에 관한 글을 참조.

  3. giflib 라이브러리 컴파일 (옵션)

    tar xjvf giflib-4.1.6.tar.bz2 
    cd giflib-4.1.6/
    ./configure --prefix=/mingw
    make
    make install


  4. Live555 라이브러리 컴파일 (권장)

    Live 라이브러리는 인터넷 동영상을 보는 데 쓰인다. live555.com에서 최신 버전을 받아 다음과 같이 컴파일한다:

    export CC=/mingw/bin/gcc.exe
    cd /mingw/lib/
    tar xzvf live.2010.04.01.tar.gz
    cd live/
    ./genMakefiles mingw
    make


  5. JPEG 라이브러리 컴파일 (권장)

    tar xzvf jpegsrc.v8a.tar.gz
    cd jpeg-8a/
    ./configure --prefix=/mingw
    make
    make install


  6. PNG 라이브러리 컴파일 (권장)

    tar xzvf libpng-1.4.1.tar.gz 
    cd libpng-1.4.1
    ./configure --prefix=/mingw
    make
    make install


  7. FreeType 라이브러리 컴파일 (필수)

    자막 표시에 필요하다.

    그리고 Freetype를 컴파일한다.

    tar xzvf freetype-2.3.12.tar.gz 
    cd freetype-2.3.12/
    ./configure --prefix=/mingw
    make install


  8. 만일 iconv 라이브러리가 설치되어 있지 않다면 컴파일한다. libXML2 그리고 fontconfig 에 필요하다.

  9. libXML2 컴파일

    만약에 fontconfig 라이브러리를 컴파일하려면 필요하다. 먼저 testThreads.c를 고친다.

    --- testThreads.c.orig  2009-09-11 18:09:00.268640135 +0200
    +++ testThreads.c 2009-09-11 18:12:43.412653512 +0200
    @@ -107,7 +107,7 @@

    for (i = 0; i < num_threads; i++) {
    results[i] = NULL;
    - tid[i] = (pthread_t) -1;
    + memset(&tid[i], 0, sizeof(pthread_t));
    }

    for (i = 0; i < num_threads; i++) {

    그리고 컴파일한다:


    ./configure --prefix=/mingw
    make install


  10. Fontconfig 라이브러리 컴파일 (권장)

    SSA 자막 표시에 필요하다.

    tar xzvf fontconfig-2.8.0.tar.gz 
    cd fontconfig-2.8.0/
    ./configure --prefix=/mingw
    make install


  11. Libcdio 컴파일 (옵션)

    tar xzvf libcdio-0.83.tar.gz 
    cd libcdio-0.83/
    ./configure --prefix=/mingw
    make
    make install


  12. Libdca 컴파일 (권장)

    tar xjvf libdca-0.0.5.tar.bz2 
    cd libdca-0.0.5/
    ./configure --prefix=/mingw
    make install


  13. DirectX 7 라이브러리 추출 (권장)

    cd /mingw/include/
    tar xzvf dx7headers.gz


  14. MPlayer, Mencoder 컴파일

    ffmpeg 소스를 받아서 mplayer 소스 디렉토리에 넣는다.

    tar xjvf mplayer-export-snapshot.tar.bz2

    cd mplayer-export-2011-11-25/

    tar xjvf ffmpeg-snapshot.tar.bz2

    CPPFLAGS='-DWIN32 -DHAVE_INT32_T' ./configure --prefix=/mingw --enable-runtime-cpudetection --enable-theora --enable-fribidi --disable-ffmpeg_a --yasm=/mingw/bin/yasm

    MPlayer를 컴파일하기 전에 config.mak를 텍스트 에디터(notepad.exe)로 수정한다.

    EXTRALIBS_MPLAYER  = -lgdi32 -lopengl32 -lwinmm -lfaac -lx264 -lmp3lame -lfribidi
    EXTRALIBS_MENCODER = -lfaac -lx264 -lfribidi -lmp3lame

    MPlayer 컴파일 시작한다.

    make

  15. MPlayer.exe와 Mencoder.exe를 복사한다.

    strip mencoder.exe mplayer.exe
    cp -iv m*.exe /mingw/bin

Sunday, April 4, 2010

Using MPlayer & Mencoder to Rip Blu-ray

Blu-ray discs require new and powerful CPU and graphics card to play high-definition movies on them. Although MPlayer is not yet suitable for playing Blu-ray discs, Mencoder can be used to rip Blu-ray discs in a more watchable format so that you can watch the movie on your average computer, laptop, iPod or iPad. I blogged previously on using Mencoder to rip DVD. Ripping Blu-ray isn't much different from ripping DVD.


Since Blu-ray discs are encrypted, you need to use DumpHD, Clown_BD or AnyDVD HD to dump the contents of your Blu-ray disc to your hard drive prior to ripping it. If you have Slysoft AnyDVD HD installed, right-click on the red fox icon on the right side of the taskbar, and choose Rip Video DVD to Harddisk from the menu. Then, specify the location where you want to save unencrypted Blu-ray contents. Note that you'll need more than 20GB free space.



After saving the huge amount of Blu-ray contents, open Command Prompt and type mplayer commands to play the Blu-ray movie. Here are some examples:



  • VC-1 video and AC-3 audio

    mplayer E:\BDMV\STREAM\00024.m2ts -vo directx:accel -vc ffvc1 -ao dsound -ac ffac3 -aid 4352 -framedrop

  • H.264 video and AC-3 audio

    mplayer E:\BDMV\STREAM\00024.m2ts -vo directx:accel -vc ffh264 -ao dsound -ac ffac3 -aid 4352 -framedrop

  • MPEG video and AC-3 audio

    mplayer E:\BDMV\STREAM\00024.m2ts -vo directx:accel -vc ffmpeg12 -ao dsound -ac ffac3 -aid 4352 -framedrop


To find available audio tracks, type the -identify option for mplayer to create a log file and look for AUDIO_ID strings.


mplayer 00024.m2ts -vo direct3d -vc ffvc1 -vf cropdetect -ss 180 -identify > log.txt


To encode the Blu-ray video with H.263 codec and resize it to 768x432 screen at the same time, the mencoder command would be like:


mencoder 00024.m2ts -o film.h264 -of rawvideo -oac copy -vf scale=768:432,harddup -ofps 24000/1001 -vc ffvc1 -ovc x264 -x264encopts bitrate=1200:subq=4:bframes=3:b_pyramid=normal:weight_b:pass=1:turbo=1

My second-pass mencoder command would be:


mencoder 00024.m2ts -o film.264 -of rawvideo -oac copy -vf scale=768:432,harddup -ofps 24000/1001 -vc ffvc1 -ovc x264 -x264encopts bitrate=1200:8x8dct:me=umh:frameref=4:bframes=3:b_pyramid=normal:weight_b:pass=2:trellis=1:psnr


I like to convert 5.1-channel AC3 audio to 6-channel AAC sound.


mplayer 00024.m2ts -vo null -vc null -aid 4352 -ao pcm:fast:file=audio-en-51.pcm -ac ffac3 -channels 6
faac --mpeg-vers 4 -q 108 -c 16800 -I 2,6 audio-en-51.pcm


Finally, let's put together a Matroska package from the video and audio


mkvmerge --title "Le Film" --default-language fr --chapters Chapters.txt -o le_film.mkv --track-name 0:"Video_Title" --default-duration 0:23.976fps --display-dimensions 0:768x432 --noaudio film.264 --default-track 0 --language 0:fr audio-fr-51.aac

윈도용 MPlayer / Mencoder 사용 및 설정

MinGW로 컴파일한 MPlayer를 시험해 보고 최적으로 설정해 보자. 다음은 내가 컴파일한 MPlayer와 Mencoder이다. bzip2.exe로 압축을 풀어야 한다(bzip2 -d mplayer.exe.bz2).





  1. DirectX 8.1 설치(Windows 95/98/ME Only)


    업데이트: Windows 98/ME 사용자도 아래의 DirectX 9.0c를 설치할 수 있다. 만일 DirectX 9을 설치할 경우, DirectX 8.1을 설치할 필요가 없게 된다.


    Windows 98/ME 사용자는 DirectX 8.0a, DirectX 8.1b 혹은 DirectX 8.2를 받아서 설치해야 MPlayer가 제대로 작동한다. 다음은 다운로드 링크를 여러 군데 모은 것이다.



    DirectX 8.1는 Windows XP에 포함되어 있다.



  2. DirectX 9.0c 설치


    MPlayer의 최신 개발 코드는 기본적으로 DirectX 9와 링크되도록 되어 있다. 그러므로 이렇게 만든 mplayer.exe 실행 파일을 Windows 98/ME/XP에서 실행하면 DirectX 9를 못 찾고 오류가 발생할 수가 있다. 이러한 오류를 방지하기 위해 MPlayer를 configure 할 때 --disable-direct3d 옵션을 주어서 DX9 링크 못하게 할 수 있다. 그렇지 않으면 filehippo.com에서 DirectX 9.0c 2006년 12월 릴리스를 받아서 설치해야 한다.



  3. MPlayer의 간단한 명령행 도움말


    mplayer.exe를 처음 실행하면 검은 콘솔 창이 나타나 아래처럼 짧은 도움말이 나온다.


    MPlayer SVN-r29464-snapshot-3.4.5 (C) 2000-2009 MPlayer Team
    Usage: mplayer [options] [url|path/]filename

    Basic options: (complete list in the man page)
    -vo select video output driver ('-vo help' for a list)
    -ao select audio output driver ('-ao help' for a list)
    vcd:// play (S)VCD (Super Video CD) track (raw device, no mount)
    dvd:// play DVD title from device instead of plain file
    -alang/-slang select DVD audio/subtitle language (by 2-char country code)
    -ss seek to given (seconds or hh:mm:ss) position
    -nosound do not play sound
    -fs fullscreen playback (or -vm, -zoom, details in the man page)
    -x -y set display resolution (for use with -vm or -zoom)
    -sub specify subtitle file to use (also see -subfps, -subdelay)
    -playlist specify playlist file
    -vid x -aid y select video (x) and audio (y) stream to play
    -fps x -srate y change video (x fps) and audio (y Hz) rate
    -pp enable postprocessing filter (details in the man page)
    -framedrop enable frame dropping (for slow machines)

    Basic keys: (complete list in the man page, also check input.conf)
    <- or -> seek backward/forward 10 seconds
    down or up seek backward/forward 1 minute
    pgdown or pgup seek backward/forward 10 minutes
    < or > step backward/forward in playlist
    p or SPACE pause movie (press any key to continue)
    q or ESC stop playing and quit program
    + or - adjust audio delay by +/- 0.1 second
    o cycle OSD mode: none / seekbar / seekbar + timer
    * or / increase or decrease PCM volume
    x or z adjust subtitle delay by +/- 0.1 second
    r or t adjust subtitle position up/down, also see -vf expand

    * * * SEE THE MAN PAGE FOR DETAILS, FURTHER (ADVANCED) OPTIONS AND KEYS * * *


    mplayer -vo help 명령은 다음과 같이 어떤 화면 출력 장치가 사용 가능한지 보여 준다.


    MPlayer SVN-r29464-snapshot-3.4.5 (C) 2000-2009 MPlayer Team
    Available video output drivers:
    directx Directx DDraw YUV/RGB/BGR renderer
    direct3d Direct3D 9 Renderer
    gl X11 (OpenGL)
    gl2 X11 (OpenGL) - multiple textures version
    winvidix WIN32 (VIDIX)
    cvidix console VIDIX
    null Null video output
    mpegpes MPEG-PES file
    yuv4mpeg yuv4mpeg output for mjpegtools
    png PNG file
    jpeg JPEG file
    gif89a animated GIF output
    tga Targa output
    pnm PPM/PGM/PGMYUV file
    md5sum md5sum of each frame

    mplayer -ao help 명령은 어떤 음향 출력 장치가 사용 가능한지 보여 준다.


    MPlayer SVN-r29464-snapshot-3.4.5 (C) 2000-2009 MPlayer Team
    Available audio output drivers:
    dsound Windows DirectSound audio output
    win32 Windows waveOut audio output
    mpegpes MPEG-PES audio output
    null Null audio output
    pcm RAW PCM/WAVE file writer audio output


  4. MPlayer 시험


    일단 명령 프롬프트(cmd.exe)나 실행 대화창(Run...)에서 다음과 같은 명령을 입력하여 MPlayer를 테스트해 보자. 위에 보이는 -vo 도움말과 -ao 도움말을 참고하여 자신의 시스템에 가장 알맞은 옵션을 찾아 보자.


    mplayer -vo direct3d -ao dsound -font C:\WINDOWS\FONTS\Tahoma.ttf -framedrop mymoviefile.avi

    또는 좀 느리지만 기본적인 출력 장치로 GL과 win32를 사용해 볼 수 있다.


    mplayer -vo gl -ao win32 Bear.wmv

    샘플 동영상 파일은 인터넷에서 검색하여 받도록 한다. Vista와 Windows 7 사용자는 C:\Users\Public\Videos\Sample Videos 폴더에 있는 샘플 동영상 파일로 MPlayer를 테스트해 볼 수 있다.



  5. MPlayer 설정


    처음으로 MPlayer를 실행하기 전에 HOME 환경변수를 정하여 자신의 폴더를 정해 준다. 그리고 MPlayer를 처음으로 더블클릭하면 사용자의 %HOME% 디렉토리에 “mplayer”라는 폴더가 생기고 그 안에 "config"라는 파일이 있다. "config" 파일에 다음과 같이 설정 사항을 적는다:



    # Write your default config options here!
    cdrom-device=D:
    dvd-device=D:
    ao=dsound
    vo=direct3d
    font=C:\WINDOWS\FONTS\MALGUN.TTF
    framedrop=yes
    subcp=cp949

    Windows 98/ME 사용자는 화면 출력 장치 설정으로 vo=direct3d 대신에 vo=directx 또는 vo=directx:noaccel 라고 적어야 한다. directx:noaccel은 가속 기능이 없는 DirectDraw 출력 장치인데 화면 출력에 문제가 있을 경우에 사용한다.



  6. MPlayer 코덱


    MPlayer 코덱을 받는 게 좋다. 파일 이름은 windows-essential-20071007.zip이다. 압축을 풀면 "windows-essential-20071007" 폴더가 나오는데 "codecs"으로 이름을 바꾸어 mplayer.exe가 있는 폴더로 옮기도록 한다.


    또한, MPlayer 소스의 etc 디렉토리에 codecs.conf 파일이 있을 것이다. 이것을 사용자의 mplayer 폴더에 복사해 놓는다. 그리고 mplayer를 실행하면 메시지 첫머리에 다음과 같이 코덱 숫자가 표시된다.


    MPlayer SVN-r29464-snapshot-3.4.5 (C) 2000-2009 MPlayer Team
    138 audio & 299 video codecs
    Usage: mplayer [options] [url|path/]filename

    이제 다음 명령어를 실행하면 mplayer 코덱에 관한 정보가 나올 것이다.


    mplayer -vc help
    mplayer -ac help


  7. 다음처럼 동영상을 볼 수 있다:

    mplayer mymoviefile.avi > C:\Windows\Temp\error.txt

    이제 남은 일은 SMPlayer를 받아서 MPlayer 인터페이스로 설정하는 것이다.


Friday, April 2, 2010

MP4Box Usage

To package a MPEG-4 Video


Wrap up the raw H.264 video along with chapters inside a MPEG-4 container.


MP4Box -add video.264 -chap chapters.txt -fps 23.976 film.m4v


To Find Info on the First Track inside a .M4V file


MP4Box -info 1 movie.m4v


To Extract H.264 Video from a .M4V file


MP4Box -raw 1 movie.m4v


To Extract AAC audio from M4A file


Use MP4Box to extract AAC audio from a .M4A file like this:


MP4Box -raw 1 music.m4a

Thursday, April 1, 2010

윈도용 MPlayer와 Mencoder 정적 컴파일

Windows에서 MPlayer/Mencoder를 컴파일하려면 MinGW 컴파일러가 필요하다. 이 글을 읽고 MinGW를 설치하도록 한다. 이 글은 정적 실행 파일(특별한 DLL에 의존하지 않는 단일 프로그램)을 생성하기 위해 쓰여졌다. 동적 실행 파일을 만들려면 이 글을 읽기 바란다.



시작 메뉴에서 MSYS (rxvt)를 오른쪽 클릭하여 관리자로 실행한다. Windows Vista와 Windows 7에서 문제 없이 컴파일하기 위함이다.




  1. LZO 라이브러리는 빠른 압축 기능으로 순수 비디오를 압축하는 데 쓰인다.

    tar xzvf lzo-2.03.tar.gz
    cd lzo-2.03
    ./configure --prefix=/mingw
    make
    make install

  2. Zlib는 압축 헤더가 붙은 몇몇 mov 파일을 보기 위해 필요하다. zlib.net에서 소스를 받아 컴파일한다:

    cd ~

    tar xjvf zlib-1.2.4.tar.bz2

    cd zlib-1.2.4

    ./configure --prefix=/mingw

    make

    make install


  3. PNG 이미지 라이브러리


    영화 보는 데 PNG 라이브러리가 왜 필요한지 궁금할 것이다. 가끔 영화의 인상적인 부분을 한 장면 한 장면 사진으로 저장하고 싶을 때 쓸 수 있다. PNG 라이브러리 소스를 받아 컴파일하자:


    cd ~
    tar xzvf libpng-1.4.1.tar.gz
    cd libpng-1.4.1/
    ./configure --prefix=/mingw --disable-shared
    make
    make install


  4. Freetype 및 Iconv 라이브러리


    Freetype은 자막 표시에 필요하다. iconv 라이브러리에 의존하므로 먼저 iconv 소스를 받아 컴파일하자:


    cd ~

    tar xvzf libiconv-1.13.1.tar.gz

    cd libiconv-1.13.1

    ./configure --prefix=/mingw --disable-shared

    make

    make install

    그런 다음, Freetype2를 받아 컴파일한다:


    cd ~

    tar xzvf freetype-2.3.12.tar.gz

    cd freetype-2.3.12

    ./configure --prefix=/mingw --disable-shared

    make

    make install


  5. Fontconfig 라이브러리는 SSA 자막 표시에 필요하다. expat 라이브러리에 의존하므로 먼저 expat 라이브러리를 컴파일하자.

    cd ~
    tar xzvf expat-2.0.1.tar.gz
    cd expat-2.0.1/
    ./configure --prefix=/mingw --disable-shared
    make install

    그리고 fontconfig 라이브러리를 컴파일한다.

    cd
    tar xzvf fontconfig-2.8.0.tar.gz
    cd fontconfig-2.8.0/
    ./configure --prefix=/mingw --disable-shared
    make install


  6. Libcdio 소스를 여기서 받아 컴파일하고 설치하자.

    tar xzvf libcdio-0.81.tar.gz

    cd libcdio-0.81

    ./configure --prefix=/mingw --disable-shared

    make

    make install


  7. Libogg, Libvorbis, speex, Theora 컴파일


    libogg, libvorbis, speex 그리고 theora 라이브러리 모두 xiph.org에서 받아 다음과 같이 컴파일하자:


    ./configure --prefix=/mingw --disable-shared

    make

    make install


  8. DirectX 헤더를 아래의 위치에서 받아서:


    MinGW의 include 폴더(예를 들어, C:\MinGW\include)에 압축을 푼다.



  9. MPlayer 정적 컴파일을 위한 configure 명령


    pkg-config.exe와 yasm.exe를 받아서 /mingw/bin에 저장한다. MPlayer 소스를 받아서 풀자:


    tar xjvf mplayer-export-snapshot.tar.bz2
    cd mplayer-export-2009-08-02/

    다음과 같이 configure 명령어를 입력한다.


    ./configure --prefix=/mingw --enable-runtime-cpudetection --enable-static --enable-theora --disable-vidix --yasm=/mingw/bin/yasm


  10. configure가 끝나면 config.mak를 열어서 손보자. MPlayer.exe를 실행할 때 검은 로그 창이 나타나는 현상을 원하지 않는다면 EXTRALIBS_MPLAYER= 행에 -mwindows 추가하도록 한다:

    EXTRALIBS_MPLAYER =  -mwindows -lopengl32 -lgdi32 -lwinmm -ld3d9 -lfaac -lx264 -lmp3lame


  11. MPlayer/Mencoder 컴파일


    드디어 MPlayer 컴파일을 시작한다.


    make

    컴파일이 성공적으로 끝나면 mplayer.exe 그리고 mencoder.exe 두 개의 파일이 생긴다. strip 명령을 쓰면 실행 파일의 크기를 약간 줄일 수 있다.


    strip m*.exe

    UPX로 압축한다.


    upx --best --strip-relocs=0 mplayer.exe
    upx --best --strip-relocs=0 mencder.exe

    가령, C:\Program Files로 복사하도록 한다.


    cp -iv m*.exe /c/Program\ Files



mplayer.exe와 mencoder.exe 두 개의 실행 파일이 성공적으로 만들어졌으니, 이제 MPlayer를 테스트하고 설정하는 일이 남았다.

About This Blog

KBlog logo This blog is about current events and issues concerning general population. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

icon
Powered By Blogger