Extract cover image from OGG file

I need to extract cover from OGG file.

I'm tries to decode base64 string stored in METADATA_BLOCK_PICTURE tag, wich I'm getting with following command:

vorbiscomment -R -e 1.ogg

Base64 decoding is working without errors, but resulting binary file is not opening neither like JPG, nor like PNG.

Example file: http://regress78.com/1.ogg

Answers


There's a header on the binary data before the JFIF or PNG stream starts.

I'm able to extract a valid jpeg file after parsing out the header length (42 bytes in this case) from a hexdump:

$ vorbiscomment -R -e 1.ogg | grep METADATA_BLOCK_PICTURE | cut -d '=' -f 2 | base64 -d > 1.dat
base64: invalid input
$ dd if=1.dat of=1.jpeg bs=1 skip=42
114424+0 records in
114424+0 records out
114424 bytes (114 kB) copied, 0.112082 s, 1.0 MB/s
$ file 1.jpeg
1.jpeg: JPEG image data, JFIF standard 1.01, resolution (DPI), density 72x72, segment length 16, Exif Standard: [TIFF image data, big-endian, direntries=1], baseline, precision 8, 496x500, frames 3

Need Your Help

Why is Entity Framework 6.1.3 throwing a "Could not load type 'System.Data.Entity.Infrastructure.TableExistenceChecker'"

c# .net entity-framework entity-framework-6

Brand new project and entity framework will not start due to the exception being thrown as soon as the context instance is created.

Genetic algorithms -- what are the benefits of sexual, as opposed to asexual, genetic algorithms?

genetic-algorithm evolutionary-algorithm genetic-programming

Intuitively I'd think that if I want to find the "best" set of parameters, I can simply take the best performing 1 guy from a subset of lots of children, make that guy generate 100 children similar...