LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-11-2007, 01:39 PM   #1
gbowden
Member
 
Registered: Dec 2003
Location: Spain
Distribution: Slackware 14.1 64bit - multilib
Posts: 148

Rep: Reputation: 28
Extract audio from exif jpeg file?


My digital camera can embed audio inside the jpeg image file, I was wondering if there is a tool to extract the audio data?
 
Old 06-11-2007, 05:59 PM   #2
erklaerbaer
Member
 
Registered: Mar 2006
Posts: 381

Rep: Reputation: 31
Quote:
http://linuxgazette.net/117/lg_mail.html
Digital camera audio files
Fri Jul 22 11:43:02 2005
Bob van der Poel (bvdp at uniserve.com)
Answered By Lew Pitcher, Ben Okopnik

I've recently gotten a digital camera (yes, I know I'm sort of late coming into the digital revolution). This is a HP R607 and lets you add audio tags to still images.

[Lew] Kewl.

I would have thought that the audio would be a wav or mp3 file with the same name as the image, but life is never easy. I can only assume that the audio is embbedded into the jpg. I've checked, and the only files on the camera (other than some short XML files) are the jpgs.

[Lew] Yah. The JFIF format (that's the file format that "JPEG" pictures are stored in) supports a bunch of metadata. Many (I'm tempted to say most) cameras store a 'thumbnail' photo in the jpg along with the full photo. They also store camera information (make, model) and photo metadata (date/time of photo, focal of lens, exposure time, photographers comments, picture orientation, and a whole lot more). It wouldn't surprise me if the HP camera also stored an audio clip as metadata in the picture jpg.

[Ben] When you say that you've checked, do you mean that you used something like "camedia", or did you actually mount it as a storage device and looked at the files on it? The former may only show the JPG files, while the latter should show everything. My Olympus D-40, for example, produces discrete files for audio, stills, and movies.

If you're actually looking at the files on the device, then I'd have to agree with the previous post - it's stored as EXIF data.

Yes. It is definitely stored as EXIF data. Ran a jpg file into emacs and had a look. There's a nice RIFF/WAV header block right in the file. Of course, the picture files without audio don't have the header.

More reading leads me to think that some cameras use 2 files and others embed the audio into the picture. Mine is that later

So, is there a way to play the audio in the pictures on Linux?

[Lew] I'm not sure, but it's likely that the audio is stored in one of the EXIF (JFIF metadata) tags. There are tools available that can extract EXIF tag data, ranging from the digikam/gphoto2/libgphoto tools to standalone tools like jhead. Perhaps one of these tools can extract out the audio, and you can play it from there.

Yes, it helps. Problem is to find a tool to do the extraction. digikam, etc (based on gphoto2) do NOT seem to support audio play/extraction.

[Ben] 'gphoto2' supports a '--get-audio-data' option. There are probably a number of other programs; googling for "exif audio extract linux" comes up with 40,500 hits.

I think from reading and a bit of testing that --get-audio-data just copies .wav files if they are on the camera. I could be wrong, but I could not get this program to extract data.

I did the google as well I found 2 candidate programs:

dphotox - this appears to be a great program, but I can't access the download site ftp://ftp.mostang.com/pub/dphotox I sent David.Mosberger @acm.org a note, but no reply as of yet. This is being distributed as a binary only ... something to do with non-disclosure according to the web page (which is accessable http://www.mostang.com/dphotox )

EXIFutilsLinux2.6.2.tgz is another package which works. Installed and tried it. It is shareware and they want a bit of money to unlock all the features.

Amazing, the files I did extract sounded not bad at all.

I can't imagine that getting the audio out is much more than trivial. I just don't have time right now, but I did compare the extracted file to the data in the camera file and it is identical. Just a matter of figuring an offset and the size.

[Jimmy] I shouldn't imagine it's even that difficult: the audio is stored as an EXIF tag, so you really just need to extract the contents of a specific tag. (Hint: with Perl, Image::EXIF and Data:umper are your friends).

If you want to send along a sample file, I'd be happy to give it a stab/eat my words

[Heather] dd has a very nice 'skip' option as well as 'count'. if your 'blocksize' is set to 1 and you are otherwise able to calculate how long to make the cut, you should be able to do something like substring extraction, on a file basis.

