[Libav-user] Can't get simple demux -> copy -> remux to work properly
davmac at davmac.org
Fri Jan 25 01:40:52 CET 2013
I'm trying to get a simple demux / stream copy / remux program to work.
The full source (reasonably small) is at:
I compile it using:
g++ -Wall -o avtest src/avtest.cc -lavformat -lavcodec -lavutil
-lpthread -lz -lbz2
I hope the strategy is pretty clear. It opens the input file (as
specified on the command line) and writes to "test-out.avi". It just
copies the streams, no decoding or encoding is performed.
It does produce a playable output, but something is wrong. For this
small example input file:
I can run ffprobe on the output:
ffprobe -show_streams -count_frames -count_packets test-out.avi
... and get this output for the audio stream:
There are two issues: duration isn't specified, and nb_frames doesn't
match the actual number of frames in the file.
If I copy the same input file to another avi container using ffmpeg, I
do not see this issue. It only happens with my own program.
Can anyone see what's wrong with the program?
More information about the Libav-user