Hi all,
I'm working on a small piece, well smallish, of code that is to read audio data 
from a stream, encode it into another format and writing it to another stream. 
I.e. not reading and writing to any files. The formats involved are FLV and 
WAV. I am trying to convert an incoming FLV stream to WAV.

I've been looking at the examples and I think I have the big picture. Probably 
missing some though, so please feel free to point me in the right direction. 
Any hints and suggestions are greatly appreciated.

My first realization was to make use use of the 'init_put_byte' and ' 
av_open_input_stream' functions in ffmpeg. So I started fiddling around with 
these in my code and I almost get it working. Well, I see that my little thing 
reads from a stream and detects the audio, and a null video stream (FLV is 
video, but we are only making use of the audio portion).

Well, so far, so good. I do now realize that I will have to deal with threads 
in moving any further. So, to my question: could you please give some advice on 
how correctly structure the code? I.e. what do I need to do codewise for a 
minimal  implementation? I have looked at the examples bundled with ffmpeg and 
ffmpeg-java, and I think I've got the big picture as mentioned above, in which 
order to makes calls to the ffmpeg libs, etc. Unfortunately they all take files 
as input... and produces either a file output or displaying a videos in a 
window frame ...

I realize, despite my lack of proficiency in C/C++ and threads, that I need a 
separate thread to read bytes (or chunks of bytes) from the input stream. Also, 
I might need a thread for writing to the output stream. So I guess the main 
thread should start these two threads. Is there anything to be considered when 
writing to a stream, instead of a file? I have checked out the source for both 
ffmpeg and mplayer as reference (also checking out ffmpeg-java as there are 
some good examples, but file based, e.g. ConverterExample.java which does what 
I want but I need streams...not files). Are there any particular source files 
recommended to look into for my little case?


Thanks in advance,

Robert
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to