Hi there,
I'm writing the application which will remux "everything" to MPEG-TS
container with no reencoding.
It seems that I have no problems with containers (I've already
succeeded with parsing mkv, vob, avi),
but now I have a problem when trying to remux files with DivX-encoded video.
av_find_stream_info always sets time_base of the codec for the video
stream to 1/30000, though time_base of the stream is normal -
1001/24000 (this is for avi container)

to avoid reencoding of the input stream I use avcodec_copy_context()
in such way (for each stream):
    AVStream * inStream = inFmtCtx->streams[streamID];
    AVStream * outStream = av_new_stream(outFmtCtx, id);
    outStream->id = id;
    outStream->first_dts = av_rescale_q(inStream->first_dts,
inStream->time_base, outStream->time_base);//inStream->first_dts;.
    AVCodecContext * codecCtx = avcodec_alloc_context();
    avcodec_copy_context(codecCtx,inStream->codec);
    outStream->codec = codecCtx;
    outStream->sample_aspect_ratio = codecCtx->sample_aspect_ratio;
    av_write_header(outFmtCtx);

then I read packets from inFmtCtx (using av_read_frame() ) and write
them (using av_write_frame) to OutFmtCtx without errors.
but when I try to open resulting .ts file with VLC it says that frame
rate of the video track is 30000 and starts playings, but hangs when I
try to seek.
this huge frame rate remains the same (30 000) even if I hardcode
values of time_base for the codec and the stream.
How can I correctly detect or specify frame rate of the video?

P.S. this happens only with DivX. Xvid remuxes without such problems.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-user

Reply via email to