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
Assumes correct SPS/PPS #2
Comments
Thanks for the issue :) |
the callback use int fseeko(FILE *stream, off_t offset, int whence) |
For fseeko -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE is correct switches I think. Sample app may produce 40Gb file without 64bit seek support, depending if it fails on offsets >32bit or wraps. |
sequential_mode = 1 works on i7 / ubuntu 64bits |
Thanks for testing :) sequential_mode = 1 is what you need then. This two modes have following differences: sequential_mode = 0 writes all data to one big BOX_mdat and needs going back to update it's size (stored near beginning of file) when write to mp4 is finished. Here we have overflow, because minimp4 do not support writing BOX_mdat > 4Gb:
I think I'm insert assert here... |
Also this two modes have noting to do with SPS/PPS, but mp4 stores SPS/PPS per track and do not support changing it in the middle of stream on fly. That's MINIMP4_TRANSCODE_SPS_ID is for: some hardware encoders changes SPS/PPS ids on fly despite fact that different id point to same copy of SPS/PPS (otherwise stream can't be correctly stored in mp4 at all). When enabled, it transcodes SPS/PPS ids so it always point to copy included in track metadata. |
Thank for your explains !!! |
Theoretically, we can create BOX_mdat > 4G for sequential_mode = 0, but problem is, that we must reserve space for it and I'm not sure that use 64bit size encoding for 32bit is right thing to do, some demuxers may support only 32bit. |
I can capture in h264 file and build a MP4 file with MINIMP4 . that's work for read : I replace code in case MINIMP4_TRANSCODE_SPS_ID == 0 with :
` But, if i muxing with minimp4 a h264 buffer from capture into MP4 file there are an error message in vlc or avidemux: "sps_id 32 out of range" and "extradataSize:33" , and i cant read than more 4Go.
|
That's expected, sps_id=32 encoded in slice headers. But in track metadata contains only one SPS/PPS arrived first (and probably sps_id=0). That's exactly problem described above and looks like MINIMP4_TRANSCODE_SPS_ID=1 is needed for this encoder. Does it works with MINIMP4_TRANSCODE_SPS_ID=1 sequential_mode = 1 without any modifications? |
After 8d91f27 sequential_mode=0 should work with >4Gb too. |
When i used MINIMP4_TRANSCODE_SPS_ID = 1 , there are a buffer error :
|
nice job , that's works with options :
I can read the video file (4.2Go) with VLC. Only a VLC warning in start:
problems in "Picture Order Count" for first frame, may be something to unsuitable on my modification. But i cant open file with avidemux
with a Window Warning "codec : internal error opening AV_CODEC_ID_H264" |
Can you attach sample h264 elementary stream that shows the problem? |
i try git clone with MINIMP4_TRANSCODE_SPS_ID=1 , sequential_mode = 0 In my code , with MINIMP4_TRANSCODE_SPS_ID = 0, i can make more than 4 Go ( sequence 1 or 0 ) , but , VLC read last frame before 4Go. For example, 40Mbits/s ... after 15 minutes, we can see another frame (like a freeze). But, i can open , read and see the time in bottom . Log VLC after read more than 4Go ( ~ 4.2 go ) :
Last day , it's was MINIMP4_TRANSCODE_SPS_ID=0 , not MINIMP4_TRANSCODE_SPS_ID=1 |
Thanks for testing again :) |
yes, the function remove_nal_escapes return 0 due buffer problems. i drop buffers and open with avidemux. |
Amazing, MINIMP4_TRANSCODE_SPS_ID=1 ans sequence = 0 ... i have an error from id SPS. Line in git : here , we have sizeof_nal = 4. unfortunely , i cant reproduct this in a 264 file.
|
THX .... i think that i found for SPS error out of rang ( 33 > 31 ) ... that's a NvVideoEncoder setting profile : set to HIGH. |
Nice :) I will try to check big files as well. |
I add free buffer in cas : `
` MINIMP4_TRANSCODE_SPS_ID = 1 and Sequence = 0 , there are a freeze image in VLC with message :
I think is last image before the 4.2 Go. MINIMP4_TRANSCODE_SPS_ID = 1 and Sequence = 1 have same issu |
Thanks :) Fixed the leak. |
It's more me who thank you !!! Have you an idea for read big files ? I can read first 4.2Go on big file. All other frames after this was mark go away like vlc message , but scrollbar time run always.
|
Here 64bit indexes support cced14d . Now I'm able to seek large files. |
nice job !!!! ... i make big MP4 file with sample left-20181204_0844.zip (loop in minimp4_test.c for duplicate h264 buffer)... and, that's work well ;) This is a tiny application is great job for small soc and embedded system 🥇 |
Can you check that High Profile works too? If it's not, can you attach sample stream? |
i think left-20181204_0844.zip is on 10fps, 4k , profile HIGH and level 4.0 , i will to test too on 5.1 for next nigth |
I'm about
left-20181204_0844.zip do not have such problem. |
sps id from encoding was solve with good parameters settings on Hardware HEVC (encoder like sps enable option --' ). |
Good :) I guess everything solved then. |
🥇 Yep ... nice job !!! |
Last nightly, tests have work well in level 5.1 , and have produced readable big files !!! That's solved ;) |
Closing then. |
for work on Nvidia embedded Jetson solution ,
i switch off MINIMP4_TRANSCODE_SPS_ID and fix compilation.
So, i cant make a readable files with more than 4Go ... Beyond that , in MediaInfo , isTruncated status become TRUE and the file is unreadable into VLC/Mplayer.
I forgot something in code ?
The text was updated successfully, but these errors were encountered: