Category Archives: Video

Video Related Posts

Mythbuntu 10.10 PART 3 – Storage Groups and Automatic Wake-up/ Shutdown


Previous Articles in this Series:

Installing Mythbuntu in Ubuntu 10.10 with a Hauppauge Nova-T 500 PCI DVB-T

Installing Mythbuntu 10.10 with a Hauppauge Nova-T 500 PCI DVB-T card: PART 2 – Configuration

Having created a working PVR in the previous two articles, in this one we are going to:

  • Configure Storage Groups on a separate partition
  • Set-up MythTV Automatic Wake-up/ Shutdown

Storage Group Configuration

Storage groups are lists of directories which allow you to store MythTV recording files.

When installed the following storage groups are created:

  • Default
  • LiveTV
  • DB Backups
  • Videos
  • Trailers
  • Coverart
  • Fanart
  • Screenshotsunder
  • Banners

Their default storage location is under /var/lib/mythtv/groupname, except Default which stores its files in the directory called recordings.

If your system drive is rather small, you may wish to add an additional hard disk and set-up MythTV to store the above groups on that drive.

Note: these instructions assume that you have not yet used MythTV to record any programs. If you have then you may find that recordings stored in the original location may not be accessible, in which case you will need to move them.

You can add additional directory locations (mount points) in each of the storage groups. MythTV will balance concurrent recordings across the available locations detailed in the storage group in order to balance the I/O load.

When adding additional mount-points to storage groups you must set folder permissions so that the group mythtv has full read/ write access to the drive otherwise MythTv will not work.

Example

You have a second hard disk in your PC which you have set-up in /etc/fstab to mount as /media/data (see Ubuntu Community Documentation on fstab and mounting disks).

Rather than having MythTV store your recordings on your system disk, you want it to store the recordings in a directory called /media/data/mythtv which you have just created using the command

sudo mkdir /media/data/mythtv

Create the directories listed in the screen-shot below in /media.data/mythtv, these are the same directories found in /var/lib/mythtv/, using the command mkdir /media/data/mythtv/directory name

For example

mkdir /media/data/mythtv/banners

The above directories have to be a member of the Group mythtv, otherwise mythtv will not work as it does not have permission to access these directories. By default it does not have permission.

To do this:

Open Terminal and enter the following to make the directories Recursively Read/ Write for the Owner; Group and Read Only for Others:

sudo chmod -R 775 /media/data/mythtv

then change both the owner and group to mythtv and do this Recursively for all sub-directories:

sudo chown -R mythtv:mythtv /media/data/mythtv

The permissions for the newly created should directories look similar to those in the screenshot below

To double check, open up the file manager Thunar (if you are using Mythbuntu) Applications > Accessories > Thunar File Manager

Navigate to the mythtv directory created above and right click on one of the newly created directories e.g. banners

Select properties from the drop-down menu, and on the properties window select the Permissions tab.

You should see the following

Close the properties window and the Thunar file manager.

Launch Accessories > System > MythTV Backend Setup

Select option 6. Storage Directories

Then starting at the top and working through.

To change the location, select the Storage Group name, pressing <Enter>, then pressing <Enter> again on the directory name (e.g. /var/lib/mythtv/recordings).

For the Default group change the entry to something similar to that in the screen shot below

Select OK

You should now see the new path for the default Storage Group directories.

Press <ESC> to go back to the list of groups.

Now repeat the above process for the next storage group until all have been changed.

<ESC> out of the MythTV Backend Setup in the usual way, and allow mythfilldatabase to run.

Now test that this all works by launching MythTV Frontend and watch some TV.

If you select Watch TV and you just get a black screen and are then reverted back to the main menu, then you have not set-up your directory permissions correctly. MythTV, even when recording writes files into these folders enabling you to rewind live TV or record a program you already partly watched, in full.

Set-up MythTV Automatic Wake-up/ Sleep

By default MythTv is set-up to run 24/7, which may be convenient for you but not great for the environment or if you want to keep down how much you spend on electricity! It can cost over £300 a year keep a PC running 24/7 http://tinyurl.com/6atfc3t!

The good news is that this is not necessary with MythTV. If you use the ACPI Wakeup feature which comes as standard with most PC BIOSs manufactured in the past 7 years, your PC will automatically wakeup before a recording and shutdown/ suspend after the recording has completed.

The instructions below are a summary of those those found in the MythTV Wiki http://www.mythtv.org/wiki/ACPI_Wakeup.

Testing whether ACPI Wakeup works on your PC

From Terminal enter

grep -i rtc /var/log/kern.log

You should see something similar to

kernel: [ 0.474924] rtc_cmos 00:04: RTC can wake from S4

…..

kernel: [ 0.474987] rtc0: alarms up to one year, y3k, 242 bytes nvram

The above means that your PC can wake up and that the wakeup time can be set.

You will now need to check the BIOS in the Power Management section (see MythTV Wiki for more details)

With your BIOS configured you now need to disable the HWclock updates. As we are using Mythbuntu we will use the Ubuntu instructions:

Edit

/etc/init/hwclock-save.conf

Comment out the line exec hwclock so it looks like the following:

# exec hwclock –rtc=/dev/rtc0 –systohc $tz –noadjfile $badyear

To manually test wakealarm, enter the following commands from Terminal which will wake up the PC 5 minutes after the commands are entered. As the kernel shipped with Mythbuntu 10.10 uses kernel 2.6.35, we will use /sys/class/rtc/rtc0/wakealarm.

Enter the following:

sudo su

echo 0 > /sys/class/rtc/rtc0/wakealarm

echo `date '+%s' -d '+ 5 minutes'` > /sys/class/rtc/rtc0/wakealarm

To check that this has been set correctly enter

cat /proc/driver/rtc

Check the alrm_time field is set to 5 minutes into the future.

Now shutdown your computer and see if it starts back up after approximately five minutes by entering

sudo shutdown -P now

On the basis that the above test worked (if not reference the instructions in the Wiki http://www.mythtv.org/wiki/ACPI_Wakeup ) we are now ready to set up this functionality in MythTV.

MythTV Back-end Configuration

From Terminal run

mythtv-setup

This will shut-down the MythTV back-end and run the set-up program.

From the menu, select 1. General

Keep selecting Next> until you get to the Shutdown/ Wakeup Options menu

and change the default setting so that they look like the following:

  • Untick Block shutdown before client connected
  • Set idle shutdown timeout (secs): 120 (2 minutes although you can make this longer or shorter if you wish)
  • Set Max. wait for recording (min): 15 (you can make this longer or shorter if you wish)
  • Set Startup before rec. (secs): 600 (If you have not disabled the occSave the file.asional disk check on boot, make this time long enough to complete the boot & disk check before the recording should start)
  • Set Wakeup time format: time_t
  • Set Command to set Wakeup Time: sudo sh -c “/usr/bin/setwakeup.sh $time” xtube
  • Set Server halt command: sudo shutdown -P now
  • Set Pre Shutdown check-command: mythshutdown –check

The results should look similar to the following screen-shot

Comprehensive information on the various settings on this screen as well as the other General screens can be found in the MythTV Wiki under User_Manual:Detailed_configuration_Backend

Now keep selecting Next> until you get to Finish and select it. You will be returned to the main menu.

Press ESC to exit mythtv-setup and allow it to run mythfilldatabase to complete.

The backend is now configured, we now need to configure the front-end!

MythTV Front-end Configuration

As our Mythbuntu configuration is for a combined Frontend/ back-end there are two options:

  1. Follow the Desktop users instructions in the Wiki
  2. Use Mythwelcome

I’ve found Mythwelcome to be easier to use and understand and it tells you what MythTV is doing, so this is the option we will use for this tutorial.

The first thing we need to do is set-up Mythwelcome to automatically run at start-up

Edit /etc/mythtv/session-settings as sudo

Remove the # from in front of MYTHWELCOME=true

Save the file

We are now going to add Mythwelcome to the list of applications which auto-start on boot-up

From the desktop click on Applications > Settings > Session and Startup and select the Application Autostart tab.

It should look like the following

Click +Add

A Add Program window will appear and compete as follows:

Name: MythWelcome

Description: Startup for MythTV

Command: mythwelcome

Save the changes and exit.

We are now going to setup mythwelcome.

In terminal enter mythwelcome – -setup

We now need to configure Mythwelcome.

Open Terminal and enter

mythwelcome –setup

Configure as follows:

Command to set wakeup time: sudo sh -c “/usr/bin/setwakeup.sh $time”
wakeup time format: time_t
nvram-wakeup Resart Command: make sure this is blank
Command to reboot: sudo -H shutdown -h -r now
Command to shutdown: sudo -H shutdown -P now
Command to run Xterm: xterm
Command to run to start the Frontend: /usr/bin/mythfrontend

It should look like the following screenshot

We are now going to create the wakeup script.

Open the following file as sudo in your text editor:

/usr/bin/setwakeup.sh

and copy and paste the following:

#!/bin/sh

#

# set ACPI Wakeup time

# usage: setwakeup.sh seconds

# seconds – number of seconds from epoch to UTC time (time_t time format)

#

# set UTCBIOS to true if bios is using UTC time

# set UTCBIOS to false if bios is using local time

UTCBIOS=true

%mythtv ALL = NOPASSWD: /sbin/shutdown, /bin/sh, /usr/bin/setwakeup.sh, /usr/bin/mythshutdown

if $UTCBIOS

then

#utc bios – use supplied seconds

SECS=$1

else

#non utc bios – convert supplied seconds to seconds from

#epoch to local time

SECS=`date -u –date “\`date –date @$1 +%F” “%T\`” +%s`

fi

echo 0 > /sys/class/rtc/rtc0/wakealarm # clear alarm

echo $SECS > /sys/class/rtc/rtc0/wakealarm # write the waketime

Save the file.

We now need to change the permissions of the file so it can be executed. From Terminal enter:

sudo chmod +x /usr/bin/setwakeup.sh

Add the following line to your /etc/sudoers by entering sudo visudo and then copying and pasting the line at the end of the file the following line:

%mythtv ALL = NOPASSWD: /sbin/shutdown, /bin/sh, /usr/bin/setwakeup.sh

Save the file.

From Terminal enter mythwelcome, a screen similar to the following will be displayed

Press m on the keyboard, the following screen will be displayed

Select Lock Shutdown and press Enter.

If you did not do this, then your Mythbuntu PC would automatically shut itself down!

When you have finished working on the Mythbuntu PC, repeat the above but this time select Unlock Shutdown.

The PC will then shut itself down according to the parameters set above for MythTV, you will see a screen similar to that below with a countdown from 180 seconds.

The first few times you run MythTV you may find that the countdown restarts when it gets close to 10 seconds left, whilst frustrating this seems to be normal behaviour for a new install.

MythTV is now configured for ACPI Wakeup/ Shutdown, we just need to test it for real!

A Final Test – Recording a Program!

Personally I place a Mythwelcome icon on the desktop, alternatively open up Terminal or press ALT-F2 and enter mythwelcome, the following screen will be displayed (you may need to Lock Shutdown to prevent MythTV from shutting down the PC).

Select Start Frontend, the following menu will be displayed.

As we are interested in managing our recordings, select the Manage Recordings menu items.

Select Schedule Recordings and then select Programme Guide in the subsequent menu.

A screen similar to the following will be displayed

Select a programme in the guide which you wish to record and then press enter.

The following screen will be displayed

Once in this recording menu, you will seeSave the file. that the default option is Do not record this programme. Choose an appropriate recording option.

The full set of options are as follows:

  • Do not record this programme
  • Record only this showing [S] at this specific time and this station
  • Record one showing of this title [F] from any of the times which appear in the TV listing (no good for episodes)
  • Record in this timeslot every week [W] records weekly, same channel, day and time ignoring title and program information
  • Record one showing of this title every… [F}
  • Record in this timeslot every day [T]
  • Record one showing of this title every day [F] Record one showing of this show a day based on the program title
  • Record at any time on this channel [C] Records a show any time the title appears on this station
  • Record at any time on any channel [A]

More information is available on these options at the MtyhTV Wiki

In addition to the above you have Schedule Options. Which help refine way in which the recording is made, and preventing duplicate recordings.

As the broadcasters can be very unreliable for starting and ending their programs on time, I set recording to start and end 1 minute early.

The Post Processing menu allows you to do set the following options

Probably the two most useful options here is Commercial removal and transcoding the recording.

The MythTV Wiki has excellent documentation on “Using A Myth Box From Day To Day” which clearly explains how to fully use MythTV for day to day recordings, including using the remote control. This is well worth reading.

When you have finished setting up your recordings, ESC back to the Welcome to MythTV screen and remember to select Unlock Shutdown by pressing m.

Notes:

If you try to shutdown the MythTV PC less than 20 minutes before it is due to perform a recording, it will not shutdown as it will not consider itself to be in an idle state.

The following keys are useful in all MythTV menus

  • m for menu
  • i for information
  • e for edit

Final Comment

I was going to include configuring the remote control in this article, but on investigation it appears be be a complete “train crash” mainly because the 1.20 driver does not work with the remote and you need to downgrade the driver. If you are feeling brave, try what is suggested in this post in Ubuntu Forums for Mythbuntu. When I get some more time I’ll look into this again.

=-=-=-=-=
Powered by Blogilo

Advertisements

Upgrading Dell C640 from Kubuntu 9.04 to 9.10: How to Recover the Upgrade when it Fails!


Last November I upgraded my trusty C640 to Kubuntu 9.10, only to bottle out post upgrade when I realised the on-board ATI Radeon Mobility M7 video card had a bug causing window display corruption.

With Kubuntu 10.04 due out in a few months and finding the a solution http://tinyurl.com/ydk88cr for last years aborted upgraded, I decided to try again.

Problem 1: Refused to Upgrade to 9.10

Kubuntu refused to recognise a distribution upgrade was available, either graphically or via the command line using sudo apt-get dist-upgrade.

I think this might have been due to a recent bug-fix which corrected the GRUB menu, for some unknown reason was showing Kubuntu 8.10 instead of 9.04.

Using the Alternative CD I instigated the upgrade by entering the following from terminal:

sudo mount -o loop ~/Desktop/ubuntu-9.10-alternate-i386.iso /media/cdrom0

Problem 2: Broken Upgrade

I use a wired Ethernet connection when doing upgrades, I don’t trust wireless as it can be unreliable at times, mainly when you need it. As part of the ISO upgrade, I confirmed that I wanted updates from the internet.

Part way through the upgrade I started getting errors about certain OpenOffice deb packages missing from the Alternate CD. As these were not core to the OS working I continued the upgrade. There were a number of related errors and eventually I got a “Upgrade Failed” message, asking me to reboot to recover.

However, I noticed the restart icon had appeared in the plasmoid notification area, so a pretty good indication that the core OS was sound and any problems would be with secondary packages. So instead of doing a restart, I opened up Terminal and entered:

sudo apt-get update

followed by

sudo apt-get upgrade

and was told that I had broken packages, so ran the following

sudo apt-get -f install

then did an upgrade which installed any missing packages (mainly OpenOffice).

As an insurance policy, I re-ran the upgrade process again to make sure nothing had been missed. The laptop was then rebooted and Kubuntu 9.10 loaded, really quickly!

Problem 3: Broken ATI Graphics

This was a known problem, and I had the fix. The only thing to change was replacing GDM (Gnome Desktop Manager) with KDM (KDE Desktop Manager) to adapt it for Kubuntu rather than Ubuntu.

Window corruption with older ATI graphics cards

With older ATI graphics cards with 32MB or less of video RAM some corruption of direct rendered windows, for example OSD notifier windows, might appear. This may be worked around by disabling ‘RenderAccel’ in the Xorg configuration. (426582)

To do this first exit to the console using the following command:

*

sudo service gdm stop

Then create an Xorg configuration file with the command below:

*

sudo Xorg -configure

Then add the ‘RenderAccel’ option to /etc/X11/xorg.conf:

*

Section “Device”

Driver “radeon”

Option “RenderAccel” “off”

EndSection

And restart X/GDM.

sudo service gdm start

It worked, one reboot and all was fine.

Problem 4: KNetworkManager

Just when I thought it was all fixed, I then tried my wireless connection. It could see the network, but just could not connect.

Because of previous problems under 8.10 with KNetworkManager not always loading successfully on boot, I had added it to AutoStart. I removed this from Autostart and rebooted. KNetworkManager loaded and asked for my wireless access encryption code. Once entered, it connected without a problem.

KNetworkManager has been totally rewritten since 9.04, so it might work reliably. Stranger things have happened!

Conclusion

Despite the above problems, some of which may be unique to my laptops configuration, I think the upgrade to Kubuntu 9.10 was worth it. The whole laptop seems faster and graphics more responsive.

I eagerly look forward to Kubuntu 10.4, hopefully Pulse Audio may start working for a change.

=-=-=-=-=
Powered by Bilbo Blogger

Video File Encoding Format Information


You have a video file, you know it’s an mpeg file as it has .mpg at the end of the file name, but as mpg is only the video file container you need to understand more about the file like bitrare, dimensions.

Method 1 – ffmpeg

There is nothing like a good swiss army knife and when it comes to video ffmpeg certainly makes the mark.

to find out information about a video file enter

ffmpeg -i <filename>

Example:

ffmpeg -i ‘Ian Hislop Goes off the Rails (DVD).mpg’

Input #0, mpeg, from ‘Ian Hislop Goes off the Rails (DVD).mpg’:

Duration: 01:01:45.16, start: 0.200000, bitrate: 4273 kb/s

Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720×576 [PAR 64:45 DAR 16:9], 8000 kb/s, 25 tbr, 90k tbn, 50 tbc

Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 256 kb/s

Method 2 – exiftool

Unlike ffmpeg, it is not installed by default in Kubuntu so you will need to install it by entering:

sudo apt-get install libimage-exiftool-perl

to find out information about a video file enter

exiftool <filename>

Example:

exiftool ‘Ian Hislop Goes off the Rails (DVD).mpg’

ExifTool Version Number : 7.82

File Name : Ian Hislop Goes off the Rails (DVD).mpg

Directory : .

File Size : 1888 MB

File Modification Date/Time : 2008:10:05 15:19:55+01:00

File Type : MPEG

MIME Type : video/mpeg

Image Width : 720

Image Height : 576

Aspect Ratio : 16:9, 625 line, PAL

Frame Rate : 25 fps

Video Bitrate : 8000000

MPEG Audio Version : 1

Audio Layer : 2

Audio Bitrate : 256000

Sample Rate : 48000

Channel Mode : Stereo

Mode Extension : Bands 4-31

Copyright Flag : True

Original Media : True

Emphasis : None

Duration : 31:58 (approx)

Image Size : 720×576

Regardless of the type of video file you have, the above information can then be used for re-encoding video.

=-=-=-=-=
Powered by Bilbo Blogger

64-bits of Karmic blackout or How to install the latest nVidia Ubuntu drivers in Kubuntu 9.10 without the pain


I’ve been having some problem recently with my AMD 64 Kubuntu PC where sometimes I would briefly get the login screen appear and then both displays would go black.

After pressing all keyboard combinations, there was only one option left but to press the Reset button on the PC! The problem with this problem is it continued to happen unless I booted Kubuntu into Recovery Mode, logged in and then did a manual startx to start X server. Then logout of X and reboot normally.

Such errors are very difficult to trouble-shoot let alone search for possible solutions, so I put up with it for a week and then decided to remove the login window as I’m the only person who uses this PC at home.

In the meantime, my Athlon 64 CPU upgrade arrived to replace my creaking single core 3000+ with a dual-core 4200. It was at this point the problem changed from being just a startup/ shutdown problem to a occasional reboot of X server midway during a session. Not friendly, so time to find a solution.

Two options came to mind:

1. Use the open source nVidea driver. Except it’s rubbish in a dual screen setup like mine.

2. Upgrade to the current certified nVidia driver (190.xx) from their website

Option two looked really attractive, until I discovered there was no Ubuntu deb package available from nVidia. After a quick search for Karmic package, I found http://www.webupd8.org/2009/08/how-to-install-nvidia-190xx-drivers-in.html.

So, this is what I did to upgrade my nVidia drivers:

  1. Uninstalled my current nVidia 180 drivers which shipped with Kubuntu 9.10, by clicking on K Menu > Applications > System > Hardware Drivers and Removing the NVIDIA accelerated graphics driver (version 180)
  2. Re-booted Kubuntu
  3. Enter sudo add-apt-repository ppa:nvidia-vdpau/ppa to add the new nVidia LaunchPad repository
  4. Then as per the sites instructions entered sudo apt-get update && sudo apt-get install nvidia-190-modaliases nvidia-glx-190.

For those not to familiar with command line package management, the first part of the command before && checks for general updates and the second half after the && installs specific packages. It could also be entered as:

sudo apt-get update

I would then recommend sudo apt-get upgrade, to apply updates to any existing packages before adding new packages. When I entered the combined command, because I added a new repository in step 3, Kubuntu did find package updates and I had to cancel the package and install the updates, then repeat the package install again.

I would enter sudo apt-get install nvidia-190-modaliases nvidia-glx-190 to install the packages.

Finally, you have to go back into Hardware drivers (as in 1 above) and select the driver you want to install. Originally, I had intended to install the 190 driver, but saw that the 195 driver was the one recommended and tested by Ubuntu so installed that instead.

So far all has gone well, my dual screen setup is reconfigured, nothing has yet crashed (still early days) and I’m staying away from anything other than the default Compez settings until I’m confident that everything is stable.

As they say, “time will tell”!

=-=-=-=-=
Powered by Bilbo Blogger

Grabbing DV from a video camera using DVGRAB/ Kdenlive


On my Kubuntu 64-bit PC I’ve got a Belkin IEE1394 (Firewire) card which I use for grabbing video of my Panasonic video camera. Whilst the Firewire card is detected, trying to use dvgrab from Terminal results in “Error: no camera exists”.

Entering lspci to display which pci cards have been detected by the OS shows:

00:0b.0 FireWire (IEEE 1394): Agere Systems FW322/323 (rev 04)

which I know is my Belkin card, therefore the OS has detected the card correctly.

However, all is not what it seems! If I place sudo in front of the command i.e. sudo dvgrab it works, capturing the video off the camera to a .dv file. So the issue is permissions, the problem is that the solution is not as obvious as it first seems.

There are plenty of suggested fixes on the Internet on getting this problem resolved, the most common seems to be around doing the following:

  1. Adding the user to the video group,
  2. Changing permissions for /dev/raw1394 to 666.

Whilst dvgrab would then work without sudo and capture in kdenlive also worked, there is one major drawback! /dev/raw1394 is created on the fly i.e. it only exists when an firewire device is plugged in and switched on. On rebooting the computer, the file is deleted and again created when a firewire device is detected. So changing the permissions of the file to 666 only works for that session.

Now you could write a script to run after you have turned on the firerwire device for the first time, which changed permissions on /dev/raw1394 to 666, but this is more of a hack rather than a fix.

The fix is actually to follow the Ubuntu community Firewire documentation https://help.ubuntu.com/community/Firewire which explains the problem in some detail and to apply the Method 3. ‘udev rule’ fix which allows dvgrab to work without sudo level access and removes the need to change permissions on /dev/raw1394 or changing anything else for that matter.

So just to clarify, to get dvgrab to work from terminal without sudo permissions, and therefore work in kdenlive, you need to do the following:

1. Add the user to the video group. From terminal you would enter:

useradd -G video username

Substitute the username with the username you wish to add to the video group

2. Run the commands documented in the Ubuntu community firewire documentation as referenced above, which for completeness are:

a. from terminal enter to create a udev rule for raw1394

echo ‘KERNEL==”raw1394″, GROUP=”video”‘ > /tmp/raw1394.rules

b. then enter:

sudo cp /tmp/raw1394.rules /etc/udev/rules.d/

c. then to tidy up, enter:

rm /tmp/raw1394.rules

d. reboot PC.

Yes, it’s pretty crappy that you need to go through this just to capture from DV using firewire, but this problem also serves to illustrate why Linux remains a minority operating system on the desktop.

Yes, the information exists on the Internet to fix the problem, but there are a lot of hoops to jump through before you find the right answer applicable for your Linux version/ distribution. For the average user this is unacceptable and most will give up before even trying.

What I find even sadder is that this is a known bug in Ubuntu/ Linux since Ubuntu 8.10 (October 2008) release. It is still outstanding on Launchpad https://launchpad.net/ubuntu/+source/kino/+bug/6290 bug # 6290, of “low importance” and “unassigned”. Eight duplicates have also been raised on Launchpad relating to this bug, this is not a minor problem yet the Ubuntu/ Linux kernel developers don’t seem to be bothered about a fix any time soon. This sucks, after all it used to work prior to Ubuntu 8.10!

=-=-=-=-=
Powered by Bilbo Blogger

Converting MP4 video to FLV


Whilst I love the power and simplicity of using FFMPEG http://ffmpeg.org/ there are some things it does badly, like converting MP4 or AVI files to FLV (Flash Video).

However, to the rescue comes Mencoder http://en.wikipedia.org/wiki/MEncoder which is built from the same code as MPlayer, a close Linux alternative to VLC although I feel VLC still has the edge!

Anyway, I found this command line to convert a MP4 file to FLV to Menencoder at http://www.zimbio.com/mp4+Converter/articles/109/Convert+mp4+flv+using+mencoder , it works really well.

The command line is:

mencoder “video.mp4″ -o “video.flv” -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=800:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -srate 22050 -ofps 24 -vf harddup

Your input file is video.mp4

your output file is video.flv

In each case substitute video for the name of your input and output files and press enter.

Job done!

=-=-=-=-=
Powered by Bilbo Blogger

No Flash Video in Firefox!


I’ve been playing with the Linux version of the BBC iPlayer on my HP laptop (I’ll blog about this later). As performance was poor decided to try this on my desktop.

It was at this point I discovered that flash video playback would just give a grey box with a “play” symbol in the middle (swf and flash enabled websites would work). Pressing the “play” symbol would start Flash, but Firefox would totally freeze with the only option of doing a “Force Quit”.

After some digging around uninstalling Adobe Flash and the version which comes with Ubuntu I found someone else on Ubuntu Forums with a similar problem http://ubuntuforums.org/showthread.php?t=1123364.

Like me they had copied their bookmarks from Firefox in Windows into Ubuntu so as to retain their plug-ins, add-ons and bookmarks, they had also re-installed Flash but to no avail and then took the drastic step of wiping and re-installing Ubuntu, something I was not really prepared to do!

I decided to try an alternative browser, as I’m running Ubuntu I installed Epiphany and had exactly the same experience as Firefox.

After some more digging and established the following:

1. Flash enabled websites do work, I just need to click the play button in the middle of the big grey window!
2. Sites using SWF flash files playback okay.

After reading this post http://www.tweak3d.net/forums/ftech/…econds-32861-3 which is related to Windows and Firefox but in this case (same difference) it looked like there is a problem with Flash 9. In my case I have in Firefox Plugins Shockwave Flash 9.0 r999. On two of my PCs where streaming Flash Video works fine i.e. BBC iPlayer and youtube, it is Shockwave Flash 10.0 r22.

The next step was to work out how to change this to Flash 10.0 r22.

I upgraded the Flash plug-in to 10.0.22.87 http://get.adobe.com/flashplayer/ but it was still showing Flash 9 in Firefox!

Found the following on the Mozilla Knowledge base http://kb.mozillazine.org/Flash_(Firefox)#Linux_and_Solaris. Really excellent link for trouble shooting Flash problems in Firefox. This confirmed the Flash version 9 bug in the Firefox plugin.

Removed flashplugin-nonfree from firefox with:

sudo apt-get remove flashplugin-nonfree

Flash was still present in Firefox so did the following (as instructed in the link):

If the uninstall don’t work: 1. type about:config in the address bar and press Enter. Find the option plug-in.expose_full_path and change the value to “true” (double-clicking the preference name will toggle the setting). 2. type about:plugins and locate the flash plug-in.

File name: /usr/lib/swfdec-mozilla/libswfdecmozilla.so
Shockwave Flash 9.0 r999

Remove the plug-in files (both .so and .xpt).

I could only find the .so file so just deleted this file.

Noticed in /etc/alternatives two broken links to the above for mozilla-flashplugin and midbrowser-flashplugin and in /usr/lib/firefox/plugins another broken link for flashplugin-alternative, pointing to /etc/alternatives. As these were just links linking back to the deleted .so file I decided to leave, at least for now!

Restarted Firefox, checked that the flash plugin was still removed and then re-installed the Adobe plug-in (back to the Adobe website) using the Ubuntu 8.04+ deb package via the package manager.

Restarted Firefox.

Checked the plug-ins again and now got:

Shockwave Flash 10.0 r22.

Entering in the address bar about plug-ins showed the following for Shockwave Flash (I decided to leave the full path information exposed, might be useful in the future!)

File name: /usr/lib/adobe-flashplugin/libflashplayer.so
Shockwave Flash 10.0 r22

All was now looking good, so went to the BBC iplayer website and played a program. It worked, previously Firefox would hang.

Flash was fixed.

I guess that as the problematic plug-in file was outside the Home folder, this problem was not caused by me copying over my Firefox settings folder from Windows.

=-=-=-=-=
Powered by Bilbo Blogger

Mandriva 64 Black Screen of Death


Early start, second attempt to look at CSS, but just though it would be worth checking the audio settings on the Athlon 64. After logging in to the PC the audio came out nice and clear on Mandriva start up so sound works great and zero configuration.

However, I now have a black screen with an I bar, no desktop. After some fiddling around found that Compiz was having problems with my open source ATI graphics card drivers. I could get all the Compiz effects (like cube) except that all the desktops were black!

Restarted in to Safe Mode, desktop okay. Removed Compiz and took of 3D effects, same problem edited xorg.conf, no difference.

By this time an hour had passed so decided to cut my losses and do a fresh install. I suspect that one of the many updates which ran last night after installation broke my configuration. This time I’m using the ATI proprietary drivers (which is the Mandriva default) rather than the open-source drivers. Clearly I was being too community spirited!

In the meantime I hope to get on with some work.

=-=-=-=-=
Powered by Bilbo Blogger