Closed Bug 1870401 Opened 1 year ago Closed 1 year ago

Duration of encoded data in FFmpegVideoEncoder is always 0

Categories

(Core :: Audio/Video, defect, P1)

defect

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: chunmin, Assigned: chunmin)

References

(Blocks 1 open bug)

Details

Attachments

(5 files, 1 obsolete file)

The duratoin of the encoded data in FFmpegVideoEncoder is always 0. It's probably limited by the FFmpeg's API. An alternative is to save the duration before encoding and retrieve the duration after encoding, like what FFmpegVideoDecoder.cpp did (mDurationMap) for older ffmpeg versions.

Attached file Bug 1870401 - Correct include order (obsolete) —

Depends on D196640

Attachment #9369022 - Attachment description: WIP: Bug 1870401 - Set duration manually if possible → WIP: Bug 1870401 - Pass AVFrame's duration to AVPacket

AV_CODEC_FLAG_FRAME_DURATION was introduced in ffmpeg 60. For older
ffmpeg versions, we can simply save the duration in a map and then
retrieve it when needed, as what FFmpegVideoDecoder did.

Depends on D196641

Attachment #9369021 - Attachment description: WIP: Bug 1870401 - Correct include order → Bug 1870401 - Correct include order
Attachment #9369022 - Attachment description: WIP: Bug 1870401 - Pass AVFrame's duration to AVPacket → Bug 1870401 - Pass AVFrame's duration to AVPacket
Attachment #9369129 - Attachment description: WIP: Bug 1870401 - Set duration for ffmpeg version < 60 → Bug 1870401 - Set duration for ffmpeg version < 60

Comment on attachment 9369021 [details]
Bug 1870401 - Correct include order

Revision D196640 was moved to bug 1872204. Setting attachment 9369021 [details] to obsolete.

Attachment #9369021 - Attachment is obsolete: true
Attachment #9369022 - Attachment description: Bug 1870401 - Pass AVFrame's duration to AVPacket → Bug 1870401 - Simplify AVFrame's duration settings

Depends on D196683

Depends on D197355

Run

./mach clang-format --path dom/media/gtest/TestMediaDataEncoder.cpp

Depends on D196683

Pushed by cchang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c8c1d0bff9dc Simplify AVFrame's duration settings r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/cf64542b8a45 Set duration for ffmpeg version < 60 r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/5d9e038ddb39 clang-format TestMediaDataEncoder.cpp r=media-playback-reviewers,alwu https://hg.mozilla.org/integration/autoland/rev/ff9dcb89337a Move H264AVCC lines r=media-playback-reviewers,alwu https://hg.mozilla.org/integration/autoland/rev/697b731b550c Add duration tests r=media-playback-reviewers,alwu
See Also: → 1869560
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: