Notes

Compiling live555 with vlc (tried it on Ubuntu)

  1. compile ffmpeg to create shared libs.
    • ./configure --enable-shared --disable-static
    • make
    • make install.
    • You should find libavcodec and libavutil in /usr/lib and libavcodec.pc in /usr/local/lib/pkgconfig
  2. you should compile live555.
    • apt-get source liblivemedia-dev
    • dpkg-buildpackage -rfakeroot -uc -b (run inside the directory where the sources are downloaded. sources are downloaded into a new directory in the current directory by default)
    • cd ..
    • sudo dpkg -i <package created> (for example liblivemedia-dev_2008.07.25-2_i386.deb)
    • sudo dpkg -i <utils> (for example livemedia-utils_2008.07.25-2_i386.deb)
    • ldconfig
  3. Compile VLC
    • in the VLC source directory do "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"
    • ./configure --disable-glx --disable-fribidi --disable-skins2 --enable-live555  --enable-realrtsp --disable-remoteosd --enable-qt4
    • ./compile
    • rm -rf /usr/lib/vlc
    • make install
Setting-up a VLC-RTSP server (tried it on Ubuntu)
  1. open 3 windows
  2. in the first window type ./vlc --ttl 10 -vvv --color -I telnet --rtsp-host 127.0.0.1:5554
  3. in the second window type telnet 127.0.0.1 4212
    • the default password is admin
    • create a new vod entry called Test by typing new Test vod enabled
    • assign the file to be streamed to the vod entry by typing setup Test input <file path> 
  4. in the third window type vlc rtsp://127.0.0.1:5554/Test
Receive from AXIS camera and stream to a UDP port
/Applications/VLC.app/Contents/MacOS/VLC  rtsp://<CAMERA_IP>:554/mpeg4/media.amp --sout='#duplicate{dst=rtp{mux=ts,dst<DEVICE_IP>,port=9999}}'

Ctags: tags file not sorted
  1. use "set ignorecase" in gvim
Whats in a .so on mac os x
  1. lipo -info xx.so

MPEG4 decoder in FFMPEG
  1. s->decode_mb=mpeg4_decode_mb(function pointer) in mpeg4videodec.c : entry into macroblock decoding loop  
Passing class function to pthread_create
(1)
template<class TH, void(TH::*bar)(void *)>
void* thx(void* p) {
    (static_cast<TH*>(p)->*bar)(p);
    return 0;
}

Class X {
    void foo(void *val);
}

void X::foo(void *k){
}

pthread_create(&thread_id,&threadattr,thx<X,&X::foo>,(void *)&var);
(2)
struct threadParams{
    void * instance;
    int val;
};
void* start_thread(void* arg) {
    struct threadParams *thx=(struct threadParams *)arg;
    static_cast<Streamer*>(thx->instance)->bar(thx->val);
}
Class Streamer{
    void foo();
    void bar(int x);
}
void Streamer::foo(){
    struct threadParams thx;
    thx.instance =this;
    thx.val=10;   
    pthread_create(&thpool,&threadattr,start_thread,&thx);

}

Bubble sort exercise in CUDA

Not a perfect and professional implementation. Hopefully serves as an example for programming using the NVIDIA GPU.
Recursion and dynamic memory allocation on the GPU from within the "device" code not supported by the GPU.
Hence using an in-memory sort without recursion. Source code is found at the end of the page as attachments.
  • Create 2 blocks with 2 threads each
  • The array of numbers is partitioned into 4 sets. first 2 sets are sorted in parallel on the first block (2 threads), second 2 sets are sorted in parallel on the second block (2 threads).
  • first 2 sorted lists and second 2 sorted lists are reordered as a binary heap in parallel (2 threads)
  • the two binary heaps are once again reordered as a binary heap by merging (1 thread)
  • the output is a binary heap and not the fully sorted list of numbers
Č
ċ
ď
cuda_bubble_sort.tar.gz
(13k)
indram indram,
Oct 5, 2011 8:16 PM
ċ
ď
kld_optimization.pdf
(139k)
indram indram,
Mar 8, 2010 9:04 PM