Get ready for ‘Interstellar’ with these TED Talks

TED Blog

Since the first teaser in 2013, we’ve been in countdown mode for Interstellar, Christopher Nolan’s new outer-space epic that promises to blast us through space and time. It opened today in limited release; if you’re as excited as we are but can’t clear three hours until the weekend to go see the whole movie, here are a few TED Talks that relate to the plot points we could figure out from obsessively watching trailers.

The story begins on an earth devastated by drought and climate change. Dystopian, but unless we take action, we’re heading there in reality too. In this talk, Jonathan Foley makes a case for “terrafarming” — thinking of the planet’s food systems as one big connected whole.

Meanwhile Gavin Schmidt shows us how emergent global patterns are causing our climate to get less predictable (scary, but they make hypnotizing GIFs).

And … I don’t know…

View original post 382 more words

Fixing mythvideo missing coverart and metadata

I’ve never managed to get mythvideo to find cover art and metadata for all of my videos, but I have discovered that a lot of it has to do with the naming of your video files. So I thought I would share some tips and tricks for getting metadata and cover art to work on mythvideo.

1. Understand the file naming conventions found here –> http://www.mythtv.org/wiki/MythVideo_File_Parsing. Originally I had all of my files named in this format:

filename.(year).mp4

I found that the tmdb.py metadata script used by mythtv didn’t use the date to help isolate the video and hence there were too many videos returned from themoviedb.org and  mythvideo didn’t know which one to choose. By removing the brackets, I found that I fixed heaps of videos immediately, as the date helped to resolve multiple returned results.

eg. Back.to.the.future.(1985).mp4 would return 9 possible results.

But  Back.to.the.future.1985.mp4 would only return 1.

2. Use the correct spelling – I found quite a few videos with incorrect spelling. This cause the metadata not to be found.

Eg. How.to.loose.a.guy.in.ten.day.2003.mp4 should be How.to.lose.a.guy.in.ten.day.2003.mp4

Also watch for words spelt differently in different countries.

eg. Dont.tell.mum.the.Babysitters.Dead.1991.mp4 should be Dont.tell.mom.the.Babysitters.Dead.1991.mp4

3. Numbers are not well liked. I had heaps and heaps of trouble trying to work out these sort of filenames. I think there is a limitation with the tmdb.py script used in mythvideo as themoviedb.org site resolved these fine but not mythvideo.

10000.BC.2008.avi
2010.1984.avi
28.Days.Later.2002.mp4
50.First.Dates.2004.avi
127.Hours.2010.avi
2012.2009.mp4
300.2006.m4v
88.Minutes.2007.avi
2001.A.Space.Odyssey.1968.avi
3:10.to.Yuma.2007.mkv

I found the easiest way to deal with these file names was to put the number inside a set of single quotation marks ‘ ‘. So would get the following instead.

‘10000’.BC.2008.avi
‘2010’.1984.avi
’28’.Days.Later.2002.mp4
’50’.First.Dates.2004.avi
‘127’.Hours.2010.avi
‘2012’.2009.mp4
‘300’.2006.m4v
’88’.Minutes.2007.avi
‘2001’.A.Space.Odyssey.1968.avi
‘3:10’.to.Yuma.2007.mkv

4. Punctuation can cause issues. I found some of my files names with punctuation can fail to find metadata. The simple fix is to remove the offending punctuation.

eg. Dirty.Dancing.-.Havana.Nights.2004.avi –> Dirty.Dancing.Havana.Nights.2004.avi

 

Merge multiple mp4/m4v files

Here is a simple way to merge two mp4/m4v files into one:

MP4Box -cat file1 -cat file2 -new outputfile

It will go off and read the video and audio for the first file and then the second and then produce a single file.
Here is an example where I wanted to join Part 1 and Part 2 of Ben Hur into 1 file.

$ MP4Box -cat "Ben.Hur.1959.Part.I.mp4" -cat "Ben.Hur.1959.Part.II.mp4" -new Ben.Hur.1959.mp4
 IsoMedia import - track ID 1 - Video (size 718 x 374)
 IsoMedia import - track ID 2 - Audio (SR 48000 - 2 channels)
 IsoMedia import - track ID 3 - VobSub (size 720 x 576)
 IsoMedia import - track ID 4 - media type "text:text"
 IsoMedia import - track ID 1 - Video (size 718 x 374)
 IsoMedia import - track ID 2 - Audio (SR 48000 - 2 channels)
 IsoMedia import - track ID 3 - VobSub (size 720 x 576)
 IsoMedia import - track ID 4 - media type "text:text"
 Saving to Ben.Hur.1959.mp4: 0.500 secs Interleaving

If you don’t have the MP4Box command available on your system you will need to do the following to install it.

$ sudo apt-get install gpac

DVB-T Signal test on Linux

If you want to know if you are getting a good signal strength through your DVB tuner card, this is how to test it on linux. There is a guide here, but it’s not very descriptive. I have ubuntu, so it might be slightly different for other distributions. First of all you need to install the LinuxTV dvb-apps package if you haven’t got it already. Go here for further information, but on ubuntu install like this:

apt-get install dvb-apps

First of all you need to use dvb scan to create a channel.conf file to use with tzap. Without a channel file, tzap won’t know what to look for. On your linux system you should have a directory full of dvb channel information for your region – mine is under “/usr/share/dvb/dvb-t/”.  You will find the channel information is stored under your country code. Eg. for australia all the available channel files are under au*.

 ls -l /usr/share/dvb/dvb-t/au*
-rw-r--r-- 1 root root  364 Dec 27  2011 /usr/share/dvb/dvb-t/au-Adelaide
-rw-r--r-- 1 root root  371 Dec 27  2011 /usr/share/dvb/dvb-t/au-AdelaideFoothills
-rw-r--r-- 1 root root 1344 Dec 27  2011 /usr/share/dvb/dvb-t/au-Bendigo
-rw-r--r-- 1 root root  380 Dec 27  2011 /usr/share/dvb/dvb-t/au-Brisbane
-rw-r--r-- 1 root root  446 Dec 27  2011 /usr/share/dvb/dvb-t/au-Cairns
-rw-r--r-- 1 root root  360 Dec 27  2011 /usr/share/dvb/dvb-t/au-canberra
-rw-r--r-- 1 root root  363 Dec 27  2011 /usr/share/dvb/dvb-t/au-Canberra-Black-Mt
-rw-r--r-- 1 root root  451 Dec 27  2011 /usr/share/dvb/dvb-t/au-Coonabarabran
-rw-r--r-- 1 root root  324 Dec 27  2011 /usr/share/dvb/dvb-t/au-Darwin
-rw-r--r-- 1 root root  558 Dec 27  2011 /usr/share/dvb/dvb-t/au-Devonport
-rw-r--r-- 1 root root  442 Dec 27  2011 /usr/share/dvb/dvb-t/au-FraserCoast-Bundaberg
-rw-r--r-- 1 root root  777 Dec 27  2011 /usr/share/dvb/dvb-t/au-GoldCoast
-rw-r--r-- 1 root root  649 Dec 27  2011 /usr/share/dvb/dvb-t/au-Goulburn-Rocky_Hill
-rw-r--r-- 1 root root  458 Dec 27  2011 /usr/share/dvb/dvb-t/au-Hervey_Bay-Ghost_Hill
-rw-r--r-- 1 root root  390 Dec 27  2011 /usr/share/dvb/dvb-t/au-Hobart
-rw-r--r-- 1 root root  447 Dec 27  2011 /usr/share/dvb/dvb-t/au-Mackay
-rw-r--r-- 1 root root  382 Dec 27  2011 /usr/share/dvb/dvb-t/au-Melbourne
-rw-r--r-- 1 root root  371 Dec 27  2011 /usr/share/dvb/dvb-t/au-Melbourne-Upwey
-rw-r--r-- 1 root root  732 Dec 27  2011 /usr/share/dvb/dvb-t/au-MidNorthCoast
-rw-r--r-- 1 root root  354 Dec 27  2011 /usr/share/dvb/dvb-t/au-Newcastle
-rw-r--r-- 1 root root  374 Dec 27  2011 /usr/share/dvb/dvb-t/au-Perth
-rw-r--r-- 1 root root  375 Dec 27  2011 /usr/share/dvb/dvb-t/au-Perth_Roleystone
-rw-r--r-- 1 root root  289 Dec 27  2011 /usr/share/dvb/dvb-t/au-SpencerGulf
-rw-r--r-- 1 root root  402 Dec 27  2011 /usr/share/dvb/dvb-t/au-SunshineCoast
-rw-r--r-- 1 root root  633 Dec 27  2011 /usr/share/dvb/dvb-t/au-Sutherland
-rw-r--r-- 1 root root  414 Dec 27  2011 /usr/share/dvb/dvb-t/au-Sydney_Kings_Cross
-rw-r--r-- 1 root root  490 Dec 27  2011 /usr/share/dvb/dvb-t/au-Sydney_North_Shore
-rw-r--r-- 1 root root 1183 Dec 27  2011 /usr/share/dvb/dvb-t/au-Tamworth
-rw-r--r-- 1 root root  380 Dec 27  2011 /usr/share/dvb/dvb-t/au-Townsville
-rw-r--r-- 1 root root  133 Dec 27  2011 /usr/share/dvb/dvb-t/au-unknown
-rw-r--r-- 1 root root  383 Dec 27  2011 /usr/share/dvb/dvb-t/au-WaggaWagga
-rw-r--r-- 1 root root 1309 Dec 27  2011 /usr/share/dvb/dvb-t/au-Wollongong

So if I was in the Wollongong region I would type the following to get my channels.conf file created.

$ scan /usr/share/dvb/dvb-t/au-Wollongong > channels.conf

It should go off and scan your regions channels for you. You should see something like this:


 scanning /usr/share/dvb/dvb-t/au-Wollongong
 using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
 initial transponder 697500000 1 3 9 3 1 1 0
 initial transponder 655500000 1 3 9 3 1 1 0
 initial transponder 613500000 1 3 9 3 1 1 0
 initial transponder 634500000 1 3 9 3 1 1 0
 initial transponder 711625000 1 2 9 3 1 2 0
 initial transponder 690500000 1 3 9 3 1 1 0
 initial transponder 599500000 1 3 9 3 1 1 0
 initial transponder 585500000 1 3 9 3 1 1 0
 initial transponder 592500000 1 3 9 3 1 1 0
 initial transponder 676500000 1 2 9 3 1 2 0
 >>> tune to: 697500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE
 0x0000 0x02a1: pmt_pid 0x0000 ABC -- ABC1 (running)
 0x0000 0x02a2: pmt_pid 0x0000 ABC -- ABC2 / ABC4 (running)
 0x0000 0x02a0: pmt_pid 0x0000 ABC -- ABC News 24 (running)
 0x0000 0x02a3: pmt_pid 0x0000 ABC -- ABC1 (running)
 0x0000 0x02a6: pmt_pid 0x0000 ABC -- ABC Dig Music (running)
 0x0000 0x02a7: pmt_pid 0x0000 ABC -- ABC Jazz (running)
 0x0000 0x02a4: pmt_pid 0x0000 ABC -- ABC3 (running)
 Network Name 'ABC NSW'
 >>> tune to: 655500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE
 WARNING: filter timeout pid 0x0011
 scan /usr/share/dvb/dvb-t/au-Wollongong > channels.confWARNING: filter timeout pid 0x0010
 >>> tune to: 613500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE
 Network Name 'MH Illawarra'
 0x0000 0x0001: pmt_pid 0x0000 WIN Television -- WIN Illawarra (running)
 0x0000 0x000a: pmt_pid 0x0000 WIN Television -- GEM Illawarra (running)
 0x0000 0x000f: pmt_pid 0x0000 WIN Television -- GOLD (running)
 0x0000 0x0002: pmt_pid 0x0000 WIN Television -- GO! Illawarra (running)
 >>> tune to: 634500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE
 0x0000 0x0809: pmt_pid 0x0180 SC Media -- SC10 Wollongong (running)
 0x0000 0x0829: pmt_pid 0x0776 SC Media -- ONE Wollongong (running)
 0x0000 0x0849: pmt_pid 0x0780 SC Media -- ELEVEN (running)
 Network Name 'SCA'
 >>> tune to: 711625000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE
 0x0000 0x0351: pmt_pid 0x0401 SBS -- SBS ONE (running)
 0x0000 0x0355: pmt_pid 0x0400 SBS -- SBS HD (running)
 0x0000 0x0352: pmt_pid 0x0402 SBS -- SBS TWO (running)
 

Etc.. etc…. it might take several minutes to run, but in the end you should have the channels.conf we need to run our signal tests with. If you look inside of channels.conf you should see something like this:


 cat channels.conf
 ABC1:697500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:673
 ABC2 / ABC4:697500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:513:651:674
 ABC News 24:697500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:516:0:672
 ABC1:697500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:675
 ABC Dig Music:697500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:0:690:678
 ABC Jazz:697500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:0:700:679
 ABC3:697500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:514:652:676
 [0942]:655500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:2700:2701:2370
 [0960]:655500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:2700:2701:2400
 [0961]:655500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:2700:2701:2401
 [0962]:655500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:4620:4621:2402
 [0963]:655500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:4630:0:2403
 [0964]:655500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:4640:4641:2404
 WIN Illawarra:613500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:503:653:1
 GEM Illawarra:613500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:543:0:10
 GOLD:613500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:599:699:15
 GO! Illawarra:613500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:523:673:2
 SC10 Wollongong:599500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:4620:4621:2402
 7mate Wollongong:599500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:4630:0:2403
 4ME:599500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:4640:4641:2404
 WIN Illawarra:585500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:503:653:1
 GO! Illawarra:585500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:523:673:2
 GEM Illawarra:585500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:543:0:10
 GOLD:585500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:599:699:15

Now all you need to do is use the script available here written by José Oliver Segura. This script is quite good, as it calculates the signal strenght for us and make sense of all those number tzap produces. You can download a copy of the script here also. You may need to modify the $channelsConf variable to point to wherever you have saved your channels.conf file. Run is like this:

$ perl testsignal > results.txt &

It will now go off and test your channel’s and save the results in results.txt. I had quite a few channels, so it took me some considerable time to run this script. If you want to watch the progress, then just tail the results.txt file.

$ tail -f results.txt

You should see something like this:

================================================================================
Tunning channel ABC News 24 (226500000)
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
tuning to 697500000 Hz
video pid 0x0204, audio pid 0x0000
status 01 | signal 8480 | snr 0000 | ber 00000000 | unc 00000c78 |
status 01 | signal 9bf8 | snr 0000 | ber 00000000 | unc 00000c78 |
status 1f | signal 4ac0 | snr acac | ber 00000000 | unc 00000c78 | FE_HAS_LOCK (Ignoring to let tuner/decoder settle.(2)
status 1f | signal 4ac0 | snr acac | ber 00000000 | unc 00000c78 | FE_HAS_LOCK (Ignoring to let tuner/decoder settle.(1)
Signal: 29%     BER 0   UNC 3192
Signal: 29%     BER 0   UNC 3192
Signal: 29%     BER 0   UNC 3192
Signal: 29%     BER 1693        UNC 3192
Signal: 29%     BER 1693        UNC 3192
Signal: 29%     BER 1693        UNC 3192
Signal: 29%     BER 1693        UNC 3192
Signal: 29%     BER 1693        UNC 3192
Signal: 29%     BER 1490        UNC 3192
Signal: 29%     BER 1490        UNC 3192

Joining two (or more) avi files together with mencoder

Have you ever needed to join two avi (or more) files together to create one avi file? Well there is an easy way to merge them together using mencoder. This also assumes that the files are actually the same size, in the same codec etc.

Make sure you are in the same directory as the files you want to join

Use the following command to join the files.
mencoder -forceidx -ovc copy -oac copy -o outputfile.avi firstfile.avi secondfile.avi

Obviously you would replace outputfile.avi, firstfile.avi and secondfile.avi with whatever is appropriate what you are doing.
Mencoder will go off and join the two files. It should do this really quickly as this command is not re-encoding the files, just putting them together. It should look something like this:


$ mencoder -forceidx -ovc copy -oac copy -o new_file.avi 1.avi 2.avi
MEncoder svn r34540 (Ubuntu), built with gcc-4.6 (C) 2000-2012 MPlayer Team
success: format: 0 data: 0x0 - 0x2bcbd408
libavformat version 53.21.0 (external)
Mismatching header version 53.19.0
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
Generating Index: 99 %
AVI: Generated index table for 158686 chunks!
VIDEO: [XVID] 624x256 12bpp 23.976 fps 1319.0 kbps (161.0 kbyte/s)
[V] filefmt:3 fourcc:0x44495658 size:624x256 fps:23.976 ftime:=0.0417
videocodec: framecopy (624x256 12bpp fourcc=44495658)
audiocodec: framecopy (format=2000 chans=6 rate=48000 bits=0 B/s=56000 sample-1)
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Pos:3308.5s 79325f (99%) 4307.40fps Trem: 0min 700mb A-V:0.000 [1318:448]
Incomplete stream? Trying resync.
Pos:3309.3s 79345f (100%) 4301.24fps Trem: 0min 697mb A-V:0.000 [1318:447]
success: format: 0 data: 0x0 - 0x2bb43de0
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
Generating Index: 99 %
AVI: Generated index table for 150239 chunks!
VIDEO: [XVID] 624x256 12bpp 23.976 fps 1414.9 kbps (172.7 kbyte/s)
[V] filefmt:3 fourcc:0x44495658 size:624x256 fps:23.976 ftime:=0.0417
videocodec: framecopy (624x256 12bpp fourcc=44495658)
audiocodec: framecopy (format=2000 chans=6 rate=48000 bits=0 B/s=56000 sample-1)
Pos:4587.6s 109994f (46%) 3049.37fps Trem: 0min 2201mb A-V:0.071 [1419:448]]]
ODML: Starting new RIFF chunk at 1023MB.
Pos:6442.5s 154466f (100%) 3326.00fps Trem: 0min 1395mb A-V:0.071 [1365:447]
Writing index...
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Video stream: 1365.588 kbit/s (170698 B/s) size: 1099729277 bytes 6442.526 secs 154466 frames
Audio stream: 448.000 kbit/s (55999 B/s) size: 360772608 bytes 6442.368 secs

If you are wondering what the mencoder options are, here is a basic run down.

-forceidx – this forces the regeneration of the index table for the video. Apparently it’s needed.
-ovc copy – this tells mencoder to copy the video codec exactly as per the input file(s). In other words don’t re-encode it.
-oac copy – this tells mencoder to copy the audio codec exactly as per the input file(s). Again, in other words don’t re-encode it.

Oh, and in case you are wondering if you have more than two files you just add more on to the end of the command. Example:

mencoder -forceidx -ovc copy -oac copy -o outputfile.avi firstfile.avi secondfile.avi thirdfile.avi forthfile.avi

Also, if you don’t actually have mencoder, you can install it by running this command:

sudo apt-get install mencoder

References: http://www.mplayerhq.hu/DOCS/HTML/en/index.html

Convert JVC TOD to MPEG Video – tod2mpeg

If you own a JVC video recorder, you may have noticed that it stores it’s videos in TOD format. This is highly annoying as it’s not very useful if you want to view it on a simply device such as a Western Digital TV HD Media Player. The good news, is that there is a simple way to turn your TOD videos into MPEG videos using ffmpeg. It should also work for MOD files, but I haven’t testing it yet – please tell me if it works. I wrote a simple bash script to do this:

#!/bin/bash
video="$1"
newvideo="${video/%tod/mpg}"
ffmpeg -i "$1" -acodec copy -vcodec copy "$newvideo"
mv "$video" "$video.done"

You can download this script here –>tod2mpeg.zip

Run this script by putting the TOD video filename after the script name.

Eg: tod2mpeg mod123.tod

It will use ffmpeg to convert to mpeg and once completed will append “.done” to the end of the TOD filename. You should be left with a mpeg file of the same name. eg. mod123.mpeg.

You will notice a whole bunch of messages coming out of ffmpeg. Just ignore these.

I’ve also written a little wrapper perl script to enable me to run tod2mpeg on multiple files. Download this here –>tod2mpeg-multi.zip. You will need to make sure that you already have the tod2mpeg script in your path somewhere (eg. ~/bin/ or /usr/local/bin).

You will need to pass a list of TOD files into this script like this:

ls *.tod | tod2mpeg-multi