mp4parser icon indicating copy to clipboard operation
mp4parser copied to clipboard

convert H264AnnexBTrack to FragmentedMp4Writer

Open ashraf-revo opened this issue 5 years ago • 1 comments

i have write this code to convert H264AnnexBTrack to FragmentedMp4Writer

    FileInputStream stream = new FileInputStream(new File("/media/ashraf/WorkSpace/IdeaProjects/streamer/m.h264"));
    H264AnnexBTrack h264AnnexBTrack = new H264AnnexBTrack(stream);
    WritableByteChannel channel = new FileOutputStream(new File("output.mp4")).getChannel();
    FragmentedMp4Writer writer = new FragmentedMp4Writer(Collections.singletonList(h264AnnexBTrack), channel);
    h264AnnexBTrack.call();
    writer.close();

but the generated file not work it's a bad file

ashraf-revo avatar Jul 09 '19 11:07 ashraf-revo

I'm having the same issue running mp4parser/examples/src/main/java/org/mp4parser/examples/mux/streaming/H264AACExample.java . Ffprobe gives

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x105c5a0] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 500x208): unspecified pixel format

When I try it on the result, and vlc doesn't play it.

yesennes avatar Feb 02 '21 19:02 yesennes