Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-11-2007, 01:39 PM
|
#1
|
Member
Registered: Dec 2003
Location: Spain
Distribution: Slackware 14.1 64bit - multilib
Posts: 148
Rep:
|
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?
|
|
|
06-11-2007, 05:59 PM
|
#2
|
Member
Registered: Mar 2006
Posts: 381
Rep:
|
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' ....
|
|
|
06-12-2007, 03:13 AM
|
#3
|
Member
Registered: Dec 2003
Location: Spain
Distribution: Slackware 14.1 64bit - multilib
Posts: 148
Original Poster
Rep:
|
I saw that, I have gphoto2 and exiftools, but I don't really know how to work them.
|
|
|
06-12-2007, 12:30 PM
|
#4
|
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
|
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.
|
|
|
06-13-2007, 11:13 PM
|
#5
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
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.
|
|
|
06-13-2007, 11:32 PM
|
#6
|
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:
|
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.
|
|
|
06-13-2007, 11:59 PM
|
#7
|
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
|
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.
|
|
|
06-14-2007, 12:16 AM
|
#8
|
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
|
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.
|
|
|
06-14-2007, 02:55 AM
|
#9
|
Member
Registered: Dec 2003
Location: Spain
Distribution: Slackware 14.1 64bit - multilib
Posts: 148
Original Poster
Rep:
|
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
|
|
|
07-13-2007, 08:08 AM
|
#10
|
LQ Newbie
Registered: Jul 2007
Posts: 1
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 11:49 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|