java - Xuggler stream[0] is not video -
this first time asking question on form . question has 2 parts .
first please see code below extract audio video file using xuggle .
imediareader reader; file f; reader = toolfactory.makereader("e:\\netbeanworkspace\\repo\\videosamples\\one.mp4"); f = new file("e:\\netbean workspace\\repo\\videosamples\\"+"one"+".wav"); imediawriter mediawriter =toolfactory.makewriter(f.getabsolutepath(), reader); int samplerate = 44100; int channels = 2; mediawriter.addaudiostream(0, 0, icodec.id.codec_id_adpcm_ima_wav, channels, samplerate); reader.addlistener(mediawriter); mediawriter.setmasklatestreamexceptions(true); while( reader.readpacket() == null );
i following error on files , files work fine .
java.lang.illegalargumentexception: stream[0] not video @ com.xuggle.mediatool.mediawriter.encodevideo(mediawriter.java:754) @ com.xuggle.mediatool.mediawriter.encodevideo(mediawriter.java:783) @ com.xuggle.mediatool.mediawriter.onvideopicture(mediawriter.java:1434) @ com.xuggle.mediatool.amediatoolmixin.onvideopicture(amediatoolmixin.java:166) @ com.xuggle.mediatool.mediareader.dispatchvideopicture(mediareader.java:610) @ com.xuggle.mediatool.mediareader.decodevideo(mediareader.java:519) @ com.xuggle.mediatool.mediareader.readpacket(mediareader.java:475) @ audioextractor.audioextractor.main(audioextractor.java:108)
what best codec extracting 16 bit wav file.
please me finding answer these 2 questions .