If our gentle readers have more ideas, or someone would like to do an article on really getting the most out of your camera under Linux, it'd be just the kind of thing to make Linux just a little more fun
this was the first hit on google for 'exif audio extract' ....
 
Old 06-12-2007, 03:13 AM   #3
gbowden
Member
 
Registered: Dec 2003
Location: Spain
Distribution: Slackware 14.1 64bit - multilib
Posts: 148

Original Poster
Rep: Reputation: 28
I saw that, I have gphoto2 and exiftools, but I don't really know how to work them.
 
Old 06-12-2007, 12:30 PM   #4
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Well, guess it's time to RTFM. Read the man pages and other documentation. Surely you can't expect someone to read them for you and then tell you what to do ...

But, maybe you'll get lucky and someone here may have used these tools in such a way, and maybe tell you what to do.

Last edited by H_TeXMeX_H; 06-12-2007 at 12:32 PM.
 
Old 06-13-2007, 11:13 PM   #5
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Quote:
Originally Posted by H_TeXMeX_H
Well, guess it's time to RTFM. Read the man pages and other documentation. Surely you can't expect someone to read them for you and then tell you what to do ...

But, maybe you'll get lucky and someone here may have used these tools in such a way, and maybe tell you what to do.
This would fall into the age old category of "If you don't have anything constructive to say, don't say anything at all" mantra. If you can provide constructive information on how to solve the original posters problem, please add to the thread. If you simply want to tell someone to read a manual, feel free to move along to another thread where you may be able to help.

Thank you.
 
Old 06-13-2007, 11:32 PM   #6
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Actually, I agree with H_TexMex_H, but there may be an easier manual. I have heard that the program, Serpentine, can extract the audio from video files. Also, the "Similar Posts" listed at the bottom of this page may contain useful information.

Last edited by rickh; 06-13-2007 at 11:34 PM.
 
Old 06-13-2007, 11:59 PM   #7
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
So, saying read 'man gphoto2' and 'man exiftools' is not constructive ?

I'm quite sure the answer is in there. And, if it's not there, then it's nowhere.
 
Old 06-14-2007, 12:16 AM   #8
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
3.2.5 How do I extract the Flashpix audio stream from an image file?
Some image files contain a Flashpix audio recording. The exiflist command can be used extract the audio
data from an image file and store it in a separate file.
The basic command to extract the thumbnail image is:
exiflist -w . filename
where filename is the name of the file from which the audio stream is to be extracted. The thumbnail will be
written to a file whose name is generated from the filename from which it was extracted. For example, if the
audio stream were extracted from a file called myphoto.jpg, then audio file would be called myphoto.wav.
Refer to the EXIFutils Command Referrence Manual for information about extracting audio data using
exiflist.
Taken from:
http://www.hugsan.com/EXIFutils/Docu...ngStarted1.pdf

Is this what is needed ... it took me ~2 min to find it.
 
Old 06-14-2007, 02:55 AM   #9
gbowden
Member
 
Registered: Dec 2003
Location: Spain
Distribution: Slackware 14.1 64bit - multilib
Posts: 148

Original Poster
Rep: Reputation: 28
Thanks for your help, the man pages for exiftools and gphoto2 were the most complicated man pages I have ever seen.

Anyway, I found exiflist the other day and it works perfectly.

Regards,

Greg
 
Old 07-13-2007, 08:08 AM   #10
vishnupv
LQ Newbie
 
Registered: Jul 2007
Posts: 1

Rep: Reputation: 0
Please send me that JPEG

Hi.. It's interesting that a JPEG contains the sound data..
I am much more intersted in That part, and so, I request you to send that JPEG file,containing audio data to my Email ID.
It's visnupv@gmail.com
THanks
Vishnu
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copy-mode extract of audio from youtube flv video moob8 Linux - Desktop 18 10-05-2013 08:44 AM
Extract audio from .wmv $in Linux - Software 10 07-10-2005 05:31 PM
extract video audio Latem Linux - Software 0 02-05-2005 05:07 PM
Html file to Jpeg or Png? akihandyman Mandriva 2 10-02-2004 10:00 AM
extract audio from dvd freeindy Linux - Software 4 08-22-2004 06:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration