Showing posts with label converting. Show all posts
Showing posts with label converting. Show all posts

Tuesday, 25 July 2017

Converting mp4 to mp3 in Ubuntu

Converting mp4 to mp3 in Ubuntu



Converting mp4 files to mp3 can easily be done via the terminal. First install ffmpeg and the necessary codecs by typing:

sudo apt-get install libav-sudo apt-get install ffmpeg libavcodec-extra-52
sudo apt-get update
sudo apt-get install ffmpeg libavcodec-extra-53
Than you can convert your file via:
ffmpeg -v 5 -y -i inputfile.mp4 -acodec libmp3lame -ac 2 -ab 192k outputfile.mp3

For example go to the video folder and convert your file like this:
cd Videos
ffmpeg -v 5 -y -i writelikethewind.mp4 -acodec libmp3lame -ac 2 -ab 192k writelikethewind.mp3

This should look something like this:

Note that I use ls to get a listing of alle the files in the current directory.

Also read my article on converting between different video format.
{ Read More }


Thursday, 20 July 2017

Converting a space delimited file to tab delimited

Converting a space delimited file to tab delimited


try this one liner
       cat file | tr
 
{ Read More }


Converting Ekam to C 0x

Converting Ekam to C 0x


I converted Ekam to C++0x. As always, all code is at:

http://code.google.com/p/ekam/

Note that Ekam now requires a C++0x compiler. Namely, it needs GCC 4.6, which is not officially released yet. I didnt have much trouble compiling and using the latest snapshot, but I realize that it is probably more work than most people want to do. Hopefully 4.6 will be officially released soon.

Introduction

When writing Ekam, with no company style guide to stop me, I have found myself developing a very specific and unique style of C++ programming with a heavy reliance on RAII. Some features of this style:

  • I never use operator new directly (much less malloc()), but instead use a wrapper which initializes an OwnedPtr. This class is like scoped_ptr in that it wraps a pointer and automatically deletes it when the OwnedPtr is destroyed. However, unlike scope_ptr, there is no way to release a pointer from an OwnedPtr except by transferring it to another OwnedPtr. Thus, the only way that an object pointed to by an OwnedPtr could ever be leaked (i.e. become unreachable without being reclaimed) is if you constructed an OwnedPtr cycle. This is actually quite hard to do by accident -- much harder than creating a cycle of regular pointers.
  • Ekam is heavily event-driven. Any function call which starts an asynchronous operation returns an OwnedPtr<AsyncOperation>. Deleting this object cancels the operation.
  • All OS handles (e.g. file descriptors) are wrapped in objects that automatically close them.

These features turn out to work extremely well together.

A common problem in multi-tasking C++ code (whether based on threads or events) is that cancellation is very difficult. Typically, an asynchronous operation calls some callback at some future time, and the caller is expected to ensure that the callbacks context is still valid at the time that it is called. If youre lucky, the operation can be canceled by calling some separate cancel() function. However, its often the case that this function simply causes the callback to complete sooner, because its considered too easy to leak memory if an expected callback is never called. So, you still have to wait for the callback.

So what happens if you really just want to kill off an entire large, complex chunk of your program all at once? It turns out this is something I need to do in Ekam. If a build action is in progress and one of its inputs changes, the action should be immediately halted. But actions can involve arbitrary code that can get fairly complex. What can Ekam do about it?

Well, with the style Ive been using, cancellation is actually quite easy. Because all allocated objects must be anchored to another object via an OwnedPtr, if you delete a high-level object, you can be pretty sure that all the objects underneath will be cleanly deleted. And because asychronous operations are themselves represented using objects, and deleting those objects cancel the corresponding operations, its nearly impossible to accidentally leave an operation running after its context has been deleted.

Problem: OwnedPtr transferral

So what does this have to do with C++0x? Well, there are some parts of my style that turn out to be a bit awkward.

Transferring an OwnedPtr to another OwnedPtr looked like this:

 OwnedPtr<MyObject> ptr1, ptr2; //... ptr1.adopt(&ptr2); 

Looks fine, but this means that the way to pass ownership into a function call is by passing a pointer to an OwnedPtr, getting a little weird:

 void Foo::takeOwnership(OwnedPtr<Bar>* barToAdopt) { this->bar.adopt(barToAdopt); } ... Foo foo; OwnedPtr<Bar> bar; ... foo.takeOwnership(&bar); 

Returning an OwnedPtr is even more awkward:

 void Foo::releaseOwnership(OwnedPtr<Bar>* output) { output->adopt(&this->bar); } ... OwnedPtr<Bar> bar; foo.releaseOwnership(&bar); bar->doSomething(); 

Furthermore, the way to allocate an owned object was through a method of OwnedPtr itself, which was kind of weird to call:

 OwnedPtr<Bar> bar; bar.allocate(constructorParam1, constructorParam2); foo.takeOwnership(&bar); 

This turned out to be particularly ugly when allocating a subclass:

 OwnedPtr<BarSub> barSub; barSub.allocate(constructorParam1, constructorParam2); OwnedPtr<Bar> bar; bar.adopt(&barSub); foo.takeOwnership(&bar); 

So I made a shortcut for that:

 OwnedPtr<Bar> bar; bar.allocateSubclass<BarSub>( constructorParam1, constructorParam2); foo.takeOwnership(&bar); 

Still, dealing with OwnedPtrs remained difficult. They just didnt flow right with the rest of the language.

Rvalue references

This is all solved by C++0xs new "rvalue references" feature. When a function takes an "rvalue reference" as a parameter, it only accepts references to values which are safe to clobber, either because the value is an unnamed temporary (which will be destroyed immediately when the function returns) or because the caller has explicitly indicated that its OK to clobber the value.

Most of the literature on rvalue references talks about how they can be used to avoid unnecessary copies and to implement "perfect forwarding". These are nice, but what I really want is to implement a type that can only be moved, not copied. OwnedPtrs explicitly prohibit copying, since this would lead to double-deletion. However, moving an OwnedPtr is perfectly safe. By implementing move semantics using rvalue references, I was able to make it possible to pass OwnedPtrs around using natural syntax, without any risk of unexpected ownership stealing (as with the old auto_ptr).

Now the code samples look like this:

 // Transferring ownership. OwnedPtr<MyObject> ptr1, ptr2; ... ptr1 = ptr2.release(); // Passing ownership to a method. void Foo::takeOwnership(OwnedPtr<Bar> bar) { this->bar = bar.release(); } ... Foo foo; OwnedPtr<Bar> bar; ... foo.takeOwnership(bar.release()); // Returning ownership from a method. OwnedPtr<Bar> Foo::releaseOwnership() { return this->bar.release(); } ... OwnedPtr<Bar> bar = foo.releaseOwnership(); bar->doSomething(); // Allocating an object. OwnedPtr<Bar> bar = newOwned<Bar>( constructorParam1, constructorParam2); // Allocating a subclass. OwnedPtr<Bar> bar = newOwned<BarSub>( constructorParam1, constructorParam2); 

So much nicer! Notice that the release() method is always used in contexts where ownership is being transfered away from a named OwnedPtr. This makes it very clear what is going on and avoids accidents. Notice also that release() is NOT needed if the OwnedPtr is an unnamed temporary, which allows complex expressions to be written relatively naturally.

Problem: Callbacks

While working better than typical callback-based systems, my style for asynchronous operations in Ekam was still fundamentally based on callbacks. This typically involved a lot of boilerplate. For example, here is some code to implement an asynchronous read, based on the EventManager interface which provides asynchronous notification of readability:

 class ReadCallback { public: virtual ~ReadCallback(); virtual void done(size_t actual); virtual void error(int number); }; OwnedPtr<AsyncOperation> readAsync( EventManager* eventManager, int fd, void* buffer, size_t size, ReadCallback* callback) { class ReadOperation: public EventManager::IoCallback, public AsyncOperation { public: ReadOperation(int fd, void* buffer, size_t size, ReadCallback* callback) : fd(fd), buffer(buffer), size(size), callback(callback) {} ~ReadOperation() {} OwnedPtr<AsyncOperation> inner; // implements IoCallback virtual void ready() { ssize_t n = read(fd, buffer, size); if (n < 0) { callback->error(errno); } else { callback->done(n); } } private: int fd; void* buffer; size_t size; ReadCallback* callback; } OwnedPtr<ReadOperation> result = newOwned<ReadOperation>( fd, buffer, size, callback); result.inner = eventManager->onReadable(fd, result.get()); return result.release(); } 

Thats a lot of code to do something pretty trivial. Additionally, the fact that callbacks transfer control from lower-level objects to higher-level ones causes some problems:

  • Exceptions cant be used, because they would propagate in the wrong direction.
  • When the callback returns, the calling object may have been destroyed. Detecting this situation is hard, and delaying destruction if needed is harder. Most callback callers are lucky enough not to have anything else to do after the call, but this isnt always the case.

C++0x introduces lambdas. Using them, I implemented E-style promises. Heres what the new code looks like:

 Promise<size_t> readAsync( EventManager* eventManager, int fd, void* buffer, size_t size) { return eventManager->when(eventManager->onReadable(fd))( [=](Void) -> size_t { ssize_t n = read(fd, buffer, size); if (n < 0) { throw OsError("read", errno); } else { return n; } }); } 

Isnt that pretty? It does all the same things as the previous code sample, but with so much less code. Heres another example which calls the above:

 Promise<size_t> readPromise = readAsync( eventManager, fd, buffer, size); Promise<void> pendingOp = eventManager->when(readPromise)( [=](size_t actual) { // Copy to stdout. write(STDOUT_FILENO, buffer, actual); }, [](MaybeException error) { try { // Force exception to be rethrown. error.get(); } catch (const OsError& e) { fprintf(stderr, "%s ", e.what()); } }) 

Some points:

  • The return value of when() is another promise, for the result of the lambda.
  • The lambda can return another promise instead of a value. In this case the new promise will replace the old one.
  • You can pass multiple promises to when(). The lambda will be called when all have completed.
  • If you give two lambdas to when(), the second one is called in case of exceptions. Otherwise, exceptions simply propagate to the lambda returned by when().
  • Promise callbacks are never executed synchronously; they always go through an event queue. Therefore, the body of a promise callback can delete objcets without worrying that they are in use up the stack.
  • when() takes ownership of all of its arguments (using rvalue reference "move" semantics). You can actually pass things other than promises to it; they will simply be passed through to the callback. This is useful for making sure state required by the callback is not destroyed in the meantime.
  • If you destroy a promise without passing it to when(), whatever asynchronous operation it was bound to is canceled. Even if the promise was already fulfilled and the callback is simply sitting on the event queue, it will be removed and will never be called.

Having refactored all of my code to use promises, I do find them quite a bit easier to use. For example, it turns out that much of the complication in using Linuxs inotify interface, which I whined about a few months ago, completely went away when I started using promises, because I didnt need to worry about callbacks interfering with each other.

Conclusion

C++ is still a horribly over-complicated language, and C++0x only makes that worse. The implementation of promises is a ridiculous mess of template magic that is pretty inscrutable. However, for those who deeply understand C++, C++0x provides some very powerful features. Im pretty happy with the results.

{ Read More }


Friday, 14 July 2017

Converting videos using viDrop

Converting videos using viDrop


Converting videos to different file formats can sometimes be useful when different device only support certain formats. Luckily, there is a handy program for that viDrop transcoder.
Simply install it by running the following commands from terminal:

sudo add-apt-repository "deb http://download.learnfree.eu/repository/skss / #SKSS"
wget http://download.learnfree.eu/repository/skss/repo.pub.asc -q -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install vidrop

Start the program from the Dash and convert your videos by first choosing the video which you want to convert.


Then you can just click convert or choose Advanced settings for further modification, which would look something like this:

Also read my article on converting mp4 to mp3 via ffmpeg.
{ Read More }


Wednesday, 12 July 2017

Converting Enum to List

Converting Enum to List


Method :



Usage :

{ Read More }


Saturday, 24 June 2017

Converting various old post

Converting various old post


To convert images to pdf or to other formats
in terminal:

      convert *.jpg my_new.pdf
or
   convert *.png my_newpng.pdf 

More here

LibreOffice (OpenOffice) Writer is a great tool for converting images to pdf, as explained here.

convert *.pdf *.jpg




To convert media files, see this. Also, Format Factory works fine in Wine.

To add convert commands to Thunars custom actions or similar (or just run them in terminal in the proper folder):


sudo apt-get install ffmpeg libavcodec-unstripped-52
 
(Multiverse repository has to be enabled.)

Or, in Synaptic, install libavcodec-extra-53.

Then, use such commands to add to Thunar custom actions:

ffmpeg -i %f %f.mp3

or

avconv -i %f %f.mp3 

To see it in a Terminal it should look like:
gnome-terminal --window-with-profile=new1 -e "avconv -i %f %f.mp3" 

(In Gnome Terminal, create a new profile called "new1" and edit it (Edit/Profiles/Title and Command) to When command exits: Hold the Terminal open.)

See this post on how to extract audio from video file without change
{ Read More }


Tuesday, 20 June 2017

Converting Windows 10 32 bit Windows 10 64 bit problem

Converting Windows 10 32 bit Windows 10 64 bit problem


Problem
Trying to find a way to Convert Windows 10 32 bit to Windows 10 64 bit


1.  Download ndows
{ Read More }


Tuesday, 13 June 2017

converting video for a media player Roku Panasonic Android

converting video for a media player Roku Panasonic Android


Media players are awesome, but only play certain types of videos.  Currently I work with a newish Panasonic TV (awesome), a Roku (very good), and a Bluray player with a USB port (pretty good).

All of these are rather particular about which videos and which codecs and which audio theyll play.  Sometimes everything will be great, but the sound will be out of sync!  Or everything will be in sync... until the end of the movie, where things will gradually get messed up.

Its helpful to have a workflow to iron out video conversion issues quickly.

What finally worked for me was:

1) install Handbrake (both handbrake-gtk and handbrake-cli)
2) convert 20-ish seconds several minutes into the program
3) copy video to USB stick
4) put in media player, try it
5) change conversion settings, repeat from step 2

Here is step #2 in a command line:
HandBrakeCLI -i input.avi --start-at duration:200 --stop-at duration:20 -o z.mp4


Lastly, its easy to automate this.  This debugging script prints out input.mp4 for each input.avi file:
for input in *.avi ; do echo ${input%.avi}.mp4 ; done

Many video files have spaces, which Linux doesnt like too well.  Quote them:
for input in *.avi ; do echo "$input" "${input%.avi}.mp4" ; done

Putting it all together, we can convert all our videos to mediaplayer-friendly MP4 files with this one-liner.  In my case I found adding the "deblock" filter made my bad source files a little nicer to watch:
for input in *.avi ; do HandBrakeCLI -i "$input" --deblock -o "${input%.avi}.mp4" ; done

If youre insane like me, convert the movies in parallel, two at a time (P2):
for input in *.avi ; do echo "${input%.avi}" ; done | xargs -i -P2 HandBrakeCLI -i "{}".avi -o "{}".mp4 
The output will stutter, as Handbrake will write multiple status lines on top of each other, but thems the breaks.


A version of this on bashoneliners.com





{ Read More }


Saturday, 10 June 2017

Converting very old file formats to a more modern file format wot WPMacAPP on your Mac running 10 11

Converting very old file formats to a more modern file format wot WPMacAPP on your Mac running 10 11


I�ll cut to the chase here. If you use a current Mac with OS X 10.11.x and you want to convert a bunch of old Word 5.1a for Mac or WordPerfect 2.x for Mac files into a Word 97-2004 .doc file that Word 2016 can read, then you need to download WPMacApp from Edward Mendelson�s Website, wpdos.org.

You go here to get to the page on WPDOS.org with the specific WordPerfect on Mac information. This site covers just about every instance of WordPerfect, Wordperfect for DOS in particular, on MS-DOS, Windows, Macintosh, and Linux. So you could get lost. Just look at the top for links to the various pages on the site.�

READ THE INSTRUCTIONS MR. MENDELSON HAS POSTED ABOUT USING THIS APPLICATION WITH OS X. YOU HAVE TO MAKE TEMPORARY CHANGES TO THE SECURITY SETTINGS BEFORE IT WORKS.�

This page does not have a big obvious icon for you to click on to download this app. The link is the second item down on a bulleted list. It says in bold text Download the disk image file�(Warning: About 530 MB)


Please Look here for WPMacAPP

Mr. Mendelson� has included WordPerfect for Mac 1.05, WordPerfect for Mac 2.1, WordPerfect for Mac 3.5, and WordPerfect for Macintosh 3.5e,� and WordPerfect Works for Macintosh 1.2 and the Envoy app, which competed with Adobe Acrobat.

That covers it for WordPerfect for Mac apps. As for Word for Mac, he includes an installation of Word for Mac 5.1a. Look in the Applications folder on the WPMac HD volume.�

You�ll also find MacLink Plus 11, which can convert a wide range of documents and images that you may have on your system and didn�t know what to do with. Archaic WordStar files? MacLink Plus can convert it into Word 97-2004 format. Old images files in ZSoft .pcx format? Again, MacLink Plus can convert it into JPEG or PNG format or GIF format, which your Mac�s Preview app can read.�

Finally, can you install Appleworks 6 from your old iMac G3 CDs? Yes, you can.�

Just copy the installer app, about 27 mega bytes in size, over to your /Users/<Username>/Documents folder. From there, copy the installer over to the WPMac HD virtual hard drive icon in the upper right-hand corner of the window from the Unix virtual hard drive icon.

The Unix icon is really just a link to the folder on your Mac chosen by WPMacApp to serve as the conduit between your emulated old Mac and your physical new Mac.�

Appleworks 6 installed. WPMacAPP quit upon finishing installation. I restated. After rebuilding the desktop, all is fine. Using the already installed MacLink Plus 11, I can import and export in a wide variety of formats.�

That�s my brief introduction to reading very old file formats on your Mac through the use of WPMacApp. Go at it! And Donate to Mr. Mendelson if you use some of his work. He�ll appreciate it.�

Tom Briant

Editor, MacValley Blog

{ Read More }


Saturday, 3 June 2017

Converting vmdk file to vmx

Converting vmdk file to vmx


(you need to install ovftool provided by VMWare)

If you have ovf file for the vmdk file then use the follwing command and it will generate vmx

ovftool old.ovf new.vmx

It will show the progress as following

Opening OVF source: old.ovf

Warning: File is not referred in the manifest: old.ovf

Opening VMX target: new.vmx

Writing VMX file: new.vmx

Disk progress: 94%

{ Read More }


Friday, 26 May 2017

Converting IMG files to ISO images

Converting IMG files to ISO images


Some time you will find CD images with .img extentions. Most probably such images are created by clonecd, a windows program.

IMG files are raw-data copies of optical media and are primarily used  to  store  CDs with  odd  properties,such as sectors which need to have read errors when read. Conversion to ISO format removes this  information,as ISO format does not support this.

You can manipulate  such images if you install ccd2iso package.
   sudo aptitude install ccd2iso

  You can  convert  img files to iso files as shown below.
    ccd2iso file.img file1.iso
 IMG  files almost always include a SUB file, which contains additional data for the disc format, and a CCD file, which is a plaintext configu-ration file describing the disc layout.ccd2iso does not make use of  these files

  
{ Read More }


Thursday, 25 May 2017

Converting DVDs to Good Quality AVI Files Part 2 The Procedure

Converting DVDs to Good Quality AVI Files Part 2 The Procedure


Forget the why and wherefores of what were doing - Thats part one which you can read here.

Lets get started;

Ingredients
  • A computer with a large hard drive 20GB Free? Pentium 4 3GHz or Faster and a DVD drive
  • A copy of DVD Decrypter - its free
  • A copy of AutoGK - its free


DVD Decrypter
http://www.dvddecrypter.org.uk/
This software allows you to copy the files from a DVD to your hard drive. The project was shut down some years back but its still possible to get hold of it on the internet.

An alternative to this is DVD Fab. Theres a free version and a commercial version. The difference between the two is that the commercial version handles more DVD protection schemes. http://www.dvdfab.com/free.htm


AutoGK
http://www.autogk.me.uk/
AutoGK is short for Auto Gordian Knot which describes a knot so difficult to untie that it was cut instead. Its quite apt considering the purpose of this tool.

Its not a single piece of software but rather installs several pieces tied together by a single front-end. As a result, the setup program will spawn other setup programs. Watch them carefully because otherwise windows will get popped over and youll think the install has frozen when its really just waiting for input. All of the pieces of software in AutoGK are well worth having.

PART 1: Getting the files onto your PC using DVD Decrypter
  1. Put the DVD in your computers DVD drive

  2. Start DVD Decrypter - it should detect the disc

  3. It might also prompt for the region code (if it finds RCE protection)

  4. Look at the list of files - theyre named confusingly but the first number is the "title" and the second is the part.
    VTS_01_3.VOB means
    Part 3 of the first title.

    VOB files are video
    IFO files contain informtation about the VOB files.
    I dont know that BUP files are.

  5. You can either manually select all of the series of the largest files or you can click View, Select Main Movie Files plus IFO files.

  6. Next, Click on Tools, then Settings.

  7. Click the tab marked File Mode and in the options section make sure that File Splitting says NONE.

  8. Then Click on IFO Mode and again, in the options section make sure that File Splitting says NONE.

  9. Choose a location to save in.

  10. Then click the DVD to file Icon to start the decryption.

  11. It will take a while, so go find something to do for 15-30 minutes.

PART 2: Converting the VOB to an AVI
  1. Start AutoGK

  2. Click on the little folder icon marked Input file and browse to the folder where you saved the output of DVD Decrypter.

  3. If everything went well, you should have a single VOB file and a bunch of IFO files. Only one IFO file will match the VOBs name.


  4. Open this in AutoGK.

  5. It should read in the VOB and display soundtracks and subtitles.

  6. Click on the little folder icon marked output file and chose a location and name for your output.

  7. Have a look at the audio and subtitle options. Youll want to pick one audio track - usually the top one. It might not matter so much about subtitles unless the movie is in a foreign language. If, like me, you prefer to have a subtitle track, you enable it here but it will be "burned in" to the movie. Its often easier to download a subtitle track in SRT format from Podnapsi later.

  8. Next youll want to select a file size.

  9. If you movie is about 90-100 minutes, you should be ok with 700MB but if you movie contains a lot of action scenes (or is long) consider increasing the size to 1400MB. Youll end up with much better quality.

  10. Next, click advanced settings and make sure that the resolution is set to Auto Width and the Audio is set to Auto. Note: If you were making a copy for a portable device like a phone with low resolution, these are the settings you might change.

  11. Choose an Video codec. XviD is recommended though DivX works well too.

  12. Leave the subtitles options unchecked and click ok.


  13. Finally, click Add Job and then click Start.

  14. You might think that nothing is happening but it will actually be working. It shells out to a DOS/Command line app for a lot of the work.

  15. Depending on your computer, the settings you chose and the movie you are converting, it could take 3 hours but at the end youll have a good quality AVI file.
If you right-click on that file and choose properties youll be able to find the frames per sec. Use that number to find a matching subtitle file on Podnapsi.

Note that if you cant figure out which track is which, you might want to try playing the VOB file directly in VLC Media Player. You can switch audio tracks in there and figure out which one youd prefer.

Easier Instructions
Of course, I didnt figure all of this out myself and if youd prefer video instructions, you might want to check out my inspiration on You Tube.

{ Read More }


Converting PSU of 168P P47ELL to 168P P50ELL and vice versa

Converting PSU of 168P P47ELL to 168P P50ELL and vice versa


Interchange power supply board connector with red mark.
{ Read More }


Thursday, 18 May 2017

Converting a simple program in Python to MIPS Assembly Language using the MARS Emulator

Converting a simple program in Python to MIPS Assembly Language using the MARS Emulator


     
                 See how you can convert a simple python program involving a for loop into the MIPS Assembly Language using the MARS Emulator.

Read Page ----->
{ Read More }


Saturday, 13 May 2017

converting for Roku

converting for Roku


Recently I tried to play a movie on my Roku XDS.  The video played fine, but the audio was gone, and there were no subtitles.

Using "avprobe" I saw my MPEG4 movie has two audio streams.  The Roku is finding the first, 5-speaker stream and playing it, instead of my desired stereo output.

So, the proper incantation to have normal audio is to tell avconv to use the first video stream, and skip the first audio stream:
avconv -i input.mp4 -codec copy -map 0 -map -0:a:0 output.mp4

Success!  Now about those subtitles...

{ Read More }


Converting Google Earth Lat and Long to coordinates that you can enter into your GPS

Converting Google Earth Lat and Long to coordinates that you can enter into your GPS


Following on from my blog about converting Google Maps URL into Lat and Long to enter into your GPS, here�s some info on how to convert from Google Earth to GPS coordinates.
Open Google Earth program and navigate to the location that you are interested in (search or fly there).
Click �Add placemark�
Drag the placemark to the spot that you want the GPS coordinates for (you will notice that the �New Placemark� window will open)
Click �OK�
Right click on the newly created placemark
Select the �Save place as��
Enter a filename to save the placemark to your computer (eg: filename.kmz)
Browse to the file on your computer (using Internet Explorer)
Rename the file to have a .zip extension (eg: filename.kmz.zip)
Double click the .zip file and it should open the zip file�s contents to show a file called doc.kml
Right click on doc.kml file and select �View�
The file should open and then search for <coordinates>"
The GPS coordinates should then be displayed that you can enter into your GPS
eg: <coordinates>31.07549643928536,-17.79160330480021,0</coordinates>
Lat: 17�4729.77"S, Long: 31� 431.79"E

See here for a GPS Latitude and Longitude Converter
image

From http://www.csgnetwork.com/gpscoordconv.html:
If you are not familiar with latitude and longitude, here is a crash course in navigation
Lines of latitude and longitude are hypothetical lines on the surface of the Earth.
On the Earth, lines of latitude are circles of different size.
The longest (largest in diameter) is the equator, whose latitude is zero, while at the poles, at latitudes 90� north and 90� south (or -90�), the circles shrink to a point.
On the Earth, lines of constant longitude (meridians) extend from pole to pole, and cross the lines of latitude.
Every point on the surface of the Earth has coordinates where a given line of latitude and a give line of longitude intersect (cross).
To sum it up, latitude is measured from the equator, with positive values going north (0 to 90) and negative values going south (0 to -90).
Longitude is measured from the Prime Meridian (which is the longitude that runs through Greenwich, England), with positive values going east (0 to 180) and negative values going west (0 to -180).
So, for example, 65 degrees west longitude, 45 degrees north latitude is -65 degrees longitude, +45 degrees latitude. Now that the designations (and reasons for them) are perfectly clear, here is the set of formulae if you need to do this manually.

Degrees Minutes Seconds to Degrees Minutes.m (GPS)
Degrees = Degrees, Minutes.m = Minutes + (Seconds / 60)

Degrees Minutes.m to Decimal Degrees
.d = M.m / 60, Decimal Degrees = Degrees + .d

There are 60 minutes in a degree and 60 seconds in a minute; 3600 seconds in a degree. There are 360 degrees in a complete circle or sphere but in all longitude and latitude measurements, the total of the degrees is expressed as 2 halves of 180 degrees each.

{ Read More }


Tuesday, 25 April 2017

Converting DVDs to Good Quality AVI Files Part 1 The Waffle

Converting DVDs to Good Quality AVI Files Part 1 The Waffle


Im very much a believer in the idea that "files" will be the next big format for video entertainment after DVDs. I guessed right from the start that blu-ray would win the format war against HD-DVD but I never thought that either would take over.

About 15 years ago, after having ridden the music upgrade from LP Records to tapes and to CD, I stumbled across this "new" format called MP3. Back then, there were no MP3 players, just computers but I was enthralled by the idea that with enough storage, I could save my music collection in a way that meant that I could play them without ever having to get a CD out of the cupboard again.

I emarked on a quest to convert my entire library of Music CDs to MP3. People thought I was weird but a few years later as MP3 players became more readily available, I reaped the rewards. I didnt have to convert anything - it was already done.

I see video entertainment as following the same path. As with my early MP3 conversions, the problems were two-fold.
1. Finding a reliable converter/process
2. Storage

Recently, I bought a Western Digital WDTV box (mainly so that I didnt have to burn Doctor Who episodes to DVD when downloading them from the UK). Copyright people; dont give me those accusatory stares - I buy the DVDs when they become available. Its just that the net has a bad habit of "spoiling" the twists when I wait for Australia to screen them - yes, even when its only one week later.

Of course, I dont want to stop there. Its my ambition to convert my sizable DVD collection to files for discless viewing - and perhaps Ill throw in a few fixes along the way.

Fixes? you say? Huh..?

As a partially (mostly) deaf person, I find that I really need subtitles with my movies - and Im really annoyed when they arent provided. Recently I bought Mozart and the Whale. Unfortunately the Australian distributor of this film doesnt care about subtitles. I ripped it to AVI format and then I went looking on http://www.podnapisi.net/ for a subtitle file (SRT format). I managed to get one and now when I play the file in VLC Media Player - or on my WDTV player it works!

The final question is one of quality. We can get close to movie quality in AVI format (with a big enough file - 800MB for a movie) but sound is a problem. Its MP3 format. I used to care a lot about surround sound but since Im deaf, it really doesnt make a whole lot of difference to me. Still, sound and quality are important considerations. For now, the AVI format will do but Im on the lookout for something better.

When a royalty-free file format capable of holding, video, 3d video, multiple angles, multiple subtitles, various soundtracks, chapters and display covers appears, Ill jump there pretty quick.

Next time; Enough of the Waffle - Next time Ill explain how to rip a DVD to a good quality AVI file using free tools.
{ Read More }


Monday, 24 April 2017

Converting and Transferring audio video to iPod iPhone on Ubuntu

Converting and Transferring audio video to iPod iPhone on Ubuntu


Converting videos to a form playable on iPod/iPhone and managing music of iPod has always been a problem on the Linux platform.This problem is compounded by the lack of documentation available. Now after spending some time searching for solution to this problem of transferring and managing music on iPod i finally came up with a solution to this problem which i have tried documenting in this article.

Note : This documentation was written and tried on Ubuntu 8.04 so if you are using any other distro of Linux or version of Ubuntu there might be need of modifying the instructions.


Converting videos to iPod format

avidemux is a neat application that allows one to easily convert videos to a form capable of being played on iPod and a number of other gadgets. avidemux has a neat looking GUI and is very easy to use and install.

Installing avidemux

To install avidemux issue the following command in the terminal window :

sudo apt-get install avidemux


After installing you can launch avidemux from (Applicatons -> Sound & Videos -> Avidemux )

This is how avidemux looks

After loading avidemux open the file you want to encode in iPod format in avidemux by clicking on the Open button and selecting the file you want to convert.

Now after the video is loaded into avidemux , in avidemux go to Auto->IPOD(mpeg4) you will find dialog box like this.


Now depending on whether you are using iPod video (320x240 or 640x480) , iPod nano or iPhone(PSP 480x272 ) chose appropriate resolution and click Ok .

Now click on the Save button to actually start converting the file.

encoding in progress


Transferring videos/music to ipod

A number of tools are available on the Linux platform that allows you to manage music collection of your ipod however there are few that actually allows you to copy and manage music as well as video content of your ipod and gtkpod is one of them.It might not have as user friendly interface as iTunes available on the windows platform(and through Codeweavers Crossover office on linux too) nevertheless it does the job of transferring videos and songs to ipod and managing them.


Installing gtk-pod

To install gtkpod issue the following command in the terminal window

sudo apt-get install gtkpod

After installation is over go to (Applications -> Sound & Video -> gtkpod) to launch gtkpod application.

This is how gtkpod looks

Now after connecting launch gtkpod and you will find you ipod listed in the leftmost pane of the application. One thing i dislike about gtkpod is all the songs and videos are clubbed together into single list this makes managing music and videos a lot difficult.


Now to add audio/video to your ipod just drag the respective file/folder into ipods playlist and press the save changes button and the files should be loaded properly in the ipod.

There are a number of other user friendly applications available too that allows you to manage music collection of your iPod and iPhone some of them are Rhythmbox(comes preloaded with Ubuntu and as soon as you connect ipod is loaded automatically), Juk , AmaroK , Songbird etc .

Article Written by : Ambuj Varshney (blogambuj@gmail.com)
For Desktop on Linux Blog , http://linuxondesktop.blogspot.com
(C) 2008 , Ambuj Varshney

{ Read More }


Monday, 17 April 2017

Converting Libraries for use in Cadence PKS

Converting Libraries for use in Cadence PKS


Our designkits (which shall remain unspecified except that you can get some of them from CMP) mainly support Synopsys tools. However we have limited licenses for Design Compiler so to use them in Cadence PKS you can use a nifty little program called syn2tlf. This converts .lib files to .tlf, used by Cadence PKS. What I dont yet know is how to check that the conversion is anywhere near sane.
{ Read More }


Thursday, 13 April 2017

Converting PDF to PNG JPG using ImageMagick in Linux

Converting PDF to PNG JPG using ImageMagick in Linux


Being an undergrad student a lot of the lecture notes and study related material i have is in PDF format now a lot of times i have felt the need of carrying this material around, however carrying laptop around all the time is just not feasible.I have a Video Ipod that could store images and one could view them on the go however it cannot display pdf files so my search began for a tool that could actually convert PDF files into PNG that could be later loaded on to the ipod and viewed at ones convenience .

Note : The installation instruction below are for Ubuntu however they should work perfectly well on any other distro as long as you have ImageMagik and Ghost Script installed.

Installing ImageMagick
ImageMagick is a powerful command line image processing package with a number of features you could install it using the following command :

sudo apt-get install imagemagick
After installation is over to convert say sample.pdf to sample.png issue the following command

convert sample.pdf sample.png
or

convert sample.pdf sample.jpg

Now if sample.pdf has multiple pages ImageMagick would convert each individual page into a separate file for example : 1st page as sample-0.png , 2nd page as sample-1.png and so on .

However ImageMagick internally uses Ghostscript to convert the file to graphics image so resolution might be bit less and if you want to convert document into higher resolution image you could do so by using Ghostscript directly.

There are number of options available in convert which you could inquire by issuing convert -? command.

Article Written by : Ambuj Varshney (blogambuj@gmail.com)
For Desktop on Linux Blog , http://linuxondesktop.blogspot.com
(C) 2008 , Ambuj Varshney
{ Read More }