Note that there are some explanatory texts on larger screens.

plurals
  1. POAppending videos doesn't work properly - Android
    primarykey
    data
    text
    <p>I am using Sebastian Annies <a href="https://mp4parser.googlecode.com/svn/trunk/examples/src/main/java/com/googlecode/mp4parser/AppendExample.java" rel="nofollow">example</a> for the mp4parser where I append 3 videos. The result should be one video that plays all the three videos simultaneously. However, I get one video that plays the last video three times. Here is my code...</p> <pre><code> // int i = number of videos.... try { String[] f = new String[i]; for (int count = 0; count &lt; i; count++) { f[count] = "/sdcard/vid" + i + ".mp4"; } Movie[] inMovies = new Movie[i]; for (int count = 0; count &lt; i; count++) { inMovies[count] = MovieCreator.build(f[count]); } List&lt;Track&gt; videoTracks = new LinkedList&lt;Track&gt;(); List&lt;Track&gt; audioTracks = new LinkedList&lt;Track&gt;(); 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); } } } Movie result = new Movie(); if (audioTracks.size() &gt; 0) { result.addTrack(new AppendTrack(audioTracks.toArray(new Track[audioTracks.size()]))); } if (videoTracks.size() &gt; 0) { result.addTrack(new AppendTrack(videoTracks.toArray(new Track[videoTracks.size()]))); } Container out = new DefaultMp4Builder().build(result); FileChannel fc = new RandomAccessFile(String.format ("/sdcard/output.mp4"), "rw").getChannel(); out.writeContainer(fc); fc.close(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } VideoView v = (VideoView) findViewById(R.id.videoView1); // v.setVideoPath("/sdcard/aaa" + i + ".mp4"); v.setVideoPath("/sdcard/output.mp4"); v.setMediaController(new MediaController(this)); v.start(); </code></pre> <p>I dont know why it isn't doing what it's supposed to do. Please help me. Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload