Hello Everyone, I'm trying to validate the MP4 stream generated from android device hardware codecs or x264 and mp4mux plugins with 1.11.0 master branch build. Output file playbacks properly and I'm trying to parse the generated mp4 video but my android application crashes when I tried to read atoms from mp4 file for example moov/mdat atoms. Later I tried to validate MP4 file on tools like Codecvisa or isoviewer or MP4Reader I'm not able to read the file I believe something wrong with MP4 syntax. I've attached reference video file. Thanks in advance, _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel 20161112_160233.mp4 (6M) Download Attachment |
On Sat, 2016-11-12 at 12:36 +0000, [hidden email] wrote:
> Hello Everyone, > I'm trying to validate the MP4 stream generated from android device > hardware codecs or x264 and mp4mux plugins with 1.11.0 master branch > build. Output file playbacks properly and I'm trying to parse the > generated mp4 video but my android application crashes when I tried > to read atoms from mp4 file for example moov/mdat atoms. > Later I tried to validate MP4 file on tools like Codecvisa or > isoviewer or MP4Reader I'm not able to read the file I believe > something wrong with MP4 syntax. I've attached reference video file. Plays fine here in VLC and GStreamer. What is your Android application, what does it use to play the file? -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (981 bytes) Download Attachment |
Hello Sebastian,
My Android Application will perform MP4->MP4 transcoding on Android devices support 4.3 to 6.0. Transcoded file using mp4mux plug-in playback properly on Android Devices, issue is not about playback, it's maintaining original video orientation, to maintain user's video orientation we copy orientation matrix from user's captured video before transcoding and after completion of transcoding we insert the copied orientation matrix to transcoded MP4 file at right atom say /moov/trak/tkhd. This is working fine till my previous cerbero build 1.7 however with latest build 1.11.0 (master branch) looks like transcoded MP4 file not following valid MP4 container structure due to this I'm not able to copy the orientation matrix.Here valid MP4 container structure means, transcoded file suppose to parsable as per ISO Base File Format (ISO/IEC 14496-12) and various (ISO/IEC 14496-12) parsing tools available for example CodecVisa, isoviewer,MP4reader. Transcoded file fails to open on these tools. You can also do quick validation of your mp4 file (generated using mp4mux) at http://mp4parser.com/ I tried pipeline with other properties of mp4mux i.e using faststart=true and faststart-file option, issue still persists.I also tried with qtmux, but no luck. I'm debugging this issue from past 3 days it will great help if you provide any pointers to solve this issue. Thanks in advance |
On Mon, 2016-11-14 at 23:41 -0800, Chikkamath wrote:
> Hello Sebastian, > My Android Application will perform MP4->MP4 transcoding on Android devices > support 4.3 to 6.0. Transcoded file using mp4mux plug-in playback properly > on Android Devices, issue is not about playback, it's maintaining original > video orientation, to maintain user's video orientation we copy orientation > matrix from user's captured video before transcoding and after completion of > transcoding we insert the copied orientation matrix to transcoded MP4 file > at right atom say /moov/trak/tkhd. This is working fine till my previous > cerbero build 1.7 however with latest build 1.11.0 (master branch) looks > like transcoded MP4 file not following valid MP4 container structure due to > this I'm not able to copy the orientation matrix.Here valid MP4 container > structure means, transcoded file suppose to parsable as per ISO Base File > Format (ISO/IEC 14496-12) and various (ISO/IEC 14496-12) parsing tools > available for example CodecVisa, isoviewer,MP4reader. Please give some more details about what exactly is preventing you inside the file to add the orientation matrix as before. -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (981 bytes) Download Attachment |
Hello Sebastian,
Here more details about issue: mp4 file captured from Android camera, contains video as first trak (track (element) box) and audio as second trak, after transcoding Gstreamer mp4mux will create mp4 file whereas audio trak is first track i.e trak id = 1 and video as second track trak id = 2. Here if you want to change rotation of video track i.e trak id = 2 we have to parse audio track box followed by video track box. Now bug is audio trak has 8 bytes box/atom called 'mp4a' . Out of 8 bytes, 4 bytes description length followed by 4 bytes description audio format. Native or Original mp4 file has mp4a box size equal to 75 bytes, where as transcoded mp4 file from gstreamer pipeline has mp4a box size equal to 7658 bytes and entire sample (framing info) table box 'stbl' of audio track configured wrongly. Importantly we do only video transcoding audio will bypass and mux to transcoded video. Please find below system logs of parsing fails for mp4a box. Exception in thread "main" java.lang.RuntimeException: ' ' with 'mp4a' as parent has length == 0. That's not supported at com.coremedia.iso.AbstractBoxParser.parseBox(AbstractBoxParser.java:89) at com.googlecode.mp4parser.BasicContainer.next(BasicContainer.java:155) at com.googlecode.mp4parser.BasicContainer.hasNext(BasicContainer.java:131) at com.googlecode.mp4parser.util.LazyList.blowup(LazyList.java:30) at com.googlecode.mp4parser.util.LazyList.size(LazyList.java:77) at com.googlecode.mp4parser.BasicContainer.getContainerSize(BasicContainer.java:59) at com.coremedia.iso.boxes.sampleentry.AudioSampleEntry.getSize(AudioSampleEntry.java:329) at com.googlecode.mp4parser.BasicContainer.getContainerSize(BasicContainer.java:62) at com.coremedia.iso.boxes.SampleDescriptionBox.getSize(SampleDescriptionBox.java:112) at com.googlecode.mp4parser.BasicContainer.getContainerSize(BasicContainer.java:62) at com.googlecode.mp4parser.AbstractContainerBox.getSize(AbstractContainerBox.java:58) at com.googlecode.mp4parser.BasicContainer.getContainerSize(BasicContainer.java:62) at com.googlecode.mp4parser.AbstractContainerBox.getSize(AbstractContainerBox.java:58) at com.googlecode.mp4parser.BasicContainer.getContainerSize(BasicContainer.java:62) at com.googlecode.mp4parser.AbstractContainerBox.getSize(AbstractContainerBox.java:58) at com.googlecode.mp4parser.BasicContainer.getContainerSize(BasicContainer.java:62) at com.googlecode.mp4parser.AbstractContainerBox.getSize(AbstractContainerBox.java:58) at com.googlecode.mp4parser.BasicContainer.getContainerSize(BasicContainer.java:62) at com.googlecode.mp4parser.AbstractContainerBox.getSize(AbstractContainerBox.java:58) at com.googlecode.mp4parser.authoring.builder.DefaultMp4Builder$InterleaveChunkMdat.getDataOffset(DefaultMp4Builder.java:458) at com.googlecode.mp4parser.authoring.builder.DefaultMp4Builder.build(DefaultMp4Builder.java:128) at Test.rotation(Test.java:101) at Test.main(Test.java:83) One more important observation we found. Height and Width of video parameters configured wrongly in transcoded video(1920x1080) i.e 'tkhd' track (element) header box height =9.0 and width=16.0 Thanks in advance |
Hello Sebastian,
With latest build 1.10.1 I'm able to insert rotation matrix to transcoded file. Earlier I was using master(branch) git commit 8243037 and this commit has fix for Bug 774048 (androidmedia crash) Thanks again |
Free forum by Nabble | Edit this page |