'2010/06'에 해당되는 글 3건

  1. 2010.06.10 x.inf contains DirIDs, which are not supported 1
  2. 2010.06.04 ffmpeg build 1
  3. 2010.06.03 VP8 And FFmpeg 1

x.inf contains DirIDs, which are not supported

http://blogs.msdn.com/b/raffael/archive/2008/03/18/x-inf-contains-dirids-which-are-not-supported.aspx

Since looking around over the web I didn't find any reference to this particular case, I think it's worth writing it here. I tracked down this issue recently together with a developer that wanted to package "many" files within a single .CAB (1000+). He was using a quite old version of CabWiz.exe, launched through an application he wrote. So, as the initial troubleshooting step, I tried to reproduce the issue with the CabWiz.exe shipped with Visual Studio 2008: same problem.

Above all, this error can arise from CabWiz (which is internally invoked by VS2008 when creating Smart Device CAB Projects) also if you're using '%' in registry keys, as my friend Chris reported in his How to avoid hardcoding file paths within CAB file registry settings, in order to add registry values that refer to the location of files installed as part of the application.

So I thought: ok, he's hitting the known limit of 998 files that could be packaged in a CAB... Wrong: the problem happened also when using much less files, say 300... I'm still talking about C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\CabWiz.exe, version 4.0.4332.0.

After running some tests, I reached a magic number: 262. With 262 files VS2008 could create a Smart Device CAB successfully, with 263 files it gave error "x.inf contains DirIDs, which are not supported". At this point I noticed that in the .INF file that VS2008 creates and gives to CabWiz.exe, it wrote an entry under [DestinationDirs] for each added file, even if the target folder on the device is the same, as it was in my case. By manually editing the INF (using some applications that automated lines-creation...), I could successfully create a CAB for 263+ files, specifying only one entry under [DestinationDirs]. So, another limit I wasn't aware of is: VS2008's CabWiz can parse up to 262 different entries under [DestinationDirs].

Now: Windows Mobile 6 SDKs ship with a newer version of CabWiz.exe, v4.5.5102.0 and, very interestingly, it overcame not only the limitation about 998 files, but also the one about 262 entries under [DestinationDirs]. So the "simple" solution in this case was to download one of the 2 Windows Mobile 6 SDKs and use that CabWiz.exe (C:\Program Files\Windows Mobile 6 SDK\Tools\CabWiz).

Playing with files under C:\Program Files\Microsoft Visual Studio 9.0 is not recommended (and probably "not supported"), however for testing purposes I replaced C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\CabWiz.exe and CabWiz.ddf with the ones under C:\Program Files\Windows Mobile 6 SDK\Tools\CabWiz, and now my VS2008 can continue creating one entry under [DestinationDirs] for each file, independently if the target folder will the be same, but now it successfully creates the CAB. I imagine there are still some limits, but this may be a topic of another post... Smile

Cheers,

~raffaele

'Computing' 카테고리의 다른 글

iphone opengl camera ar  (1) 2011.05.18
https in java, android  (1) 2010.12.08
ffmpeg build  (1) 2010.06.04
VP8 And FFmpeg  (1) 2010.06.03
DDS 자료  (0) 2010.05.14

ffmpeg build

http://alvastro.tistory.com/86

ffmpeg compile
OS : Fedora core 8
kernel : 2.6.26.8-57.fc8
외부 코덱 라이브러리 설치 위치 /usr/alvastro/extras
ffmpeg 설치 위치 /usr/alvastro/ffmpeg
외부코덱 라이브러리 패키지 PATH 지정
export PKG_CONFIG_PATH=/usr/alvastro/extras/lib/pkgconfig:$PKG_CONFIG_PATH

faad2 compile
wget http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz
./configure --prefix=/usr/alvastro/extras --enable-shared --enable-static
make ; mak install

faac-1.28 compile
wget http://downloads.sourceforge.net/faac/faac-1.28.tar.gz
./configure --prefix=/usr/alvastro/extras --enable-shared --enable-static
make ;make install

libmpeg2 compile
wget http://libmpeg2.sourceforge.net/files/libmpeg2-0.5.1.tar.gz
./configure --prefix=/usr/alvastro/extras --enable-shared --enable-static
make;make install

speex를 컴파일 할때 libogg를 포함한다.
libogg
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
./configure --prefix=/usr/alvastro/extras --enable-shared --enable-static
make;make install

speex
wget http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz
./configure --prefix=/usr/alvastro/extras --enable-shared --enable-static --with-ogg=/usr/alvastro/extras
make ;make install

libvorbis
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz
./configure --prefix=/usr/alvastro/extras --enable-shared --enable-static --with-ogg=/usr/alvastro/extras
make;make install

yasm for libx264
wget http://www.tortall.net/projects/yasm/releases/yasm-0.7.2.tar.gz
컴파일해도 안된다. ㅡㅡ;; asm은 패스 ;;
asm이 없으면 h.264로 엔코딩할때 시간이 많이 걸린다고 한다..

gpac for libx264
wget http://downloads.sourceforge.net/gpac/gpac-0.4.5.tar.gz
./configure --prefix=/usr/alvastro/extras --enable-shared --enable-static --disable-opengl
make clean;make
일단 opengl이 필요없으므로 컴파일하지 않는다..
cp -a bin/gcc/libgpac_static.a /usr/alvastro/extras/lib/
cp include -apR /usr/alvastro/extras/include

libx264
git clone git://git.videolan.org/x264.git
./configure --prefix=/usr/alvastro/extras --disable-asm --enable-shared --enable-mp4-output --extra-ldflags=-L/usr/alvastro/extras/lib --extra-cflags=-I/usr/alvastro/extras/include
make;make install

xvidcore
wget http://downloads.xvid.org/downloads/xvidcore-1.2.1.tar.gz
cd build/generic
./configure --prefix=/usr/alvastro/extras
make;make install

libmp3lame
wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz
./configure --prefix=/usr/alvastro/extras --enable-shared --enable-static
make;make install

libtheora
wget http://downloads.xiph.org/releases/theora/libtheora-1.0.tar.bz2
http://downloads.xiph.org/releases/theora/libtheora-1.0.tar.bz2
./configure --prefix=/usr/alvastro/extras --enable-shared --enable-static
make;make install

ffmpeg 컴파일
ffmpeg는 이 글을 쓰는 날 git로 받은 파일이다.. ffmpeg의 소스 버전에 따라서 컴파일 방법이 다를수 있다.
Source down Date : 2009 03 05
version : SVN-r17822
configure 실행 스크립터 만들기..
vi alvastro-ffmpeg.sh
#내용
./configure --prefix=/usr/alvastro/ffmpeg \
        --enable-static \
        --enable-shared \
        --enable-gpl \
        --enable-postproc \
        --enable-avfilter \
        --enable-libmp3lame \
        --enable-libx264 \
        --enable-libxvid \
        --enable-libfaac \
        --enable-libfaad \
        --enable-libspeex \
        --enable-libvorbis \
        --enable-libtheora \
        --extra-cflags=-I/usr/alvastro/extras/include \
        --extra-ldflags=-L/usr/alvastro/extras/lib \
chmod 777 alvastro-ffmpeg.sh
sh alvastro-ffmpeg.sh
make ; make install

실행 시 라이브러리 패스.
cd /usr/alvastro/ffmpeg/bin
export LD_LIBRARY_PATH=/usr/alvastro/extras/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/alvastro/ffmpeg/lib:$LD_LIBRARY_PATH
./ffplay -stats media.avi
실행 확인

참고사이트
http://ubuntuforums.org/showthread.php?t=786095
ffmpeg를 이용하여 x264 엔코딩
cd /usr/alvastro/ffmpeg/bin
vi 264encode.sh

#!/bin/bash
# Two-Pass x264 Encoding Script
# Usage: ./264encode.sh input output.mp4
# Pass 1
./ffmpeg -y -i $1 -pass 1 -b 512k -bt 512k -vcodec libx264 -an -threads 0 -coder 1 -flags +loop -cmp +chroma -partitions -parti8x8-parti4x4-partp8x8-partp4x4-partb8x8 -me_method dia -subq 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 4 -refs 1 -directpred 3 -bidir_refine 0 -trellis 0 -flags2 -bpyramid-wpred-mixed_refs-dct8x8+fastpskip -f mp4 /dev/null
# Pass 2
./ffmpeg -y -i $1 -pass 2 -b 512k -bt 512k -vcodec libx264 -acodec libfaac -ab 128k -ac 2 -threads 0 -coder 1 -flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -me_method umh -subq 8 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 2 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 4 -refs 4 -directpred 3 -trellis 1 -flags2 +bpyramid+wpred+mixed_refs+dct8x8+fastpskip -f mp4 $2

chmod 777 264encode.sh
./264encode.sh input output.mp4

'Computing' 카테고리의 다른 글

https in java, android  (1) 2010.12.08
x.inf contains DirIDs, which are not supported  (1) 2010.06.10
VP8 And FFmpeg  (1) 2010.06.03
DDS 자료  (0) 2010.05.14
Apple iPod - iPhone dock Connector Pinout  (0) 2010.04.02

VP8 And FFmpeg

http://multimedia.cx/eggs/vp8-and-ffmpeg/

VP8 And FFmpeg

May 20th, 2010 by Multimedia Mike

Let’s take the VP8 source code (in Google’s new libvpx library) for a spin; get it to compile and hook it up to FFmpeg. I am hesitant to publish specific instructions for building in the somewhat hackish manner available on day 1 (download FFmpeg at a certain revision and apply a patch) since that kind of post has a tendency to rise in Google rankings. I will just need to remember to update this post after the library patches are applied to the official FFmpeg tree.

