[FFmpeg-devel] [PATCH 1/2] In mov muxer, mux adpcm_ms and adpcm_ima_wav the way quicktime supports it. In mov demuxer, set adpcm_ms and adpcm_ima_wav frame size to stsd samples per packet.

Janne Grunau janne-ffmpeg
Thu Jan 27 17:38:33 CET 2011


On Wed, Jan 26, 2011 at 12:57:17PM -0800, Baptiste Coudurier wrote:
> On 01/25/2011 08:24 PM, Alex Converse wrote:
> > On Tue, Jan 25, 2011 at 8:08 AM, Mans Rullgard<mans at mansr.com>  wrote:
> >> From: Baptiste Coudurier<baptiste.coudurier at gmail.com>
> >>
> >> ---
> >>   libavformat/mov.c    |    1 +
> >>   libavformat/movenc.c |   29 ++++++++++++++++++++++++++++-
> >>   2 files changed, 29 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/libavformat/mov.c b/libavformat/mov.c
> >> index 4370b48..6c1985d 100644
> >> --- a/libavformat/mov.c
> >> +++ b/libavformat/mov.c
> >> @@ -1227,6 +1227,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, ByteIOContext *pb, int entries)
> >>      case CODEC_ID_GSM:
> >>      case CODEC_ID_ADPCM_MS:
> >>      case CODEC_ID_ADPCM_IMA_WAV:
> >> +        st->codec->frame_size = sc->samples_per_frame;
> >>          st->codec->block_align = sc->bytes_per_frame;
> >>          break;
> >>      case CODEC_ID_ALAC:
> >> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> >> index 5230938..6fe5da7 100644
> >> --- a/libavformat/movenc.c
> >> +++ b/libavformat/movenc.c
> >> @@ -314,6 +314,16 @@ static int mov_pcm_le_gt16(enum CodecID codec_id)
> >>             codec_id == CODEC_ID_PCM_F64LE;
> >>   }
> >>
> >> +static int mov_write_ms_tag(ByteIOContext *pb, MOVTrack *track)
> >> +{
> >> +    int64_t pos = url_ftell(pb);
> >> +    put_be32(pb, 0);
> >> +    put_le32(pb, track->tag);
> >> +    track->enc->codec_tag = track->tag>>  16;
> >> +    ff_put_wav_header(pb, track->enc);
> >
> > I'm seeing an endian mismatch here vs quicktime.
> 
> Oh, that's right, quicktime still play the file though, I guess it 
> ignores it.
> 
> I just looked at your patch, but I had this one since a long time in my 
> tree. I guess your av_be2me solution is good here. Good catch.

So  I guess it's ok with the patch I just sent. I won't fold the patches
for easier merging between the trees.

Janne



More information about the ffmpeg-devel mailing list