Seeking to the head of certain mp4 files results in infinite progress indicator.

VERIFIED FIXED in Firefox 55

Status

()

defect
P1
normal
VERIFIED FIXED
3 years ago
2 years ago

People

(Reporter: peter, Assigned: jya)

Tracking

({regression})

49 Branch
mozilla55
x86
Windows 7
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox49 wontfix, firefox50 wontfix, firefox51 wontfix, firefox52- wontfix, firefox-esr52 wontfix, firefox53 wontfix, firefox54 wontfix, firefox55 verified)

Details

Attachments

(7 attachments)

Reporter

Description

3 years ago
To repro:

In Win7/Win8.1/Win10 & Firefox 49, 50, 51 or 52, play the attached 3 second mp4. Once the file is >50% done playing, pause and seek back to the start of the file.

Firefox will show an endless progress indicator and never complete the seek. I also encounter this issue if I play the file to completion and then attempt to re-play the same clip.

We thought this might've been fixed by the same fix as https://bugzilla.mozilla.org/show_bug.cgi?id=1274498, but that doesn't seem to be the case.

We don't reproduce this issue in FF on the Mac, or any other browser or media player on the Mac or PC.

Updated

3 years ago
Component: General → Audio/Video: Playback
Product: Firefox → Core

Updated

3 years ago
Reporter

Comment 1

3 years ago
After multiple stalled playback attempts you'll frequently crash with the following report:

AbortMessage: ###!!! ABORT: file c:/builds/moz2_slave/m-rel-w32-00000000000000000000/build/src/dom/media/MediaShutdownManager.cpp, line 75
AdapterDeviceID: 0x0dc4
AdapterDriverVersion: 21.21.13.6909
AdapterSubsysID: 087910de
AdapterVendorID: 0x10de
Add-ons: %7B3e9a3920-1b27-11da-8cd6-0800200c9a66%7D:3.11,%7B972ce4c6-7e08-4474-a285-3208198ce6fd%7D:49.0.2,asyncrendering%40mozilla.org:2.0,e10srollout%40mozilla.org:1.3,firefox%40getpocket.com:1.0.4,webcompat%40mozilla.org:1.0
AddonsShouldHaveBlockedE10s: 1
AsyncPluginShutdownStates: {WidevineCdm:
{d422000:"S=CloseActive"}
,clearkey:
{d422400:"S=CloseActive"}
,Primetime Content Decryption Module provided by Adobe Systems, Incorporated:
{cca6c00:"S=CloseActive"}
,gmpopenh264:
{cc1e000:"S=CloseActive"}
,:{:"012345=Async shutdown complete"}}
AsyncShutdownTimeout: {"phase":"profile-before-change","conditions":[
{"name":"MediaShutdownManager: shutdown","state":"(none)","filename":"c:/builds/moz2_slave/m-rel-w32-00000000000000000000/build/src/dom/media/MediaShutdownManager.cpp","lineNumber":75,"stack":"MediaShutdownManager shutdown"}
]}
AvailablePageFile: 11336794112
AvailablePhysicalMemory: 4646936576
AvailableVirtualMemory: 3368632320
BIOS_Manufacturer: Award Software International, Inc.
BlockedDllList: 
BreakpadReserveAddress: 51249152
BreakpadReserveSize: 67108864
BuildID: 20161019084923
CrashTime: 1477508513
E10SCohort: disqualified-test
EMCheckCompatibility: true
FramePoisonBase: 00000000f0de0000
FramePoisonSize: 65536
InstallTime: 1477507785
Notes: AdapterVendorID: 0x10de, AdapterDeviceID: 0x0dc4, AdapterSubsysID: 087910de, AdapterDriverVersion: 21.21.13.6909
Has dual GPUs. GPU #2: AdapterVendorID2: 0x8086, AdapterDeviceID2: 0x0112, AdapterSubsysID2: 087910de, AdapterDriverVersion2: 9.17.10.4229FP(D000-L10010-W00000000-T0000) D2D1.1? DWrite? DWrite+ D2D1.1+ D3D11 Layers? D3D11 Layers+ DXVA2D3D9? DXVA2D3D9+ xpcom_runtime_abort(###!!! ABORT: file c:/builds/moz2_slave/m-rel-w32-00000000000000000000/build/src/dom/media/MediaShutdownManager.cpp, line 75)
ProductID:
{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
ProductName: Firefox
ReleaseChannel: release
SafeMode: 0
SecondsSinceLastCrash: 17986436
ShutdownProgress: profile-before-change
StartupTime: 1477508165
SystemMemoryUsePercentage: 45
TelemetryEnvironment: {"build":{"applicationId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
","applicationName":"Firefox","architecture":"x86","buildId":"20161019084923","version":"49.0.2","vendor":"Mozilla","platformVersion":"49.0.2","xpcomAbi":"x86-msvc","hotfixVersion":"20160826.01"},"partner":
{"distributionId":null,"distributionVersion":null,"partnerId":null,"distributor":null,"distributorChannel":null,"partnerNames":[]}
,"system":{"memoryMB":8109,"virtualMaxMB":4096,"cpu":
{"count":4,"cores":4,"vendor":"GenuineIntel","family":6,"model":42,"stepping":7,"l2cacheKB":256,"l3cacheKB":6144,"speedMHz":3310,"extensions":["hasMMX","hasSSE","hasSSE2","hasSSE3","hasSSSE3","hasSSE4_1","hasSSE4_2","hasAVX"]}
,"os":
{"name":"Windows_NT","version":"10.0","locale":"en-US","servicePackMajor":0,"servicePackMinor":0,"windowsBuildNumber":14393,"windowsUBR":321,"installYear":2016}
,"hdd":{"profile":
{"model":"INTEL SSDSC2CT240A4","revision":"335u"}
,"binary":
{"model":"INTEL SSDSC2CT240A4","revision":"335u"}
,"system":{"model":"INTEL SSDSC2CT240A4","revision":"335u"}},"gfx":{"D2DEnabled":true,"DWriteEnabled":true,"adapters":[
{"description":"NVIDIA GeForce GTS 450","vendorID":"0x10de","deviceID":"0x0dc4","subsysID":"087910de","RAM":1024,"driver":"C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\nv_dispiwu.inf_amd64_9ff5ab165faead52\\nvd3dumx,C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\nv_dispiwu.inf_amd64_9ff5ab165faead52\\nvwgf2umx,C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\nv_dispiwu.inf_amd64_9ff5ab165faead52\\nvwgf2umx,C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\nv_dispiwu.inf_amd64_9ff5ab165faead52\\nvwgf2umx C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\nv_dispiwu.inf_amd64_9ff5ab165faead52\\nvd3dum,C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\nv_dispiwu.inf_amd64_9ff5ab165faead52\\nvwgf2um,C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\nv_dispiwu.inf_amd64_9ff5ab165faead52\\nvwgf2um,C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\nv_dispiwu.inf_amd64_9ff5ab165faead52\\nvwgf2um","driverVersion":"21.21.13.6909","driverDate":"8-1-2016","GPUActive":true}
,
{"description":"Intel(R) HD Graphics 3000","vendorID":"0x8086","deviceID":"0x0112","subsysID":"0000000c","RAM":null,"driver":"igdumd64 igd10umd64 igd10umd64 igdumd32 igd10umd32 igd10umd32","driverVersion":"9.17.10.4229","driverDate":"5-27-2015","GPUActive":false}
],"monitors":[
{"screenWidth":2560,"screenHeight":1440,"refreshRate":59,"pseudoDisplay":false}
],"features":{"compositor":"none","d3d11":
{"status":"available","version":45056,"warp":false,"textureSharing":true,"blacklisted":false}
,"d2d":
{"status":"available","version":"1.1"}
}},"isWow64":true},"settings":{"blocklistEnabled":true,"e10sEnabled":false,"e10sCohort":"disqualified-test","telemetryEnabled":false,"locale":"en-US","update":
{"channel":"release","enabled":true,"autoDownload":true}
,"userPrefs":
{"browser.cache.disk.capacity":358400,"browser.newtabpage.enhanced":true,"browser.shell.checkDefaultBrowser":false,"browser.urlbar.userMadeSearchSuggestionsChoice":true}
,"addonCompatibilityCheckEnabled":true,"isDefaultBrowser":false},"profile":
{"creationDate":16861}
,"addons":{"activeAddons":{"
{3e9a3920-1b27-11da-8cd6-0800200c9a66}
":
{"blocklisted":false,"description":"Auto-configures Mozilla Firefox for use with Charles Web Debugging Proxy.","name":"Charles Proxy Auto-configuration","userDisabled":false,"appDisabled":false,"version":"3.11","scope":1,"type":"extension","foreignInstall":false,"hasBinaryComponents":false,"installDay":16864,"updateDay":16864,"signedState":2,"isSystem":false}
,"e10srollout@mozilla.org":
{"blocklisted":false,"description":"Staged rollout of Firefox multi-process feature.","name":"Multi-process staged rollout","userDisabled":false,"appDisabled":false,"version":"1.3","scope":1,"type":"extension","foreignInstall":false,"hasBinaryComponents":false,"installDay":16912,"updateDay":17095,"isSystem":true}
,"firefox@getpocket.com":
{"blocklisted":false,"description":"When you find something you want to view later, put it in Pocket.","name":"Pocket","userDisabled":false,"appDisabled":false,"version":"1.0.4","scope":1,"type":"extension","foreignInstall":false,"hasBinaryComponents":false,"installDay":16912,"updateDay":17095,"isSystem":true}
,"webcompat@mozilla.org":
{"blocklisted":false,"description":"Urgent post-release fixes for web compatibility.","name":"Web Compat","userDisabled":false,"appDisabled":false,"version":"1.0","scope":1,"type":"extension","foreignInstall":false,"hasBinaryComponents":false,"installDay":17067,"updateDay":17095,"isSystem":true}
,"asyncrendering@mozilla.org":{"blocklisted":false,"description":"Enables asynchronous drawing mode for plugins.","name":"Asynchronous Plugin Rendering","userDisabled":false,"appDisabled":false,"version":"2.0","scope":1,"type":"extension","foreignInstall":false,"hasBinaryComponents":false,"installDay":17100,"updateDay":17100,"signedState":3,"isSystem":true}},"theme":{"id":"
{972ce4c6-7e08-4474-a285-3208198ce6fd}
","blocklisted":false,"description":"The default theme.","name":"Default","userDisabled":false,"appDisabled":false,"version":"49.0.2","scope":4,"foreignInstall":false,"hasBinaryComponents":false,"installDay":16847,"updateDay":17095},"activePlugins":[
{"name":"SnapStream DVD Burn Plugin","version":"7.2.0.7378","description":"SnapStream DVD Burn Plugin","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-ssdvdburnplugin"],"updateDay":17017}
,
{"name":"VMware Remote Console Plug-in","version":"5.5.0.34615","description":"VMware Remote Console Plug-in","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-vmware-remote-console-2012"],"updateDay":16373}
,
{"name":"Google Update","version":"1.3.31.5","description":"Google Update","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-vnd.google.update3webcontrol.3","application/x-vnd.google.oneclickctrl.9"],"updateDay":17014}
,
{"name":"Microsoft Office 2010","version":"14.0.4730.1010","description":"Office Authorization plug-in for NPAPI browsers","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-msoffice14"],"updateDay":14619}
,
{"name":"Microsoft Office 2010","version":"14.0.4761.1000","description":"The plug-in allows you to open and edit files using Microsoft Office applications","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-sharepoint"],"updateDay":14693}
,
{"name":"Intel® Identity Protection Technology","version":"4.0.5.0","description":"Intel web components for Intel® Identity Protection Technology","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-vnd-intel-webapi-ipt-4.0.5"],"updateDay":15964}
,
{"name":"Intel® Identity Protection Technology","version":"4.0.5.0","description":"Intel web components updater - Installs and updates the Intel web components","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-vnd-intel-webapi-updater"],"updateDay":15964}
,
{"name":"Foxit PhantomPDF Plugin for Mozilla","version":"2.2.4.414","description":"Foxit PhantomPDF Plug-In For Firefox and Netscape","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/pdf","application/vnd.fdf"],"updateDay":16183}
,
{"name":"SnapStream Web Player","version":"7.2.0.7152","description":"Web Player Plugin for SnapStream Enterprise TV","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-snapstreamwebplayer"],"updateDay":16940}
],"activeGMPlugins":{"gmp-gmpopenh264":
{"version":"1.6","userDisabled":false,"applyBackgroundUpdates":1}
,"gmp-eme-adobe":
{"version":"17","userDisabled":false,"applyBackgroundUpdates":1}
,"gmp-widevinecdm":{"version":"1.4.8.903","userDisabled":false,"applyBackgroundUpdates":1}},"activeExperiment":{},"persona":null}}
Theme: classic/1.0
Throttleable: 1
TotalPageFile: 17092947968
TotalPhysicalMemory: 8503013376
TotalVirtualMemory: 4294836224
URL: http://test37/Play/MediaItem/c0251f2c-c46c-4a6b-a787-1742e3f9809b
UptimeTS: 1126.048063839
Vendor: Mozilla
Version: 49.0.2
Winsock_LSP: Hyper-V RAW : 2 : 34 : 1 : 1 : 0x20026 : 0x8 : %SystemRoot%\system32\mswsock.dll : : 1234191b-4bf7-4ca7-86e0-dfd7c32b5445 
MSAFD Tcpip [TCP/IP] : 2 : 2 : 1 : 6 : 0x20066 : 0x8 : %SystemRoot%\system32\mswsock.dll : : e70f1aa0-ab8b-11cf-8ca3-00805f48a192 
MSAFD Tcpip [UDP/IP] : 2 : 2 : 2 : 17 : 0x20609 : 0x8 : %SystemRoot%\system32\mswsock.dll : : e70f1aa0-ab8b-11cf-8ca3-00805f48a192 
MSAFD Tcpip [RAW/IP] : 2 : 2 : 3 : 0 : 0x20609 : 0xc : %SystemRoot%\system32\mswsock.dll : : e70f1aa0-ab8b-11cf-8ca3-00805f48a192 
MSAFD Tcpip [TCP/IPv6] : 2 : 23 : 1 : 6 : 0x20066 : 0x8 : %SystemRoot%\system32\mswsock.dll : : f9eab0c0-26d4-11d0-bbbf-00aa006c34e4 
MSAFD Tcpip [UDP/IPv6] : 2 : 23 : 2 : 17 : 0x20609 : 0x8 : %SystemRoot%\system32\mswsock.dll : : f9eab0c0-26d4-11d0-bbbf-00aa006c34e4 
MSAFD Tcpip [RAW/IPv6] : 2 : 23 : 3 : 0 : 0x20609 : 0xc : %SystemRoot%\system32\mswsock.dll : : f9eab0c0-26d4-11d0-bbbf-00aa006c34e4 
RSVP TCPv6 Service Provider : 2 : 23 : 1 : 6 : 0x22066 : 0x8 : %SystemRoot%\system32\mswsock.dll : : 9d60a9e0-337a-11d0-bd88-0000c082e69a 
RSVP TCP Service Provider : 2 : 2 : 1 : 6 : 0x22066 : 0x8 : %SystemRoot%\system32\mswsock.dll : : 9d60a9e0-337a-11d0-bd88-0000c082e69a 
RSVP UDPv6 Service Provider : 2 : 23 : 2 : 17 : 0x22609 : 0x8 : %SystemRoot%\system32\mswsock.dll : : 9d60a9e0-337a-11d0-bd88-0000c082e69a 
RSVP UDP Service Provider : 2 : 2 : 2 : 17 : 0x22609 : 0x8 : %SystemRoot%\system32\mswsock.dll : : 9d60a9e0-337a-11d0-bd88-0000c082e69a 
MSAFD Irda [IrDA] : 2 : 26 : 1 : 1 : 0x20006 : 0x8 : %SystemRoot%\system32\mswsock.dll : : 3972523d-2af1-11d1-b655-00805f3642cc
useragent_locale: en-US
This report also contains technical information about the state of the application when it crashed.

Comment 2

3 years ago
I am able to reproduce this in Nightly 52.0a1 (2016-10-26) (32-bit) on Windows 10. 

User-agent : Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0

Comment 3

3 years ago
Regression window:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=dc352a7bf234&tochange=0753f7b93ab7


Bug 1058364?
Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true
Chris, any chance someone can take a look at this? Is it important enough to try to get it fixed and uplifted to beta before we ship next week?
Flags: needinfo?(cpearce)
This is fixed for me in Nightly 52 but not in Beta. I'd guess we fixed this inadvertently since this bug was filed two weeks ago.

Given that Yang has shown this is a 2 year old regression, I don't think we need to rush a fix into 50; we can wait another six weeks.

We should try to figure out what fixed this in Nightly, and see if that can be uplift to 51.
Flags: needinfo?(cpearce)
This presents very similarly to bug 1274498; caught in a local debugger, I see a MediaPlayback thread:

 	xul.dll!mozilla::SyncRunnable::DispatchToThread(mozilla::AbstractThread * aThread, nsIRunnable * aRunnable, bool aForceDispatch) Line 105	C++
 	xul.dll!mozilla::WMFMediaDataDecoder::Flush() Line 182	C++
 	xul.dll!mozilla::MediaFormatReader::DecoderData::Flush() Line 374	C++
 	xul.dll!mozilla::MediaFormatReader::Reset(mozilla::TrackInfo::TrackType aTrack) Line 1520	C++
 	xul.dll!mozilla::MediaFormatReader::VideoSkipReset(unsigned int aSkipped) Line 1583	C++
 	xul.dll!mozilla::MediaFormatReader::OnVideoSkipCompleted(unsigned int aSkipped) Line 1599	C++


And then a MediaPDecoder thread:

>	xul.dll!mozilla::MFTDecoder::SendMFTMessage(_MFT_MESSAGE_TYPE aMsg, unsigned long aData) Line 117	C++
 	xul.dll!mozilla::MFTDecoder::Flush() Line 291	C++
 	xul.dll!mozilla::MFTManager::Flush() Line 42	C++
 	xul.dll!mozilla::detail::RunnableMethodImpl<void (__thiscall mozilla::DecodedStreamGraphListener::*)(void),1,0>::Run() Line 766	C++
 	xul.dll!mozilla::SyncRunnable::Run() Line 112	C++

And then an msmpeg2vdec thread presumably deadlocked processing that message (my symbols are resolving today for some reason).
Thanks, I updated the status flags for the upcoming few releases.
Mozregression says this was fixed in a1bbdaf0f9ca, a merge commit, from this range:

https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=8b6401bcb115f69ca4b9738ca2f0db8338599af7&tochange=ab46d921bf6be5790c192b7c32ffe03aa1ac970c

My guess is one of jw's pushes in that range.
I'm not sure what fixed this; I can't bisect into a merge commit, and I've tried reverting locally the changes in that merge commit that touch video, but I have been unable to identify the commit that fixed this. I think we can just let whatever fixed this ride the trains.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Comment 10

