-
Recent Posts
Recent Comments
Archives
Categories
Meta
Category Archives: Uncategorized
How to avoid core dump when exiting the process in linux/unix
Sometimes in an application, we want to exit the process forcefully (no graceful termination), but do not want the core dump to be generated. One example could be a service that is being monitored by “monit” and if killed is … Continue reading
Posted in Uncategorized
Tagged application, core dump, exit, linux, multithreading, process, SIGKILL, signal, thread, unix
Leave a comment
boost multithreading and shared mutex example: multiple reader, multiple writer
Here is a simple example of boost multithreading and shared mutex. Hope it helps. The code is quite simple and self explanatory: #include <iostream> #include <boost/thread.hpp> #include <boost/date_time.hpp> boost::shared_mutex g_mutex; using namespace std; void reader(string id) { cout << id … Continue reading
Posted in Uncategorized
Tagged boost, lock, multithreading, mutex, shared_mutex, thread
Leave a comment
FFmpeg sample to decode video using libavformat API
Here is a very simple example to use libavformat and libavcodec library API to decode video: // ffmpeg_sample.c // Date: Sep 05, 2013 // Code based on a https://raw.github.com/phamquy/FFmpeg-tutorial-samples/master/tutorial01.c // Tested on CentOS 5.7, GCC 4.1.2,FFMPEG 0.10.1 // libavcodec.so.53.60.100 libavdevice.so.53.4.100 … Continue reading
Posted in Uncategorized
Tagged avcodec, avformat, avformat API, example, ffmpeg, ffmpeg 10.0.1, libavcodec, libavformat, sample
Leave a comment
View Y frames in Linux using mplayer
To view a file with only Y frames, following command can be used on Linux to view the frames: mplayer -demuxer rawvideo -rawvideo w=[LINESIZE]:h=[HEIGHT]:format=y8 in.raw -loop 0 To view all the formats available for rawvideo: mplayer -rawvideo format=help Reference: mplayer … Continue reading
Writing Simple HTTP Server in Python (With REST and JSON)
There are many already existing powerful http servers that can be used in python e.g. gevent, twisted web server. However, they are a bit complex to use and you cannot start them in a thread other than the main thread. … Continue reading
Posted in Uncategorized
11 Comments
linux bash: login vs non-login shell
I always had confusion about login vs non-login shell and today decided to clear this up. Here is what I have understood. Please refer to the following site for more explanation. Reference: http://www.linuxfromscratch.org/blfs/view/cvs/postlfs/profile.html When a user starts The shell program /bin/bash (hereafter referred … Continue reading
Posted in Uncategorized
Tagged bash, difference, interactive, linux, login, non-login, shell
2 Comments
FFMPEG stops receiving multicast stream after group membership lost
Recently I came across an issue under CENTOS 5.7 kernel 2.6.18 regarding multicast group membership. I was using ffmpeg 0.10 to receive udp stream over multicast sockets. There happened some disruption in the network and ffmpeg stopped receiving any incoming … Continue reading
Checking multicast group membership
Following code can be used to check multicast group member under Linux. This code is only for ipv4, but can be extended for ipv6. Note: I have used netstat source as a reference to write this code. #define PATH_PROCNET_IGMP “/proc/net/igmp” … Continue reading
How to compile VLC media player source on Ubuntu 10.10 Maverick
Recently I compiled VLC media player source in my Ubuntu 10.10 Maverick. Although there is an online documentation available at “http://wiki.videolan.org/UnixCompile”, yet I faced many dependencies problems during compilation. So, I decided to document most of those issues. The whole … Continue reading
Posted in Uncategorized
3 Comments