Replace Audio of a Video with diff AAC audio
See original GitHub issueHey nice lib, I want to replace the audio of a mp4 video with other aac audio(which i have recorded using phones mic) in Android.
String accFileName = Environment.getExternalStorageDirectory().getAbsolutePath() + "/recording.acc";
String videoFileName = Environment.getExternalStorageDirectory().getAbsolutePath() + "/myvid.mp4";
Movie m = MovieCreator.build( new FileDataSourceImpl(videoFileName));
List<Track> nuTracks = new ArrayList<>();
for (Track t : m.getTracks()) {
// Re-use all tracks besides the audio track
if (!"soun".equals(t.getHandler())) {
nuTracks.add(t);
}
}
Track nuAudio = new AACTrackImpl(new FileDataSourceImpl(accFileName));
//giving error on the above line "Expected Start Word 0xfff"
nuTracks.add(nuAudio); // add the new audio track
m.setTracks(nuTracks);
String outputFileName = Environment.getExternalStorageDirectory().getAbsolutePath() + "/output.mp4";
Container c = new DefaultMp4Builder().build(m);
c.writeContainer(new FileOutputStream(outputFileName).getChannel());
And what is diffrence btwn raw aac and normal aac ? @sannies
Issue Analytics
- State:
- Created 8 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Step-by-step Guide to Replace Audio in Video on Mac/Windows
This tutorial explains 4 easy ways to replace audio in video file for free. Thus, you can remove or replace audio track in...
Read more >ffmpeg - replace audio in video - Super User
If the audio is longer than the video, you will want to add -shortest before the output file name. Not specifying an audio...
Read more >How to Change Audio Format of a Video Quickly?
Open Parameter settings below the format image. Next, go to Audio settings and click the Encoder drop-down list. Select your needed audio codec, ......
Read more >Easiest way to "replace audio in video"? - Gearspace.com
264 encoder twice. Doing it any other way with QT Player Pro will recompress the movie. You will have to encode the audio...
Read more >Replacing video audio using ffmpeg - Ochre
Replacing video audio using ffmpeg · -i precedes the file you wish to strip the audio from. · -codec copy is to send...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s as expected. It’s an MPEG4 container and no raw file. Use the MovieCreator.build() and simply use the first track. That should do the trick.
2016-01-09 21:07 GMT+01:00 Priyank Agrawal notifications@github.com:
http://lmgtfy.com/?q=mediainfo
2016-01-09 20:50 GMT+01:00 Priyank Agrawal notifications@github.com: