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

pkt_duration, pkt_duration_time missing for first 20 frames #2

Open
frito-ray opened this issue Aug 12, 2020 · 0 comments
Open

pkt_duration, pkt_duration_time missing for first 20 frames #2

frito-ray opened this issue Aug 12, 2020 · 0 comments

Comments

@frito-ray
Copy link

(Nice work by the way!) There's something a bit off with time.mp4, the first 20 frames are missing pkt_duration and pkt_duration_time. I'm not sure how various decoders use pkt_duration but I know ffmpeg will calculate it.

The following output was generated using ffprobe -of json -v debug -show_frames -show_format -show_streams -show_log 56 -unit $1 > $1.json 2> $1.mp4-errors.json

frame 17 - missing pkt_duration

 {
            "media_type": "video",
            "stream_index": 0,
            "key_frame": 0,
            "pkt_pts": 22000,
            "pkt_pts_time": "0.917584 s",
            "pkt_dts": 22000,
            "pkt_dts_time": "0.917584 s",
            "best_effort_timestamp": 22000,
            "best_effort_timestamp_time": "0.917584 s",
            "pkt_pos": "34056",
            "pkt_size": "2380 byte",
            "width": 1280,
            "height": 720,
            "pix_fmt": "yuv420p",
            "pict_type": "P",
            "coded_picture_number": 17,
            "display_picture_number": 0,
            "interlaced_frame": 0,
            "top_field_first": 0,
            "repeat_pict": 0,
            "chroma_location": "left",
            "logs": [
                {
                    "context": "h264",
                    "level": 48,
                    "category": 6,
                    "message": "[h264 @ 0x7fa8c780ac00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2"
                }
            ]
        }

frame 24 - has pkt_duration

{
            "media_type": "video",
            "stream_index": 0,
            "key_frame": 0,
            "pkt_pts": 25000,
            "pkt_pts_time": "1.042709 s",
            "pkt_dts": 25000,
            "pkt_dts_time": "1.042709 s",
            "best_effort_timestamp": 25000,
            "best_effort_timestamp_time": "1.042709 s",
            "pkt_duration": 1000,
            "pkt_duration_time": "0.041708 s",
            "pkt_pos": "44314",
            "pkt_size": "1377 byte",
            "width": 1280,
            "height": 720,
            "pix_fmt": "yuv420p",
            "pict_type": "B",
            "coded_picture_number": 24,
            "display_picture_number": 0,
            "interlaced_frame": 0,
            "top_field_first": 0,
            "repeat_pict": 0,
            "chroma_location": "left",
            "logs": [
                {
                    "context": "h264",
                    "level": 48,
                    "category": 6,
                    "message": "[h264 @ 0x7fa8c780ac00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2"
                }
            ]
        }

It appears to be encoded at 23.976fps:

"streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
            "codec_time_base": "1001/48000",
            "codec_tag_string": "avc1",
            "codec_tag": "0x31637661",
            "width": 1280,
            "height": 720,
            "coded_width": 1280,
            "coded_height": 720,
            "closed_captions": 0,
            "has_b_frames": 2,
            "pix_fmt": "yuv420p",
            "level": 31,
            "chroma_location": "left",
            "refs": 4,
            "is_avc": "true",
            "nal_length_size": "4",
            "r_frame_rate": "2997/125",
            "avg_frame_rate": "2997/125",
            "time_base": "1/23976",
            "start_pts": 2000,
            "start_time": "0.083417 s",
            "duration_ts": 480000,
            "duration": "20.020020 s",
            "bit_rate": "306544 bit/s",
            "bits_per_raw_sample": "8",
            "nb_read_frames": "480",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "language": "und",
                "handler_name": "Bento4 Video Handler",
                "encoder": "AVC Coding"
            }
        }
    ],
    "format": {
        "filename": "time.mp4",
        "nb_streams": 1,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.083417 s",
        "duration": "20.020020 s",
        "size": "773045 byte",
        "bit_rate": "308908 bit/s",
        "probe_score": 100,
        "tags": {
            "major_brand": "mp42",
            "minor_version": "1",
            "compatible_brands": "isommp42avc1iso5"
        }
    }

Can you share how you generated test.mp4?

I'm working on a project where frame accuracy is paramount and of course are seeing some of the same issues. We are evaluating a commercial frame-accurate player as a potential workaround. They claim to provide an accurate video.currentTime...

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

1 participant