Sunday, 23 December 2012

Converting videos from H264 to MPEG4 with ffmpeg

Was putting old family videos to an old Screenplay Plus but it didn't support H264 codec so had to convert them to MPEG4, these are my notes on this process.

One-liner to identify files that are H264 encoded

IFS=$'\n';for f in `ls -1`;do echo $f;mplayer "$f" -identify -vo null -ao null -frames 0 2>&1 /dev/null |grep H264;done

Using ffmpeg to convert H264 to MPEG4

ffmpeg -i INPUT-FILENAME.mp4 -vcodec mpeg4 -vtag XVID -b 5000k -acodec libmp3lame -ab 192k OUTPUT-FILENAME.avi
 

 Invalid number of channels 6, must be <= 2

If you get above error then add -ac 2 to encode the output file in 2 channel stereo.

timebase not supported by MPEG 4 standard

If you get above error the add -r 25 to set the frame rate to a standard 25 frames per second.

Saturday, 11 August 2012

Broadcom Wireless not working in Ubuntu (solved)

After upgrade to 12.04 the Broadcom wireless adapter stopped working again, following steps fixed for me:

First check your wireless adapter is in revision 43 range

lspci -nn|grep -i broad
04:00.0 Ethernet controller [0200]: Broadcom Corporation NetLink BCM5787M Gigabit Ethernet PCI Express [14e4:1693] (rev 02)
05:00.0 Network controller [0280]: Broadcom Corporation BCM4311 802.11b/g WLAN [14e4:4311] (rev 01)


  1. Remove jockey wireless driver
  2.  sudo apt-get remove bcmwl-kernel-source
  3.  sudo apt-get install firmware-b43-installer b43-fwcutter
  4.  sudo vi /etc/modprobe.d/blacklist.conf
    and comment out the line that says "blacklist bcm43xx"
  5.  sudo vi /etc/NetworkManager/NetworkManager.conf
    and change managed to true.
  6. reboot
Note: you might need to issue sudo rfkill unblock wifi if your wi-fi is switched off by the button on your laptop.


Monday, 9 July 2012

Changing title artist etc metadata in mpeg video in linux

Was working on a video timelapse, but the final file was missing meta data like title, copyright etc etc.

I tried EasyTag and Kid3 to see if they'd work but obv didn't work on Mpeg, in the end resorted to using ffmpeg from command line.

ffmpeg -i INPUT-FILE.mp4 -acodec copy -vcodec copy \
-metadata title='Time-lapse boat trip to St.Kilda' \
-metadata artist='Sea Harris (www.seaharris.co.uk)' \
-metadata date='2012' \
-metadata comment='Boat trip to St. Kilda'  \
OUTPUT-FILE.mp4

Pretty straight forward, -acodec and -vcodec specify the audio and video codec and by setting them to copy it doesn't need to encode just creates a new output file with the specified metadata.
 


Thursday, 9 June 2011

Drop database in oracle 10+

I'm still a bit green with Oracle but when deleting and recreating test db's I previously had always shutdown and deleted the data-files and the init files, but just discovered that as of oracle 10 you have a drop database command.  Obv you can't drop a live db so you must shutdown and mount it in restricted mode:

shutdown abort;
startup mount exclusive restrict;
drop database;
Simple as that!

Don't forget to remove the previous db's entry from oratab.

Oracle docs for cmd here.

Tuesday, 29 March 2011

One-liner Live stream of aljazeera

Got this from http://www.unixmen.com/


sudo apt-get install rtmpdump && \
rtmpdump -v -r rtmp://livestfslivefs.fplive.net/livestfslive-live/ \
-y "aljazeera_en_veryhigh" -a "aljazeeraflashlive-live" -o -| mplayer -

Quite cool :-)

Sunday, 16 January 2011

Installing Libre Office

You might as well start ditching Open Office and moving to Libre Office.  You can do this by downloading the packages from the site but if you're running Ubuntu the best/easiest way is to use Libre Office's Personal Package Archive (PPA)


To install:
sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
sudo apt-get install libreoffice libreoffice-gnome

I believe Libre Office will be the official Office version when Ubuntu 11.04 is released.

Monday, 27 December 2010

BBC iPlayer desktop won't open (Solved)

Missed Dr. Who and Top Gear so went to catch up with i-player but i-player wouldn't start on the laptop.

Looking at Task-Manager "BBC iPlayer Desktop.exe" would appear in the list but the interface wouldn't open.
I went through the usual, uninstall/reinstall with iPlayer and then Adobe Air and it still failed to load.

Turns out the solution was to completely uninstall iPlayer then navigate to %USERPROFILE%\AppData\Roaming and delete the folder BBCiPlayerDesktop.* in this folder.
Next navigate to %USERPROFILE%\AppData\Roaming\Adobe\Air\Els and delete the BBCiPlayerDesktop folder.

Now re-install iPlayer and with any luck it will work again (it did for me)


P.S. you don't have to, but if you found the above tip useful then consider liking my brother's facebook page www.facebook.com/seaharris

--
Thanks
M.P.