Statement of libvpx’s Relationship to FFmpeg
I don’t necessarily speak officially for FFmpeg. But I’ve been with the project long enough to explain how certain things work.

Certainly, some may wonder if FFmpeg will incorporate Google’s newly open sourced libvpx library into FFmpeg. In the near term, FFmpeg will support encoding and decoding VP8 via external library as it does with a number of other libraries (most popularly, libx264). FFmpeg will not adopt the code for its own codebase, even if the license may allow it. That just isn’t how the FFmpeg crew rolls.

In the longer term, expect the FFmpeg project to develop an independent, interoperable implementation of the VP8 decoder. Sometime after that, there may also be an independent VP8 encoder as well.

Building libvpx
Download and build libvpx. This is a basic ‘configure && make’ process. The build process creates a static library, a bunch of header files, and 14 utilities. A bunch of these utilities operate on a file format called IVF which is apparently a simple transport method for VP8. I have recorded the file format on the wiki.

We could use a decoder for this in the FFmpeg code base for testing VP8 in the future. Who’s game? Just as I was proofreading this post, I saw that David Conrad has sent an IVF demuxer to the ffmpeg-devel list.

There doesn’t seem to be a ‘make install’ step for the library. Instead, go into the overly long directory (on my system, this is generated as vpx-vp8-nopost-nodocs-generic-gnu-v0.9.0), copy the contents of include/ to /usr/local/include and the static library in lib/ to /usr/local/lib .

Building FFmpeg with libvpx
Download FFmpeg source code at the revision specified or take your chances with the latest version (as I did). Download and apply provided patches. This part hurts since there is one diff per file. Most of them applied for me.

Configure FFmpeg with 'configure --enable-libvpx_vp8 --enable-pthreads'. Ideally, this should yield no complaints and ‘libvpx_vp8′ should show up in the enabled decoders and encoders sections. The library apparently relies on threading which is why '--enable-pthreads' is necessary. After I did this, I was able to create a new webm/VP8/Vorbis file simply with:

 ffmpeg -i input_file output_file.webm

Unfortunately, I can’t complete the round trip as decoding doesn’t seem to work. Passing the generated .webm file back into FFmpeg results in a bunch of errors of this format:

[libvpx_vp8 @ 0x8c4ab20]v0.9.0
[libvpx_vp8 @ 0x8c4ab20]Failed to initialize decoder: Codec does not implement requested capability

Maybe this is the FFmpeg revision mismatch biting me.

FFmpeg Presets
FFmpeg features support for preset files which contain collections of tuning options to be loaded into the program. Google provided some presets along with their FFmpeg patches:

  • 1080p50
  • 1080p
  • 360p
  • 720p50
  • 720p

To invoke one of these (assuming the program has been installed via ‘make install’ so that the presets are in the right place):

 ffmpeg -i input_file -vcodec libvpx_vp8 -vpre 720p output_file.webm

This will use a set of parameters that are known to do well when encoding a 720p video.

Code Paths
One of goals with this post was to visualize a call graph after I got the decoder hooked up to FFmpeg. Fortunately, this recon is greatly simplified by libvpx’s simple_decoder utility. Steps:

  • Build libvpx with --enable-gprof
  • Run simple_decoder on an IVF file
  • Get the pl_from_gprof.pl and dot_from_pl.pl scripts frome Graphviz’s gprof filters
  • gprof simple_decoder | ./pl_from_gprof.pl | ./dot_from_pl.pl > 001.dot
  • Remove the 2 [graph] and 1 [node] modifiers from the dot file (they only make the resulting graph very hard to read)
  • dot -Tpng 001.dot > 001.png

Here are call graphs generated from decoding test vectors 001 and 017.

Like this, only much larger and scarier (click for full graph)

It’s funny to see several functions calling an empty bubble. Probably nothing to worry about. More interesting is the fact that a lot offunction_c() functions are called. The ‘_c’ at the end is important– that generally indicates that there are (or could be) SIMD-optimized versions. I know this codebase has plenty of assembly. All of the x86 ASM files appear to be written such that they could be compiled with NASM.

Leftovers
One interesting item in the code was vpx_scale/leapster. Is this in reference to the Leapster handheld educational gaming unit? Based on this item from 2005 (archive.org copy), some Leapster titles probably used VP6. This reminds me of finding references to the PlayStation in Duck/On2’s original VpVision source release. I don’t know of any PlayStation games that used Duck’s original codecs but with thousands to choose from, it’s possible that we may find a few some day.

'Computing' 카테고리의 다른 글

x.inf contains DirIDs, which are not supported  (1) 2010.06.10
ffmpeg build  (1) 2010.06.04
DDS 자료  (0) 2010.05.14
Apple iPod - iPhone dock Connector Pinout  (0) 2010.04.02
HwpCtrl 보안승인모듈 다운로드  (0) 2010.03.09
prev 1 next