Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H264TrackImpl AACTrackImpl create mp4 can not play in VLC #319

Closed
shoyu666 opened this issue Jul 27, 2018 · 8 comments
Closed

H264TrackImpl AACTrackImpl create mp4 can not play in VLC #319

shoyu666 opened this issue Jul 27, 2018 · 8 comments

Comments

@shoyu666
Copy link

shoyu666 commented Jul 27, 2018

dear author
use H264TrackImpl and AACTrackImpl create mp4

final 1532667754113A2.mp4 can not play int 'vlc' why?
but can play in 'windows media player'

`
public class Mux {
public static void main(String[] args) throws IOException, XPathExpressionException, SAXException, ParserConfigurationException, URISyntaxException {
String fileName = "C:\Users\n\Desktop\h264\test\1532667754113";
Movie v = new Movie();
Track audio = new H264TrackImpl(new FileDataSourceImpl(fileName+".h264"));
v.addTrack(audio);
AACTrackImpl aacTrack = new AACTrackImpl(new FileDataSourceImpl(fileName+".aac"));
v.addTrack(aacTrack);
Mp4Builder defaultMp4Builder = new DefaultMp4Builder();
Container c = defaultMp4Builder.build(v);
File out = new File(fileName+"A2.mp4");
c.writeContainer(new FileOutputStream(out).getChannel());
}
}

`

test.zip

@sannies
Copy link
Owner

sannies commented Jul 27, 2018 via email

@shoyu666
Copy link
Author

shoyu666 commented Jul 27, 2018

@sannies
thanks for you reply (I am sorry for my poor english)
i has upload a zip
1532667754113 .aac
1532667754113 .h264

i try create mp4 (1532667754113 .aac+1532667754113 .h264)
i try create mp4 (1532667754113 .h264)
can not play in vlc(https://www.videolan.org/)
can not play in mac
need you help

files.zip

@sannies
Copy link
Owner

sannies commented Jul 27, 2018

Please make the h264 file available to me.

@shoyu666
Copy link
Author

dear author
--Please make the h264 file available to me.
do you mean h264 soure file?
can you see zip file i have upload ?

@shoyu666
Copy link
Author

shoyu666 commented Jul 27, 2018

@sannies
i get raw h264 file by android MediaCodec
in front i wirte
write outputFormat.getByteBuffer("csd-0")
write outputFormat.getByteBuffer("csd-1")

write MediaCodec OutputBuffer data;

write MediaCodec OutputBuffer data;
..................
write MediaCodec OutputBuffer data;

by the way .h264 can play in vlc

@sannies
Copy link
Owner

sannies commented Jul 27, 2018

got it, sorry. didn't see the zip

@shoyu666
Copy link
Author

@sannies
thanks, ; possible causes i am in china

i upload to github
https://github.com/shoyu666/Hand-Signature/blob/master/files.zip
can you down load ?

@sannies
Copy link
Owner

sannies commented Jul 27, 2018

The H264TrackImpl didn't correctly parse the Sample objects from the file as it didn't set the SampleDescription thus it could set the sample derscription index correctly when writing the MP4.
I published 1.9.36 with that fix.

@sannies sannies closed this as completed Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants