PDA

View Full Version : strip audio (wave) from A/V file and pipe to oggenc ??


DaveQB
21st April 2005, 14:47
i often strip the audio from video files that have a compressed video but PCM audio. AND THEN compress to Ogg.

The problem here is time taken to generate 1-2 gig files AND the file space needed.

So.... i thought to pipe it straight to oggenc.

Here's regular command line to atrip the audio

mplayer video.avi -vc dummy -vo null -ao pcm -aofile output.wav

And then i would encode to Ogg Vorbis with
oggenc -q 0 output.wav

Or bash script those two lines.

So.... i tried

mplayer video.avi -vc dummy -vo null -ao pcm -aofile - | oggenc -q 0 - -o output.ogg

and it returns

ERROR: Input file "(stdin)" is not a supported format

But oggenc can indeed read the file from hard disk, so i gather my syntax is wrong.

Anyone ?? :)
cheers

KpeX
21st April 2005, 16:16
You could try it with a fifo pipe: $ mkfifo output.wav
$ mplayer video.avi -vc dummy -vo null -ao pcm -aofile output.wav & oggenc -q 0 output.wav

Transcode also might be able to do this, but I don't know the commandline offhand.

mikeX
21st April 2005, 21:42
transcode can encode to ogg directly (if compiled with vorbis support). The command should look something like this:

transcode -i <input> -y null,ogg -m <audio_output_file> -b 0,1,<quality>

DaveQB
23rd April 2005, 06:15
Neither worked for me

First one said it couldnt connect to socket (i chmod 777 the fifio pipe too)

The second, Transcode line, outputted


[export_null.so] v0.1.2 (2001-08-17) (video) null | (audio) null
[import_mp3.so] MP3->PCM
[import_mp3.so] tcextract -a 0 -i "video.avi" -x mp3 -d 0 | tcdecode -x mp3 -d 0 -z 12000
(avilib.c) cannot read from offset 0xe7ec1906 330168 bytes; broken (incomplete) file?
[export_ogg.so] oggenc -r -B 16 -C 2 -q 0.00 -R 48000 -Q -o "output.ogg" -
(avilib.c) cannot read from offset 0xe7ec1906 330168 bytes; broken (incomplete) file?


The input here is a MJPEG/MP3 file in AVI container.

ak
23rd April 2005, 08:46
How about this one:

> ffmpeg -i foo.avi -vn -f wav - | oggenc -o bar.ogg -

DaveQB
23rd April 2005, 10:48
Good stuff, appears to be working
its spitting out lines like this


0kbits/sEncoding [ 0m23s so far] |size= 24161kB time=128.9 bitrate=1536.0kbits/s

mikeX
24th April 2005, 17:25
It looks to me like your .avi file could be damaged. The command I gave you works fine for me. You could also try adding the -x null,mp3 flag, but I doubt that will change much. I have to say I'm not using avifile though, but transcode's native .avi parsing. I don't know if there is a way to make it use that instead of avifile...

ak
27th April 2005, 09:38
Originally posted by DaveQB
its spitting out lines like this


0kbits/sEncoding [ 0m23s so far] |size= 24161kB time=128.9 bitrate=1536.0kbits/s
That's ffmpeg and oggenc progress lines 'overlapping'. You can make either or both to shut up:

> ffmpeg -v 0
> oggenc -Q

DaveQB
27th April 2005, 10:21
Cheers ak :)