3 years ago
This is not fixed for me with the latest Nightly. I observe a huge CPU use when playing this video file and that stays in the process manager after leaving Nightly.
Loic: I see high CPU utilization when playing that video anyway, are you sure that what you're seeing is a regression in 50, and not just caused by that video being a complicated video and needing lots of CPU to decode?
Flags: needinfo?(epinal99-bugzilla2)

Comment 12

3 years ago
No, seeking is definitively problematic with this video in Nightly. If I grab the seekbar when the playback is in the middle or at the end to seek back to start, playback doesn't start anymore. I have to reload the page to restart the video.
Works fine with FF33.
Flags: needinfo?(epinal99-bugzilla2)

Comment 13

3 years ago
Setting media.hardware-video-decoding.enabled = false seems to fix the problem.

Comment 14

3 years ago
@Chris Pearce, 
You are seeing High CPU and this problem is fixed.
I think Nightly52 on your PC blocks hardware video decoding.

Could you check hardware video decoding is enabled or not?
Flags: needinfo?(cpearce)
Hardware acceleration is not disabled on my Win10 system, and I don't see the bug regardless of e10s or whether I've disabled hardware acceleration. I also tested on my Win7 laptop, and saw the same, i.e. I can't repro on Win7 either.
Flags: needinfo?(cpearce)

Comment 16

3 years ago
hardware video decoding, i.e., in about:media, "video decoder" indicates in either of "wmf hardware video decoder" or "wmf software video decoder".
I was looking in about:support and toggling the media.hardware-video-decoding.* prefs.

Comment 18

3 years ago
(In reply to Alice0775 White from comment #13)
> Setting media.hardware-video-decoding.enabled = false seems to fix the
> problem.

I confirm that.

Comment 19

3 years ago
Reopened.

still reproduce infinite progress indicator problem on Nightly52.0a1(2016-11-13).
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
this doesn't seem like a huge issue or recent regression, not tracking for 52
I can't reproduce this issue on Windows7 Nighty 53.0a1.
It seems someone has solved this issue, ask qa-wanted to verify it again.
Keywords: qawanted

Comment 22

2 years ago
(In reply to Alastor Wu [:alwu][OOO from 1/27 - 2/1] from comment #21)
> I can't reproduce this issue on Windows7 Nighty 53.0a1.
> It seems someone has solved this issue, ask qa-wanted to verify it again.

It's still reproducible in the latest Nightly on Win 7. After pausing and seeking to start the video, playback is broken and Nightly concumes a lot of CPU (one or 2 cores). Even after exit, I needed to kill it.

Updated

2 years ago
Keywords: qawanted

Updated

2 years ago
Assignee: nobody → alwu
I found that the problem is MFT can't finish flushing, so we're stuck in [1].
Still looking for the reason why flushing can't success.

[1] https://goo.gl/iUXbNe
Status: REOPENED → NEW
Still can't find the root cause. Following info is what I observed.

---

In two situations, the MFT flush would never return the value and causes infinite waiting when we seek the video to the beginning. 

1. MFT returns MF_E_TRANSFORM_NEED_MORE_INPUT, and then call flush
2. MFT returns MF_E_TRANSFORM_STREAM_CHANGE (with status=MFT_PROCESS_OUTPUT_STATUS_NEW_STREAMS), and then call flush

Note. It doesn't mean these two situations cause the problem, that is what I observed, the final MFT behavior before flush called.

And the problem can only happen if we enable the hardware acceleration.

---

Hi,
Matt, Chris,
Do you have any idea why flush got stuck forever?
Thanks!
Flags: needinfo?(matt.woodrow)
Flags: needinfo?(cpearce)
Are you saying that the call to Flush just blocks the thread forever?

That sounds really bad, I'm not sure why that would be.
Flags: needinfo?(matt.woodrow)
(In reply to Matt Woodrow (:mattwoodrow) from comment #25)
> Are you saying that the call to Flush just blocks the thread forever?
> 
> That sounds really bad, I'm not sure why that would be.

Yes, after seeking to the beginning, the flush was blocked forever.
Posted video remux_video.mp4
If we remux the video and increase the compression ratio, then the issue would disappear, but we still don't know what's happened...

---

Hi, Jya,
Do you have any idea about this issue?
Thanks!
Flags: needinfo?(jyavenard)
Checking the video with the analysis tools (H264Visa and CodecVisa), I found that the value of some attributes [1] in SPS and PPS would be changed during the playback. The first and second IDR is frame0 and frame10, and the content in frame0-frame9 are different with ant other frames.

I CAN also reproduce this issue on Chrome if enable the hardware video decoding, Chrome also uses MFT for hardware decoding. Therefore, I guess this issue might be MFT's internal problem, maybe it doesn't handle this situation well so cause the hang. 

[1] log2_max_frame_num/pic_order_cnt_type/log2_max_pic_order_cnt_lsb/chroma_qp_index_offset/Intra4x4PredMode

---

If I suspect this problem is in Microsoft's, could we ask their person to check it?
Thanks.
Flags: needinfo?(jyavenard)
Flags: needinfo?(cpearce)
Flags: needinfo?(ajones)
Assignee

Comment 29

2 years ago
do you know how that video was generated?

Is this fragmented MP4?
maybe it's the result of concatenating different videos together.

However, the H264Converter should handle the condition you describe. Prior feeding the decoder with the data it checks if there are SPS/PPS NAL present, and if the new SPS/PPS have changed compare to the previous version, the current decoder is flushed then shutdown and a new one is created.

As such, a decoder only ever see a single version of the SPS/PPS.

I'll investigate the problem later today.
Flags: needinfo?(jyavenard)
(In reply to Jean-Yves Avenard [:jya] from comment #29)
> do you know how that video was generated?
> 
> Is this fragmented MP4?
> maybe it's the result of concatenating different videos together.
> 
> However, the H264Converter should handle the condition you describe. Prior
> feeding the decoder with the data it checks if there are SPS/PPS NAL
> present, and if the new SPS/PPS have changed compare to the previous
> version, the current decoder is flushed then shutdown and a new one is
> created.
> 
> As such, a decoder only ever see a single version of the SPS/PPS.
> 
> I'll investigate the problem later today.

No, now the H264Converter doesn't handle this situation.

First, the SPS and PPS number doesn't be changed, but the content changed. These data is extracted from video info, which was extracted from demuxer and it won't be changed, and then we would set this extradata for all sample [1].

In AnnexB::ExtractExtraData [2], we won't parse the sample again if it already has the |mExtradata|. However, if you parse the sample, you would find the extradata is not equal with the |mExtradata|.

Because we didn't parse extradata again [2], we won't know the content of SPS/PPS was changed.

[1] https://goo.gl/NFDx3A
[2] https://goo.gl/oC6Tcg
I'll let Jean-Yves to investigate.
Flags: needinfo?(ajones)
Assignee

Comment 32

2 years ago
If the SPS/PPS change inband, yet the file is marked as being AVC1, then this is a broken file.
The issue here is that when converting to annex b, we prepend the original SPS/PPS to the content, seems that some HW decoder don't like having different SPS/PPS like that.

I don't see a valid reason to start parsing for SPS/PPS change inband if the metadata indicates that the container provide them out of band. But it wouldn't be a hard thing to do..

:k17e, up to you if you think we should fix this or not
Flags: needinfo?(jyavenard) → needinfo?(ajones)
(In reply to Jean-Yves Avenard [:jya] from comment #32)
> :k17e, up to you if you think we should fix this or not

Works on Edge and Chrome. We should ideally play it but report an error to the console.
Flags: needinfo?(ajones)
Assignee

Updated

2 years ago
Assignee: alwu → jyavenard
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 38

2 years ago
mozreview-review
Comment on attachment 8873164 [details]
Bug 1313398: P1. Fix indent.

https://reviewboard.mozilla.org/r/144626/#review148540
Attachment #8873164 - Flags: review?(gsquelart) → review+

Comment 39

2 years ago
mozreview-review
Comment on attachment 8873165 [details]
Bug 1313398: P2. Always check for SPS/PPS inband.

https://reviewboard.mozilla.org/r/144628/#review148542
Attachment #8873165 - Flags: review?(gsquelart) → review+

Comment 40

2 years ago
mozreview-review
Comment on attachment 8873166 [details]
Bug 1313398: P3. Don't always check if the decoder supports being recycled.

https://reviewboard.mozilla.org/r/144630/#review148544
Attachment #8873166 - Flags: review?(gsquelart) → review+
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 43

2 years ago
mozreview-review
Comment on attachment 8873166 [details]
Bug 1313398: P3. Don't always check if the decoder supports being recycled.

https://reviewboard.mozilla.org/r/144630/#review148548

Comment 44

2 years ago
mozreview-review
Comment on attachment 8873167 [details]
Bug 1313398: P4. Check that the out of band extradata hasn't changed.

https://reviewboard.mozilla.org/r/144632/#review148550

r+ with comments fixes:

::: commit-message-ca7df:3
(Diff revision 2)
> +Bug 1313398: P4. Check that the out of band extradata hasn't changed. r?gerald
> +
> +On androi, where decoders can sometimes be recycled, the h264converter can be fed over its lifetime MediaRawData with different mExtraData.

"androi" -> "Android"

::: dom/media/platforms/wrappers/H264Converter.cpp:339
(Diff revision 2)
>    RefPtr<MediaByteBuffer> extra_data =
>      mp4_demuxer::AnnexB::ExtractExtraData(aSample);
> -  if (!mp4_demuxer::AnnexB::HasSPS(extra_data)
> -      || mp4_demuxer::AnnexB::CompareExtraData(extra_data,
> +  if (!mp4_demuxer::AnnexB::HasSPS(extra_data)) {
> +    MOZ_ASSERT(mCanRecycleDecoder.isSome());
> +    if (!*mCanRecycleDecoder) {
> +      // Should the decoder can't be recycled, the out of band extradata will

"Should" -> "If", OR "can't" -> "be unable to"

::: dom/media/platforms/wrappers/H264Converter.cpp:339
(Diff revision 2)
> +      // Should the decoder can't be recycled, the out of band extradata will
> +      // change as instead the H264Converter will be recreated. So there's no

I don't understand this sentence, especially with the word 'instead' in there. Please rephrase/clarify.

::: dom/media/platforms/wrappers/H264Converter.cpp:341
(Diff revision 2)
> -  if (!mp4_demuxer::AnnexB::HasSPS(extra_data)
> -      || mp4_demuxer::AnnexB::CompareExtraData(extra_data,
> +  if (!mp4_demuxer::AnnexB::HasSPS(extra_data)) {
> +    MOZ_ASSERT(mCanRecycleDecoder.isSome());
> +    if (!*mCanRecycleDecoder) {
> +      // Should the decoder can't be recycled, the out of band extradata will
> +      // change as instead the H264Converter will be recreated. So there's no
> +      // point it testing for changes.

"it" -> "in"
Attachment #8873167 - Flags: review?(gsquelart) → review+
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 50

2 years ago
mozreview-review
Comment on attachment 8873375 [details]
Bug 1313398: P5. Do not parse encrypted data.

https://reviewboard.mozilla.org/r/144816/#review148738
Attachment #8873375 - Flags: review?(gsquelart) → review+

Comment 51

2 years ago
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/45edd8ee9c43
P1. Fix indent. r=gerald
https://hg.mozilla.org/integration/autoland/rev/18c7e0ab5220
P2. Always check for SPS/PPS inband. r=gerald
https://hg.mozilla.org/integration/autoland/rev/fb7c6768faf5
P3. Don't always check if the decoder supports being recycled. r=gerald
https://hg.mozilla.org/integration/autoland/rev/66daa8f31b54
P4. Check that the out of band extradata hasn't changed. r=gerald
https://hg.mozilla.org/integration/autoland/rev/d0fea6559ec2
P5. Do not parse encrypted data. r=gerald
Assignee

Updated

2 years ago
Depends on: 1370164
Assignee

Updated

2 years ago
Depends on: 1370487
Depends on: 1372766
Flags: qe-verify+
I reproduced this issue using Fx 52.0a1(2016-10-27), on Windows 7 x32.
I can confirm this issue is fixed, I verified using Fx 55.0b2, on Windows 7 x32 and Windows 10 x64.

Cheers!
Status: RESOLVED → VERIFIED
Flags: qe-verify+
Assignee

Updated

2 years ago
Blocks: 1374774
Assignee

Updated

2 years ago
Depends on: 1378507
You need to log in before you can comment on or make changes to this bug.