The code snippet below is to extract audio from video file. The work environment is Eclipse Luna on Windows 7.
import com.xuggle.mediatool.*;
import com.xuggle.xuggler.ICodec;
public class VideoToAudio{
public void convertVideoToAudio(){
IMediaReader reader = ToolFactory.makeReader("D://vid.mp4");
IMediaWriter writer = ToolFactory.makeWriter("D://a.mp3",reader);
int sampleRate = 44100;
int channels = 1;
writer.addAudioStream(0, 0, ICodec.ID.CODEC_ID_MP3, channels, sampleRate);
while (reader.readPacket() == null);
}
public static void main(String [] args){
VideoToAudio vta = new VideoToAudio();
vta.convertVideoToAudio();
}
}
The error generated for the code is as follows:
A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006ee76520, pid=13968, tid=7220
#
# JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [xuggle4458410956560120581.dll+0x736520]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
I followed a series of actions one after the another to fix the error:
Configured Windows to create MiniDump files after looking into link
Removed metadata folder from workspace and imported project again to eclipse.
Still the above error persists. Could someone fix the error?