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

Incorrect duration/streaming with really small MP4 files #6

Open
roman380 opened this issue Feb 6, 2016 · 3 comments
Open

Incorrect duration/streaming with really small MP4 files #6

roman380 opened this issue Feb 6, 2016 · 3 comments
Assignees
Labels

Comments

@roman380
Copy link
Owner

roman380 commented Feb 6, 2016

There is a problem with tiny MP4 files, supposedly both demultiplexer and multiplexer problem: a 5 frame movie created by mp4mux has a zero "mdhd_duration" as reported by MediaInfo. It is still playable but not with mp4demux.

mp4demux streams zero frames and report EOS, it somehow skips frames because it reads duration of zero from the input file and abort streaming reaching stop time.

@roman380 roman380 added the bug label Feb 6, 2016
@roman380 roman380 self-assigned this Feb 6, 2016
@roman380
Copy link
Owner Author

roman380 commented Feb 6, 2016

It has something to do with rounding perhaps: 4 fps, 4 seconds frame with GOP of 4 has last streamed frame of 3 000 0000, instead of 3 750 0000

D:\Projects\Alax.Info\Repository-Private\Utilities\DirectShow\HardwareVideoEncoderTransform_Bin\Win32\Debug>generate resolution 40 30 rate 4 1 duration 4 path tiny.mp4

MediaInfo:

General
Complete name : D:\Projects\Alax.Info\Repository-Private\Utilities\DirectShow\H.264\tiny.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 3.36 KiB
Duration : 3s 750ms
Overall bit rate : 7 349 bps

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L1.0
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3s 750ms
Source duration : 4s 0ms
Bit rate : 5 380 bps
Width : 16 pixels
Height : 16 pixels
Display aspect ratio : 1.000
Frame rate mode : Constant
Frame rate : 4.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 5.254
Stream size : 2.46 KiB (73%)
Source stream size : 2.52 KiB (75%)
Language : English
mdhd_Duration : 3750

@roman380 roman380 changed the title Incorrect duration with small MP4 files Incorrect duration/streaming with really small MP4 files Feb 6, 2016
@roman380
Copy link
Owner Author

The problem is not limited to extra small files. With other bigger files demultipexer can drop one or more ending frames.

@roman380
Copy link
Owner Author

Another sample file with valid video which does not produce media samples with MP4 demultiplexer: Output-00-0000.mp4.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant