我有一个存储在base 64中的3gpp音频文件,我需要将其转换为wav。 目前我有两步:
base64 -d test.txt > test.3gpp
avconv -i test.3gpp test.wav
但我想只有一步,减少我要做的磁盘IO数量。我试过了:
base64 -d test.txt | avconv -i pipe:0 test.wav
但我明白了:
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x210cf40] stream 0, offset 0x20: partial file
阅读man avconv
表明这是如何使用管道,但显然我遗漏了一些东西。我不是音频专家。
示例文件,基数为64 here
以下是进程运行正常时的元数据:
avconv version 9.18-6:9.18-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
built on Mar 16 2015 13:19:10 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.3gpp':
Metadata:
major_brand : 3gp4
minor_version : 0
compatible_brands: isom3gp4
creation_time : 2013-06-14 14:16:19
Duration: 00:00:32.68, start: 0.000000, bitrate: 14 kb/s
Stream #0.0(eng): Audio: amrnb, 8000 Hz, mono, flt, 12 kb/s
Metadata:
creation_time : 2013-06-14 14:16:19
Output #0, wav, to 'test.wav':
Metadata:
major_brand : 3gp4
minor_version : 0
compatible_brands: isom3gp4
creation_time : 2013-06-14 14:16:19
ISFT : Lavf54.20.4
Stream #0.0(eng): Audio: pcm_s16le, 8000 Hz, mono, s16, 128 kb/s
Metadata:
creation_time : 2013-06-14 14:16:19
Stream mapping:
Stream #0:0 -> #0:0 (amrnb -> pcm_s16le)
Press ctrl-c to stop encoding
size= 511kB time=32.68 bitrate= 128.0kbits/s
video:0kB audio:511kB global headers:0kB muxing overhead 0.014917%
当不行时:
avconv version 9.18-6:9.18-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
built on Mar 16 2015 13:19:10 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x210cf40] stream 0, offset 0x20: partial file
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:0':
Metadata:
major_brand : 3gp4
minor_version : 0
compatible_brands: isom3gp4
creation_time : 2013-06-14 14:16:19
Duration: 00:00:32.68, bitrate: N/A
Stream #0.0(eng): Audio: amrnb, 8000 Hz, mono, flt, 12 kb/s
Metadata:
creation_time : 2013-06-14 14:16:19
Output #0, wav, to 'test.wav':
Metadata:
major_brand : 3gp4
minor_version : 0
compatible_brands: isom3gp4
creation_time : 2013-06-14 14:16:19
ISFT : Lavf54.20.4
Stream #0.0(eng): Audio: pcm_s16le, 8000 Hz, mono, s16, 128 kb/s
Metadata:
creation_time : 2013-06-14 14:16:19
Stream mapping:
Stream #0:0 -> #0:0 (amrnb -> pcm_s16le)
Press ctrl-c to stop encoding
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x210cf40] stream 0, offset 0x40: partial file
pipe:0: Invalid data found when processing input
size= 0kB time=10000000000.00 bitrate= 0.0kbits/s
video:0kB audio:0kB global headers:0kB muxing overhead inf%