Prosanto / xuggle

Automatically exported from code.google.com/p/xuggle
0 stars 0 forks source link

MediaTools fails when video-stream is not present. #199

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?  Attempting to 
convert an audio file from the FLV format to the WAV format using the 
MediaTools chain method.  The FLV file does not contain a video stream.

What operating system and JVM version are you using.  Linux / Java 6

Attach relevant log/output files.

The error received is as follows:

null inputCodecId: 
com.xuggle.xuggler.IContainerFormat.establishOutputCodecId 
(IContainerFormat.java:274) 

Original issue reported on code.google.com by williamt...@gmail.com on 31 Aug 2009 at 5:17

GoogleCodeExporter commented 9 years ago
I receive this problem too. My flv file does not have a video stream

Original comment by sid.ksha...@gmail.com on 16 Feb 2011 at 3:46

GoogleCodeExporter commented 9 years ago
The trick lies in creating in adding an audio stream on the Writer. This code 
snippet works for me in extracting an audio stream from a flv and transcoding 
it to an mp3.

         IMediaReader reader = ToolFactory.makeReader(filename + ".flv");
         IMediaWriter writer = ToolFactory.makeWriter(filename + ".mp3", reader);
         int sampleRate = 22050;
         int channels = 1;
         writer.addAudioStream(0, 0, ICodec.ID.CODEC_ID_MP3, channels, sampleRate);

         reader.addListener(writer);
         while (reader.readPacket() == null)
                   ;
(Please see my post 
http://stackoverflow.com/questions/2760570/xuggle-codec-identification-fail/5027
039#5027039 )

Original comment by sid.ksha...@gmail.com on 17 Feb 2011 at 9:23