public boolean nextFrame(){
		System.out.println(frameNum);
    	
	    IVideoPicture picture =
	            IVideoPicture.make(videoCoder.getPixelType(), videoCoder.getWidth(), videoCoder.getHeight());
    	while(true){
		    if(offsetInPacket >= packet.getSize()){
		    	//该码流读取完毕
		    	if(!nextPacket()) //读取下一个视频码流
		    		return false;
		    	continue;
		    }
		    int bytesDecoded = videoCoder.decodeVideo(picture, packet, offsetInPacket);
		    if (bytesDecoded < 0)
		    	return false;
		        //throw new RuntimeException("got error decoding video in: " + filePath);
		    
		    offsetInPacket += bytesDecoded;
		    if (picture.isComplete()){
                IVideoPicture newPic = picture;
                if (resampler != null)
                {
                    newPic =
                        IVideoPicture.make(resampler.getOutputPixelFormat(),
                            picture.getWidth(),
                            picture.getHeight());
                    if (resampler.resample(newPic, picture) < 0)
                        throw new RuntimeException("could not resample video from: " + filePath);
                }
                if (newPic.getPixelType() != IPixelFormat.Type.BGR24)
                    throw new RuntimeException("could not decode video" + " as BGR 24 bit data in: " + filePath);
                frame = converter.toImage(newPic);
                frameNum++;
		    	return true;
		    }
        }
    }