Links

   Quran Explorer - Interactive Audio Recitations & Translations

Monday, January 24, 2011

FFMPEG - Multimedia Tool

FFmpeg is a free software/open source project that produces libraries and programs for handling multimedia data. It ships with Fedora Linux so I naturally took a dive and have never turned back.....

I normaly use it to convert multimedia files from one format to another. Being a command line tool u expect faster execution.

For example
Convert from MP4 to AVI

#ffmpeg -i inputfile.mp4 outfile.avi


To See Supported File Formats
#ffmpeg -formats

You will get output similar to this
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration:
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
built on Nov 20 2009 15:52:49, gcc: 4.3.2 20081105 (Red Hat 4.3.2-7)
File formats:
E 3g2 3GP2 format
E 3gp 3GP format
DEA wmav1 Windows Media Audio 1
DEA wmav2 Windows Media Audio 2
DEVSD wmv1 Windows Media Video 7
DEVSD wmv2 Windows Media Video 8
D V wmv3 Windows Media Video 9
DES dvbsub DVB subtitles
DES dvdsub DVD subtitles
DEV D dvvideo DV (Digital Video)
D V dxa Feeble Files/ScummVM DXA
D V D eacmv Electronic Arts CMV video
D V D eatgq Electronic Arts TGQ video
D V eatgv Electronic Arts TGV video
D V D eatqi Electronic Arts TQI Video
D V D escape124 Escape 124
.........To mention but a few



XOR in Oracle

I had a situation where an XOR implementation was needed in a SELECT query. Since Oracle 10g doesnt have this operator predefined i did some gymnastics and ended up with this solution.

I decided to share this (among others) since human knowledge belongs to mankind

1. XOR in oracle

Example 1 - chars only

Eg we want to display results where ismale='1' XOR iscitizen='1' (ie either but not both)

Solution
SELECT ismale, iscitizen, (ismale + iscitizen) as xor
FROM tablename
WHERE ismale + iscitizen = 1;

NB: oracle will add(mathematical) chars as it would integers

Example 2 - varchars

Eg we want to display results where gender='male' XOR countryid='KE' (ie either but not both)

Solution
SELECT gender, countryid, (decode(gender,'male','1','0') + decode(countryid,'KE','1','0')) as xor
FROM tablename
WHERE (decode(gender,'male','1','0') + decode(countryid,'KE','1','0')) = 1;

NB: oracle will add chars as it would integers