• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to combine more then one media files such as mp3, mp4 and avi etc using java file Operation's ?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Irfan Pervez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tried to combine two mp3 files, it's working fine but not working for video files like mp4 , please help !!thanks in advance

String str="E:\\Movies\\Dark Skies (2013)\\Dark.mp3";

String ftr="F:\\CRS\\stv.mp3";

File file=new File(str);
File Kile=new File(ftr);

FileInputStream fis=new FileInputStream(file);

FileOutputStream fos=new FileOutputStream(Kile);

int luffersize=102400000;
byte[] luffer=new byte[luffersize];

int lenght=(int) fis.available();


if ((fis.read(luffer)) != 0) {
try {
fos.write(luffer, 0, lenght);
System.out.println("working");

} catch (IOException e) {

e.printStackTrace();
}finally{
fis.close();
fos.close();

}
}

}
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "combine"? Very few structured file formats can simply be appended to form a new file, in case that's what you're trying to do.
reply
    Bookmark Topic Watch Topic
  • New Topic