Re: Creating mjpeg,adpcm AVIs?

Guy Hindell <[email protected]>
Newsgroups gmane.comp.video.transcode.user
Message-ID <[email protected]>
Hi Georg

Thanks for that, I'd somehow managed to overlook the -p flag in the 
transcode manual page, and hadn't worked out the significance of the -N 
audio format flags. In fact, however, transcode doesn't seem to directly 
support the audio format I need (0x11 for imaadpcm). However, it turned 
out that ffmpeg would remux the audio without reencoding it, so the 
following sequence works...

DIR=.
BASENAME=somexvid

# extract the video, resize and encode
transcode -i $DIR/$BASENAME.avi -o ${BASENAME}_mjpeg.avi \
    -x ffmpeg,null -Z 320x240 -y ffmpeg,null -F mjpeg

# extract the audio, resample to mono at 22050
transcode -i $DIR/$BASENAME.avi -o ${BASENAME}_pcm.wav \
    -x null,mp3 -y null,wav -a 1 -E 22050,0,1 -Jresample

# re-encode audio to ima_adpcm
sox ${BASENAME}_pcm.wav -i ${BASENAME}_ima_adpcm.wav

# remux
ffmpeg -vcodec copy -i ${BASENAME}_mjpeg.avi \
    -acodec copy -i ${BASENAME}_ima_adpcm.wav \
    ${BASENAME}_mjpeg_ima_adpcm.avi

...and the resulting files play on the camera (A casio exilim ex-z500)!

cheers
guy



Georg Martius wrote:
> Hi Guy,
>
> AFAIK you can do 
>
> transcode -i somexvidfile.avi -p camfile_imaadpcm.wav -o camfile.avi -Z 
> 320x240 -y ffmpeg,raw -F mjpeg
>
> and maybe a -N 0x01 additionally. 
> BTW:  the cameras from cannon and panasonic I had so far used only 8000 kHz.
>
> Hope it helped!
> 	Georg
>
> On Monday 30 March 2009, Guy Hindell wrote:
>   
>> Hi there --- I guess this is a somewhat academic question, but...
>>
>> Can anyone tell me if and how transcode (perhaps via ffmpeg, avimerge
>> etc.) can *encode* AVI files as mjpeg video with ima_adpcm audio? Why do
>> I want to do this? Well, I'm curious to see whether I can create files
>> in the same format as those produced by a Casio Exilim digital camera
>> such that they can be copied to the SD card and the camera will play them.
>>
>> So far I can create files whose video content does play on the camera...
>>
>> transcode -i somexvidfile.avi -o camfile.avi -Z 320x240 -y ffmpeg -F mjpeg
>>
>> but whose audio is still the mp3 encoded 2 channel 44100Hz of the
>> original. The target audio is (I think) 1 channel 22050Hz encoded as
>> ima-adpcm. I've not been able to figure out how I can get ffmpeg to
>> create such audio, or how I can get transcode to use ffmpeg to do it
>> even if it could. However, the audio can be extracted like this...
>>
>> trasncode -i somexvidfile.avi -o camfile_pcm.wav -E 22050,0,1 -x
>> null,raw -y wav
>>
>> and sox used to convert from pcm to ima_adpcm...
>>
>> sox camfile_pcm.wav -i camfile_imaadpcm.wav
>>
>> and an avi with video but no sound is easy enough to create.
>>
>> But... that's as far as I've got --- can transcode create an AVI that
>> combines my camfile.avi and camfile_imaadpcm.wav?
>>
>> cheers
>> guy
>>     
>
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.