[Libav-user] Audio and Video Stream copy

praks411 praks411 at gmail.com
Thu Apr 4 14:12:54 CEST 2013


Hi ,

I'm trying to follow the muxing example and also aconv code for one of my
requirement. 
I want to write a simple container converter which just copy stream from one
format to another which going through decoding. I've .flv and i'm converting
into .avi. 
After doing all the initialization for both input and output file. 
I'm reading frame by frame from input using av_read_frame and based on
stream index (audio/video) I'm writing them to output using
av_interleaved_write_frame.
Finally when copying finishes I'm writing trailer.
The output file is generated but on playing it, it seems to be blank. I
cannot get any audio or video from it.
Moreover the duration of the file has changed original flv video was of 5min
but the output avi file has duration of 1hr. I'm bit new to audio/video
stuff but going through code and various mails.  
I think this has to do with time stamp or time base settings in output
format context. But I'm not able to get them and how to set them. 
I followed avconv code and looked into do_stream_copy functions and I guess
I'm not setting my output packets dts/pts and also duration. 
However I'm not able to get do_stream_copy function. If some has more
insight it into please let me.
I've also attached my code for any reference. 

Thanks in advance
Pradeep




--
View this message in context: http://libav-users.943685.n4.nabble.com/Audio-and-Video-Stream-copy-tp4657192.html
Sent from the libav-users mailing list archive at Nabble.com.


More information about the Libav-user mailing list