<!– something random just like junk – yard –>

quick ffmpeg audio-video encoding usage help

Posted in LAMP, learning, linux, observation, opensource, tips, ubuntu by ganu on July 18, 2009

o from last 2-3 days I spent my so much time on file conversion with ffmpeg and mencoder.

After work done, I got some good links to follow for my future help and for all other readers.

The command what I tried for my use is like this

For High Quality and FFMPEG and libx264 vcodec i used this.

/usr/bin/ffmpeg -i /home/ganu/public_html/video/316.mp4
-b 1M -bt 4M -vcodec libx264 -pass 2 -vpre hq -acodec libfaac
-ac 2 -ar 44100 -ab 192k -threads 0 -s 552x311 -bufsize 200000000
-f flv -y /home/ganu/public_html/flvideo/316x.flv

Finally I used this this is working fine.

/usr/bin/ffmpeg -i /home/ganu/public_html/video/316.mp4
-r 30000/1001 -b 2M -bt 4M -acodec libfaac -ac 2
-ar 44100 -ab 192k -s 552x311 -f flv -y /home/ganu/public_html/flvideo/316x.flv
/usr/bin/ffmpeg -i /home/ganu/public_html/video/316.mp4
-f image2 -ss 00:00:1 -s 120x90 -vframes 2
-y /home/ganu/public_html/tmp/thumbs/316/%08d.jpg

For metadata injection i used like this.

/usr/bin/flvtool2 -Uv
/home/ganu/public_html/flvideo/316x.flv
/home/ganu/public_html/flvideo/316.flv

So first say the file 316.mp4 is converted to 316x.flv. And after flvtool2 the meta information is injected and final file will be 316.flv

So this is how, the flv conversion is done.

Happy Programming. :)

india startup tips in proto.in

Posted in india, learning, meetup, observation, tips by ganu on May 24, 2009

No , No I am not a strtup guy. I don’t have any thing to start now.

Yea but I can work for you. So if you have any thing to work/code/analyse/test/hack then let me know, that I can do that.

Yesterday I was watching the Official proto.in video channel and after so many days I liked the talk given my Mr. Mahesh Murthy. I really got some energy to think more for some idea and work for it. Let see.

Here i am summarizing the points what he mentioned in his talk, that will be helpful for me and other in future.

  • If you have a product in your mind don’t even bother just go ahead. Your idea is your idea and if you think is good then just go ahead.
  • Price – Price of the product is your weapon.
    • Never give lesser price to your product. Analyze the price and give the competitive price of your product. Your price would give the tension to your competitor.
    • He gave good example that if you are 20 person company then by lesser price you can never catch a 2000 person company, they will be
      always ahead.
    • Only competitive price will give tension to the opposite party.
  • User Interface – UI should be good. No compromise with UI.
    • bad, crappy UI shows the cheapness in your product.
    • Good UI will give good competition.
  • Customers – Getting customers/users for your site.
    • Any startup look for first 100 customers. If they are with feel-good-fector then automatically 100 will converted to 100*n times.
    • Get your customers/users from confs/events/get-together. At these places you can adv your product free of your cost.
    • For paid confs/events, represent your self as speaker so your will get free entry. :)
  • Marketing – He gave one statement, sorry I dont understant that.
    • Not necessary that more budget will give more success.
    • “Competence is a marketer, is inversely proportional to your marketing budget.” I really don’t understood this. :(
    • “More the budget is less the brain”. :)
  • Be the Master
    • Be the master in your field.
    • Do some research in your field and you should be thought leader in your field.
  • Don’t follow the trends
    • You can almost never be successful by following the trend.
    • Trend is like end.

Wow, what a nice talk, you can get/see/watch/listen more talk on Official proto.in video channel.

Till then I will collect more talk and summarize this for you all and for me too. :)

Happy Startup. :P

Symfony Criteria for table alias with join of same table

Posted in LAMP, learning, opensource, programming by ganu on March 31, 2009

Symfony Criteria for table alias and join a quick example.

Yesterday got a good situation, A kind of join with same table and with table alias.
I need to use the first query with symfony criteria.

I got this, hope this will be usefull to you too.

SELECT u1.USR_FNAME AS a, u1.USR_LNAME AS b, u2.USR_FNAME AS c, u2.USR_LNAME AS d, u3.USR_FNAME AS e, u3.USR_LNAME AS f
FROM tbl_test
LEFT JOIN tbl_users u1 ON ( tbl_test.TEST_USER1_ID = u1.USR_ID )
LEFT JOIN tbl_users u2 ON ( tbl_test.TEST_USER2_ID = u2.USR_ID )
LEFT JOIN tbl_users u3 ON ( tbl_test.TEST_USER3_ID = u3.USR_ID )
ORDER BY tbl_test.TST_ID ASC
LIMIT 10
$c = new Criteria();
   	$c->clearSelectColumns();
   	$c->addAlias('u1','tbl_users');
   	$c->addAlias('u2','tbl_users');
    $c->addAlias('u3','tbl_users');
   	$c->addSelectColumn(TblProjectPeer::TST_NAME);
   	$c->addAsColumn('a','u1.USR_FNAME');
   	$c->addAsColumn('b','u1.USR_LNAME');
    $c->addAsColumn('c','u2.USR_FNAME');
    $c->addAsColumn('d','u2.USR_LNAME');
  	$c->addAsColumn('e','u3.USR_FNAME');
   	$c->addAsColumn('f','u3.USR_LNAME');
   	$c->addJoin(TblTestPeer::TEST_USER1_ID,'u1.USR_ID',Criteria::LEFT_JOIN);
   	$c->addJoin(TblTestPeer::TEST_USER2_ID,'u2.USR_ID',Criteria::LEFT_JOIN);
  	$c->addJoin(TblTestPeer::TEST_USER3_ID,'u3.USR_ID',Criteria::LEFT_JOIN);

Or take another example

SELECT a.id FROM article a RIGHT JOIN article b ON a.article_id = b.id ORDER BY a.name DESC, b.date DESC
$c=new Criteria();
$c->addAlias('a', 'article');
$c->addAlias('b', 'article');
$c->addSelectColumn('b.id');
$c->addSelectColumn('a.article_id');
$c->addDescendingOrderByColumn('a.name');
$c->addDescendingOrderByColumn('b.date');
$c->addJoin('a.arcticle_id','b.id','RIGHT JOIN');
$rs = ArticlePeer::doSelectRS($c);

Happy Programming. :cool:

obsarvation at borivali station – railfanning

Posted in learning, observation, railfanning, travel by ganu on February 18, 2009

A railfan, railway enthusiast or railway buff is a person interested in an amateur capacity in rail transport.

Though I love planes too but rail fanning is another adventure.

At 2100 hrs I was at borivali station BVI.

  • 2104 IST WCAM – 2 Shatabdi Express ahmedabad mumbai. at PF 5
  • 2121 IST WCAM #21818 Ahmedabad – Dhanu Road. PF5
  • 2130 IST 9005 BCT-OKAH ( Mumbai Central – Okha ) at PF 4
  • 2140 IST WCAM #21816 Bandra Jaipur Aravali Expresee 9707 at PF 6

So you know what this WCAM means. This is the indian railway engine code.

WCAM
W – A loco which run on broad guage.
CA – Electric loco ( AC/DC ) which run on both AC/DC
M – Loco used for both passenger and goods trains.

So thats why its WCAM model. So next time if you see any engine which says WCAM then you will also get the same idea.

Now a days I am learning more about rail stuffs. I will update soon as I will learn any thing more on same.

Happy Railfanning. :)

bole to me mumbai coder – “मी मुंबई coder”

Posted in Timepass, fun, hindi, india, learning, me, yaar dost by ganu on February 14, 2009

New to mumbai, but language is super cool here.

Even I have observed that I am using some of the phrases for my/our daily use.

  • यार लग रहा है loop मैं कुछ लोचा है …
  • सुन ना, तेरा हुआ क्या …
  • ज्यादा लोड मत ले, ये code तो automatic चलेगा …
  • यार, क्या deadline दिया है, मेरी तो फट रही है.
  • अरे! क्या ज़क्कास code लिखा है तुने
  • आईला !! क्या बात कर रहा है , सच मैं….
  • हट साले ! एक दम अतरंगी है …
  • And many more…

    बोले तो, अपुन का एकदम मस्त चल-रेला है. तू बोल न तेरा कैसा चल रहा है…

    live joke

    Posted in General, Timepass, fun, hindi, learning, me by ganu on February 7, 2009

    This time in my Gtalk I put the message as
    “शायद आप कुछ कहना चाहते थे ? शर्माओ मत बोल दो.”

    One of my old collage friend came online and told me

    friend: अरे ganu भाई, क्यों लोगो के धंधे की vaat लगा रहे हो, you can not use the punch line of others business.
    me: why what happend ?
    friend : ऐसा लग रहा है , की कोई गुप्त रोगों का clinic खोल लिया है. and you wanted to say “शायद आप कुछ कहना चाहते थे ? शर्माओ मत बोल दो.”.
    me : WTF…. I smiled :)

    and then बरबस मुझे अपना status message change करना पड़ा.

    barcamp mumbai 5

    Posted in fun, learning, meetup, opensource, weekend, yaar dost by ganu on February 3, 2009

    बार – केम्प , अरे ये वो नही है जैसा आप सोच रहे है….

    ओहो! यह तो एक ही वाक्य है — बारकैम्प

    जानिए ज्यादा के बारे मैं —-

    BarCamp is an ad-hoc gathering born from the desire for people to share and learn in an open environment. It is an intense event with discussions, demos and interaction from participants.

    तो फ़िर मैंने भी अपना रुख कर लिया मुंबई ५ की तरफ़….

    देखिये सभी चित्र यंहा – Edition barcampMumbai5

    Wow, this was nice event again.

    <?php
    $arrFunUnlimited = array();
    $intGeekFriendsCount++;
    $floatLearningCurve++;
    $intEnergyDrinksFlavourOrange++;
    ?>

    बस यार मजा आ गया

    PHP & MySQL quick search bookmarklets

    Posted in LAMP, learning, opensource, tips by ganu on January 25, 2009

    If you want to quick search to MySQL, here is the fast quick bookmarklet

    javascript:q=document.getSelection();
    if(!q)void(q=prompt('MySQL%20Keyword:',''));
    if(q)location.href='http://search.mysql.com/search?q='+escape(q)

    And the same goes for PHP too same like above…

    javascript:term=document.getSelection();
    if(!term)void(term=prompt('PHP%20Keyword:',''));
    if(term)location.href='http://in2.php.net/'+escape(term)

    Happy Programming. :D

    come on 2009! Yet another year to celebrate. :)

    Posted in Personal, fun, learning, me, yaar dost by ganu on December 26, 2008

    2009…….one more year…..A year to….


    To find our life partner (might be)
    to forget old crushes…
    to smile……..

    to let people know how much u care…
    to learn from our mistakes…….
    to cry when we are feeling down…..

    to follow our dreams…….
    to fight against everything for our dreams to come true…..
    to be more confident………

    to be more strong at heart and mind…..
    to enrich our knowledge………
    to make others happy….

    Lets take each day as it comes……..
    Forget about the downs we came across in the past year……..
    And remember every lesson we learnt through them……..


    Let’s Enjoy Life to the Fullest…………

    BarCampMumbai – 4, क्या आप भी आ रहे है !!!

    Posted in fun, learning, weekend, yaar dost by ganu on September 27, 2008

    सुनो, सुनो, सुनो…
    आपके शहर मुंबई मैं एक un-conferencing होने जा रही है.

    BarcampMumbai4

    BarcampMumbai4

    BarCamp एक ऐसा अन्तर-राष्ट्रीय आयोजन है, जो बिना किसी rule के user द्वारा आयोजित किया जाता है.
    दो टूक शब्दों मैं कहा जाए तो ” ऐसा आयोजन जो geek टाइप लोगो के लिए geek टाइप के लोगो द्वारा किया जाता है.”

    After attending BarcampBangalore 1 – 2 – 3 -4.
    This will be my first mumbai Barcamp.

    कृपया पता नोट कीजिये ( कब और कंहा ? )
    4th & 5th of October, 2008
    SJMSOM, IIT Bombay, Powai, Mumbai

    Ok, see you there.

    tips for a succesull job – funny saying. :: सफल नौकरी करने के कुछ नुस्खे (

    Posted in Timepass, fun, hindi, learning, tips by ganu on September 15, 2008

    नीचे की कुछ पंक्तिया मेरी लिखी हुई नही है, मैंने उसका सिर्फ़ हिन्दी अनुवाद किया है. …

    सफल नौकरी करने के कुछ नुस्खे
    १. बने रहो पगला, काम करेगा अगला.
    २. काम से रहो गुल, त्वन्ख्वा पाओ फुल.
    ३. मत लो टेंशन, वरना परिवार पायेगा पेंशन.
    ४. काम से डरो नही, और काम को करो नही.
    ५. काम करो या न करो, काम के फिक्र जरुर करो.
    और फिक्र करो या न करो, जिक्र जरुर करो.

    जनहित मैं जारी.

    Technorati Tags: , , , , , , , , , , ,

    Tagged with: , , , , , ,

    quick symfony tips.

    Posted in LAMP, learning by ganu on June 23, 2008

    I am learning symfony. Just got some good tips to share with you.
    Symfony rocks. :)

    I will update this regularly.

    1> How to write OR condition query in symfony.
    $c = new Criteria();
    $c->clearSelectColumns();
    $c->addSelectColumn(TablePeer::TBL_ID);
    $cton1 = $c->getNewCriterion(TABLEPEER::TBL_ID1, $some_condition , Criteria::EQUAL);
    $cton2 = $c->getNewCriterion(TABLEPEER::TBL_ID1, $some_condition , Criteria::EQUAL);
    $cton1->addOr($cton2);
    $c->add($cton1);

    2> How to get query where first date greater then and less then last date.
    $date1 = date('Y-m-d 00:00:00');
    $date2 = date('Y-m-d 23:59:59');
    $cton1 = $gUser->getNewCriterion(TABLEPEER::TBLE_CREATEDAT, $date1, Criteria::GREATER_EQUAL);
    $cton1->addAnd($gUser->getNewCriterion(TABLEPEER::TBLE_CREATEDAT, $date2, Criteria::LESS_EQUAL));
    $gUser->add($cton1);

    3> how to run the update query in symfony.

    “update table TableName set TableField1=’1′ where TableField2=$some_value.”

    $update = new TableName();
    $update->setNew(false);
    $update->setTableField1(1);
    $update->setTableField2($imageId); // this is primary key of the table. include this line.
    $update->save();
    ?>

    technorati tags:
    , , , , (more…)

    Tagged with: , , , ,

    Quick Mumbai Updates.

    Posted in Personal, learning, me by ganu on May 23, 2008

    Quick Mumbai Updates:
    1. Girls are little bit fat but HOT.
    2. vada – pav, sherdi ka ras and sav puri is famous.
    3. I am hardworking now a days. :)

    4. Learning and working on symfony.
    5. Mumbai Town is awesome, wow. Suburban area is waste.
    6. Trains are life saver but in last 40-45 days I have used only 3-4 times.
    7. I am using best service of BEST. :)
    8. Most imp thing is I am not lazy here, I am very fast and active.

    Thnx to mumbai.

    Technorati Tags: , , , , ,

    Tagged with: , , , ,

    Got new job, new place, new friends, new work, new city, new home

    Posted in Personal, learning, me by ganu on April 11, 2008

    Hurry!!

    I wanted to work in mumbai from last so many years. People say this city is dream city and now I also want to see/check/test how my dreams will be fullfill.

    Now this is like Yeppyyy !!! I am in mumbai.

    I joined Grey Matter India Technologies Pvt.Ltd

    Time to hard work.
    Have Fun.

    Technorati Tags: , , , ,

    Tagged with: , , ,

    I am looking for a new job, can you help me to find a good job.

    Posted in General, learning, me by ganu on March 11, 2008

    Hello Readers,

    I am looking for change.

    Its too much dedication and hard work with my current company, now I need change.

    If you have any suitable position for me OR
    if you can refer me OR
    if can help me for job change.

    That will be helpful to me.

    My skills are – LAMP – here P is for PHP and working knowledge of Perl.
    And with this good knowledge of front end technology as HTML/CSS/JavaScript/WML.

    and total exp is 3 years and 6 months.

    send me mail to ganu.ullu@gmail.com

    help me! help me!! help me!!!.

    Technorati Tags: , , , , , ,