[FFmpeg-user] help remuxing mp4 to matroska

Roger Pack rogerdpack2 at gmail.com
Fri Sep 7 21:45:46 CEST 2012


> I am not an ffmpeg or multimedia expert. Bear with me. I am trying to
> transmux an mp4 file with h264 video and aac audio to matroska using
> libavformat, libavcodec, etc (i.e. not command line ffmpeg). My


You might get more support from the libav-user group.

> understanding is that no decoding or encoding is required. That is, I
> believe the matroska container can handle h264/aac, and that I have
> these bytes available, and therefore this should be more or less a
> straightforward copy. A quick sanity check of the file with ffprobe:
>
> Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661)
> Stream #0:1(und): Audio: aac (mp4a / 0x6134706D)
>
> So first of all, what I guess must be transmuxing via command line is
> "ffmpeg -i 0.mp4 -vcodec copy -acodec copy 0.mkv". That gives me a
> playable file -- VLC can read and play it, and my player can read it
> (video plays back at least one frame and my implementation is hokey
> anyway; audio plays back fine).
>
> So I'm trying to transmux with libavformat / libavcodec. The code I
> use to transmux appears last in this message. Encouragingly, on
> opening the original file to transmux, I get these logs:
>
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x212fa00] Format mov,mp4,m4a,3gp,3g2,mj2
> probed with size=2048 and score=100
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x212fa00] ISO: File Type Major Brand: mp42
> [h264 @ 0x20f2600] err{or,}_recognition separate: 1; 1
> [h264 @ 0x20f2600] err{or,}_recognition combined: 1; 65537
> [aac @ 0x20e9400] err{or,}_recognition separate: 1; 1
> [aac @ 0x20e9400] err{or,}_recognition combined: 1; 65537
> [aac @ 0x20e9400] Unsupported bit depth: 0


Are you sure you're doing the equivalent of "vcodec copy" here?
Cheers!
-r


More information about the ffmpeg-user mailing list