Zheng Xiaodong
Zheng Xiaodong

Reputation: 153

ffmpeg how add header info into pcm?

I use this cmd convert s16le to pcmu8, but will lost header info.

ffmpeg -i s16le.wav -f u8 pcmu8.wav
ffmpeg -i pcmu8.wav
# pcmu8.wav: Invalid data found when processing input

I want known, how add this header info into pcmu8.wav?

It should be this:

ffmpeg -i pcmu8.wav
#Input #0, wav, from 'pcmu8.wav':
#  Duration: 00:13:39.20, bitrate: 64 kb/s
#  Stream #0:0: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 8000 Hz, mono, u8, 64 kb/s

Upvotes: 0

Views: 829

Answers (1)

Gyan
Gyan

Reputation: 93231

Your first command is outputting to a raw bitstream, not a WAV, so adding a header won't help. Instead use

ffmpeg -i s16le.wav -c:a pcm_u8 pcmu8.wav

Upvotes: 1

Related Questions