Hi
I need to transcode a H264 encoded file into mjpeg file.
For achieving the desired two layers will be involved in my
application because of design constraint and both layers are
independent.
1. Firsty I am extracting a video packet from container and ultimately
video raw data from packet.
2. Resampling raw data into jpeg image using xuggler.
I am first reading a h264 encoded file using container.readNextPacket
(IPacket packet) in a loop. In each iteration I am retrieving data
residing in packet using packet.getData(). After getting data from
each packet, data is being converted into a IPacket first and then
into IVideoPicture. For this conversion I need a decoder. Decoder is
intialized in the following manner:
IStreamCoder decoder = IStreamCoder.make(Direction.DECODING);
decoder.setCodec(ICodec.findDecodingCodec(ICodec.ID.CODEC_ID_H264));
// set other params
if (decoder.open() < 0) {
System.out.println("Unable to open an coder");
}
The issue I am getting is ERROR org.ffmpeg - [h264 @ 0xb608ea0] no
frame!
But if I use decoder retrieved from container I am able to transcode
files successfully.
I have uploaded my files on pastebin. Gven below is url of files being
uploaded:
Transcoder.java :-
http://pastebin.com/m7cb4c33b
Resampler.java :-
http://pastebin.com/m3b29a12d
MultipartGenerator.java :-
http://pastebin.com/m28181c33
VideoPacket.java :-
http://pastebin.com/d495bcca0
Main class is Transcoder.java. File path of input video file and
transcoded file can be changed in Transcoder.java. Variable having
source file path is named SRC_FILE_PATH and target file path is name
DEST_FILE_PATH.
Where I am doing wrong. Is it in initializing IStreamCoder or there is
some flaw in my approach?
Thanks
Gogo