
Recherche avancée
Médias (1)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (23)
-
Qu’est ce qu’un éditorial
21 juin 2013, parEcrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
Vous pouvez personnaliser le formulaire de création d’un éditorial.
Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...) -
Contribute to translation
13 avril 2011You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
MediaSPIP is currently available in French and English (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (5444)
-
Unable to merge videos in Android using JavaCV ("Sample Description" Error)
15 décembre 2015, par SanI am creating a video from images via FFMPEG and I am able to get the video from images. I am also making use of JavaCV to merge two videos and I am able to join videos using JavaCV without any issues provided both the videos are taken via camera, i.e, a video actually recorded via mobile camera.
Issue that I’m facing :
I am not able to merge the video that was generated from FFMPEG using the images along with the video user has chosen which will mostly be a video that was not generated and taken via mobile camera.
CODE :
Code to generate Video via Images :FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(path + "/" + "dec16.mp4", 800, 400);
try {
recorder.setVideoCodec(avcodec.AV_CODEC_ID_MPEG4);
//recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
recorder.setVideoCodecName("H264");
recorder.setVideoOption("preset", "ultrafast");
recorder.setFormat("mp4");
recorder.setFrameRate(frameRate);
recorder.setVideoBitrate(60);
recorder.setPixelFormat(avutil.AV_PIX_FMT_YUV420P);
startTime = System.currentTimeMillis();
recorder.start();
for(int j=0;j recorder.getTimestamp()) {
recorder.setTimestamp(t);
recorder.record(image);
}
}
recorder.stop();
} catch (Exception e) {
e.printStackTrace();
}Code to merge Videos :
int count = file_path.size();
System.out.println("final_joined_list size " + file_path.size());
if (file_path.size() != 1) {
try {
Movie[] inMovies = new Movie[count];
mediaStorageDir = new File(
Environment.getExternalStorageDirectory()
+ "/Pictures");
for (int i = 0; i < count; i++) {
File file = new File(file_path.get(i));
System.out.println("fileeeeeeeeeeeeeeee " + file);
System.out.println("file exists!!!!!!!!!!");
FileInputStream fis = new FileInputStream(file);
FileChannel fc = fis.getChannel();
inMovies[i] = MovieCreator.build(fc);
fis.close();
fc.close();
}
List<track> videoTracks = new LinkedList<track>();
List<track> audioTracks = new LinkedList<track>();
Log.d("Movies length", "isss " + inMovies.length);
if (inMovies.length != 0) {
for (Movie m : inMovies) {
for (Track t : m.getTracks()) {
if (t.getHandler().equals("soun")) {
audioTracks.add(t);
}
if (t.getHandler().equals("vide")) {
videoTracks.add(t);
}
if (t.getHandler().equals("")) {
}
}
}
}
Movie result = new Movie();
System.out.println("audio and videoo tracks : "
+ audioTracks.size() + " , " + videoTracks.size());
if (audioTracks.size() > 0) {
result.addTrack(new AppendTrack(audioTracks
.toArray(new Track[audioTracks.size()])));
}
if (videoTracks.size() > 0) {
result.addTrack(new AppendTrack(videoTracks
.toArray(new Track[videoTracks.size()])));
}
IsoFile out = null;
try {
out = (IsoFile) new DefaultMp4Builder().build(result);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
long timestamp = new Date().getTime();
String timestampS = "" + timestamp;
File storagePath = new File(mediaStorageDir
+ File.separator);
storagePath.mkdirs();
File myMovie = new File(storagePath, String.format("%s.mp4", timestampS));
FileOutputStream fos = new FileOutputStream(myMovie);
FileChannel fco = fos.getChannel();
fco.position(0);
out.getBox(fco);
fco.close();
fos.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String mFileName = Environment.getExternalStorageDirectory()
.getAbsolutePath();
// mFileName += "/output.mp4";
File sdCardRoot = Environment.getExternalStorageDirectory();
File yourDir = new File(mediaStorageDir + File.separator);
for (File f : yourDir.listFiles()) {
if (f.isFile())
name = f.getName();
// make something with the name
}
mFileName = mediaStorageDir.getPath() + File.separator
+ "output-%s.mp4";
System.out.println("final filename : "
+ mediaStorageDir.getPath() + File.separator
+ "output-%s.mp4" + "names of files : " + name);
single_video = false;
return name;
} else {
single_video = true;
name = file_path.get(0);
return name;
}
</track></track></track></track>Error :
The Error that I am facing while trying to merge the videos generated via Images and a normal video is
12-15 12:26:06.155 26022-26111/? W/System.err﹕ java.io.IOException: Cannot append com.googlecode.mp4parser.authoring.Mp4TrackImpl@45417c38 to com.googlecode.mp4parser.authoring.Mp4TrackImpl@44ffac60 since their Sample Description Boxes differ
12-15 12:26:06.155 26022-26111/? W/System.err﹕ at com.googlecode.mp4parser.authoring.tracks.AppendTrack.<init>(AppendTrack.java:48)
</init>Fix that I tried :
Google advised me to change the CODEC in JavaCV from
avcodec.AV_CODEC_ID_MPEG4
toavcodec.AV_CODEC_ID_H264
. But when I did that, I am not able to get the video from images thereby throwing the following error :12-15 12:26:05.840 26022-26089/? W/linker﹕ libavcodec.so has text relocations. This is wasting memory and is a security risk. Please fix.
12-15 12:26:05.975 26022-26089/? W/System.err﹕ com.googlecode.javacv.FrameRecorder$Exception: avcodec_open2() error -1: Could not open video codec.
12-15 12:26:05.975 26022-26089/? W/System.err﹕ at com.googlecode.javacv.FFmpegFrameRecorder.startUnsafe(FFmpegFrameRecorder.java:492)
12-15 12:26:05.975 26022-26089/? W/System.err﹕ at com.googlecode.javacv.FFmpegFrameRecorder.start(FFmpegFrameRecorder.java:267)What I need :
Creating video from Images is inevitable and that video will definitely be used to merge with other videos which might have any Codec Formats. So I need to find a way to merge any kind of videos irrespective of their Codecs or any other parameters. I am trying to keep it simple by just using the Jars and SO files and I dont want to drive myself crazy by going on a full scale implementation of FFMPEG Library. That being said, I am also ready to look into that library if I dont have any other ways to achieve what I want but a solid resource with an ALMOST working code would be much appreciated. Cheers.
Update :
I looked upon the issues mentioned at GitHub of OpenCV, but didnt find anything solid from it.
OpenCV Issues -
avplay : Statically allocate the player state
2 janvier 2016, par Luca Barbato -
Issue while opening a .mp4 file - CPU shoots up 100%
16 juillet 2014, par AnilJI am using IMediaWriter, to write out about 20 video frames into an independent .mp4 file and creating a new writer to write a new file. This is a logic (not so efficient one), I’ve used to chunk the web-cam feed into chunks. I am able to successfully able to create multiple .mp4 video files and when opened then in a VLC player, they can be played back.
However, when I try to open one of the chunked file into a new IContainer object (see below code snippet), my program :
- Gets stuck at the container.open() call ( see * below), and the CPU
utilization shoots above 100%. - Sometimes it throws an error "moov atom not found", and hence can not open the file.
In both the cases, my program does not work.
<code snippet="snippet">
String file = BASE_PATH + File.separator + "output" + File.separator + "output.mp4"; // This is one of the chunk.
IContainer container = IContainer.make();
FileChannel channel = null;
try {
@SuppressWarnings("resource")
RandomAccessFile inFile = new RandomAccessFile(chunkFile, "r");
channel = inFile.getChannel();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
// Open up the container
*** int retval = container.open(channel, IContainer.Type.READ, null);
if (retval < 0) {
// This little trick converts the non friendly integer return value into
// a slightly more friendly object to get a human-readable error name
IError error = IError.make(retval);
throw new IllegalArgumentException("could not open file: " + mInputFileChannel + "; Error: " + error.getDescription());
}
<code snippet="snippet">Subsequently, I ran the AtomicParsley tool to dump the file content, and it prints following. I am not aware of video file internals and seeking help to know the issue here and potential solution.
Atom ftyp @ 0 of size: 28, ends @ 28
Atom free @ 28 of size: 8, ends @ 36
Atom mdat @ 36 of size: 45175, ends @ 45211
Atom moov @ 45211 of size: 1052, ends @ 46263
Atom mvhd @ 45219 of size: 108, ends @ 45327
Atom trak @ 45327 of size: 839, ends @ 46166
Atom tkhd @ 45335 of size: 92, ends @ 45427
Atom edts @ 45427 of size: 36, ends @ 45463
Atom elst @ 45435 of size: 28, ends @ 45463
Atom mdia @ 45463 of size: 703, ends @ 46166
Atom mdhd @ 45471 of size: 32, ends @ 45503
Atom hdlr @ 45503 of size: 45, ends @ 45548
Atom minf @ 45548 of size: 618, ends @ 46166
Atom vmhd @ 45556 of size: 20, ends @ 45576
Atom dinf @ 45576 of size: 36, ends @ 45612
Atom dref @ 45584 of size: 28, ends @ 45612
Atom url @ 45600 of size: 12, ends @ 45612
Atom stbl @ 45612 of size: 554, ends @ 46166
Atom stsd @ 45620 of size: 198, ends @ 45818
Atom mp4v @ 45636 of size: 182, ends @ 45818
Atom esds @ 45722 of size: 96, ends @ 45818
Atom stts @ 45818 of size: 176, ends @ 45994
Atom stss @ 45994 of size: 24, ends @ 46018
Atom stsc @ 46018 of size: 28, ends @ 46046
Atom stsz @ 46046 of size: 100, ends @ 46146
Atom stco @ 46146 of size: 20, ends @ 46166
Atom udta @ 46166 of size: 97, ends @ 46263
Atom meta @ 46174 of size: 89, ends @ 46263
Atom hdlr @ 46186 of size: 33, ends @ 46219
Atom ilst @ 46219 of size: 44, ends @ 46263
Atom ©too @ 46227 of size: 36, ends @ 46263
Atom data @ 46235 of size: 28, ends @ 46263
------------------------------------------------------
Total size: 46263 bytes; 31 atoms total. AtomicParsley from svn built on Jul 15 2014 (utf8)
Media data: 45175 bytes; 1088 bytes all other atoms (2.352% atom overhead).
Total free atom space: 8 bytes; 0.017% waste.
------------------------------------------------------I am not sure if there is anything wrong with the file itself. Can you please help me understand this ?
- Gets stuck at the container.open() call ( see * below), and the CPU