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

zoomed video in Chrome #967

Closed
4 tasks done
Terminus80 opened this issue Feb 7, 2017 · 17 comments
Closed
4 tasks done

zoomed video in Chrome #967

Terminus80 opened this issue Feb 7, 2017 · 17 comments
Milestone

Comments

@Terminus80
Copy link

Environment
  • Link to playable M3U8 file:
  • Hls.js version: 0.6.17
  • Browser name/version: Chrome v 56
  • OS name/version: windows 10
Steps to reproduce

Hi,
i have a stream hls whose resolution dynamically changes.
For example, initially the video resolution is 640x360, but this may change in 1366x768 (inside the same stream).
If the resolution change, the video immage is zoomed.
The video image does not fit the size of the container.
I only see a portion of video ... zoomed
If i refresh the page no problem. the video immage is ok.(not zoomed)
No error in the console.

If I Call the hls.js function: recoverMediaError() the video immage return ok.
This issue occurs only with chrome on windows platform.

Chrome on mac is no Problem.
chrome on android is no Problem.
safari on ios no Problem.
firefox on windows no Problem.

For me, is a native issue of chrome tag video on windows platform.

PLEASE , HELP ME!
zoomed

@kfeinUI
Copy link

kfeinUI commented Feb 7, 2017

Does your playlist signal a discontinuity when the resolution changes? Have you run it through the mediastreamvalidator tool from Apple?

@Terminus80
Copy link
Author

Sorry, i don't have an Apple developer account to use mediastreamvalidator.
The resolution changes at runtime voluntarily(from 640x360 to 1366x768 or from 1366x768 to 640x360).
This hls stream coming from Wowza server.
From resolution 640x360 to 1366x768 i have the issue (video immage zoomed) only with chrome on Windows platform.
From resolution 1366x768 to 640x360 i don't have the issue.
I tried videojs player, and it work fine.
At the changing of the resolution, the video image is zoomed but after 2 seconds the
image is properly adapts.

A question: with hls.js library, can i manipulate the playlist.m3u8 and change the RESOLUTION tag before play video?

@Terminus80
Copy link
Author

mediastreamvalidator log:

Started root playlist download
[chunklist_w914720008.m3u8] Started media playlist download
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch
[chunklist_w914720008.m3u8] All media files delivered, waiting until next playlist fetch


chunklist_w914720008.m3u8

Processed 15 out of 15 segments
Average segment duration: 10.231844
Total segment bitrates (all discontinuities): average: 979.00 kb/s, max: 1125.38 kb/s
Playlist max bitrate: 1125.384000 kb/s
Audio Group ID: AUDIO

Discontinuity: sequence: 0, parsed segment count: 15 of 15, duration: 152.867 sec, average: 979.00 kb/s, max: 1125.38 kb/s
Track ID: 1
Video Codec: avc1
Video profile: Baseline
Video level: 3.0
Video resolution: 640x360
Video average IDR interval: 2.074690, Standard deviation: 0.123212
Video frame rate: 29.280
Track ID: 2
Audio Codec: AAC-LC
Audio sample rate: 8000 Hz
Audio channel layout: Mono


MUST fix issues

Error: Framerate change without discontinuity tag detected
--> Detail: (null)
--> Source: chunklist_w914720008.m3u8 - media_w914720008_335.ts

--> Detail: (null)
--> Source: chunklist_w914720008.m3u8 - media_w914720008_336.ts

--> Detail: (null)
--> Source: chunklist_w914720008.m3u8 - media_w914720008_337.ts

Error: Format change without discontinuity tag detected
--> Detail: (null)
--> Source: chunklist_w914720008.m3u8 - media_w914720008_337.ts

AirdiSalvatore:~ Salvatore$

@kfeinUI
Copy link

kfeinUI commented Feb 8, 2017

The format change error might be the problem. You'd have to calculate if that segment coincides with the timing of your issue.

Those framerate change issues are also worth fixing. hls.js and the browsers really do perform better if you feed them valid input. Some browser are sensitive to those changes.

@Terminus80
Copy link
Author

Framerate and Format, change voluntarily at runtime.
i don't understand why ONLY chrome on windows platform doesn't work.

@Terminus80
Copy link
Author

I modified the file xhr-loader.js in response callback (readystatechange) before success callback. (latest version of hls.js).
I tried to override tag RESOLUTION in playlist.m3u8 file (from RESOLUTION=640x360 to RESOLUTION=1366x768). The videoheight and videowidth in HTML5 source element don't changed (640x360).

Any suggestions??

@Terminus80
Copy link
Author

The Wowza player WORK FINE!

@mangui
Copy link
Member

mangui commented Feb 9, 2017

Hi @Terminus80
stream discontinuities needs to be signalled in the playlist.
RESOLUTION tag in the playlist is just informative, video width and height are extracted from the video NAL unit (SPS NAL unit)

@Terminus80
Copy link
Author

Hi @mangui
I use Wowza Streaming Server.
Wowza doesn't support discontinuity tag( EXT-X-DISCONTINUITY).
hls.js can intercept the resolution change?
You wrote: "video width and height are extracted from the video NAL unit (SPS NAL unit)".

thanks.

@Terminus80
Copy link
Author

Hi @mangui,
hls.js can intercept changes in NAL units and trigger a callback or error callback?
In videojs(for hls), wowza player, JWplayer , Flowplayer and VLC, resolve this issue automatically, i think these players notice this change at runtime.
Please help me.
I love hls.js.

@mangui
Copy link
Member

mangui commented Feb 22, 2017

Hi @Terminus80 HLS spec is pretty clear on discontinuities
https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-4.3.2.3
changes in encoding parameters should be preceded by a DISCONTINUITY tag.
It would be weird if Wowza does not support that ?

regarding the zoom issue, even if your stream does not signal the discontinuity, I am pretty sure it is just a matter of detecting video width and video height change and resizing. have you tried manually resizing the video from JS debug console ?

@Terminus80
Copy link
Author

Hi @mangui
I will contact the support of Wowza for the discontnuity tag management.
Regarding the zoom issue, I tried several times to detect changing in video element and manually resizing, but to no avail.
This issue is present with Chrome on Windows platform. Chrome on MacOS or android work fine.
I do not understand why the player Wowza and videojs automatically solve the zoom effect.
That is why I asked you the callback at change the resolution to perform a recoverMediaError() (how workaround).

Thanks.

@mangui
Copy link
Member

mangui commented Feb 22, 2017

Could u first ensure that it works as expected with a discontinuity tag ? Just to understand what is missing. Also could u dump chrome://media-internals content, to check whether chrome uses hardware or software video decoder.

@Terminus80
Copy link
Author

Follow the dumps before and after zoom.

In media-internals-WithZOOM.txt there are this messages after change resolution:

{
"time": 226941.94800001383,
"key": "error",
"value": " Large timestamp gap detected; may cause AV sync to drift. time:207232000us expected:260864000us delta:-53632000us"
},

these messages still show up even back to the original resolution.

media-internals-beforeZoom.txt
media-internals-WithZOOM.txt

@Terminus80
Copy link
Author

I redid the test and this time there are no errors after zooming.
media-internalsZoomNew.txt

@mangui
Copy link
Member

mangui commented Feb 28, 2017

as you said there are lots of timestamp gap detected after your resolution change.
this means that not only you are changing resolution but also PTS/DTS.
the only way to support this is to follow the spec and insert a discontinuity tag. or use another player

@stale
Copy link

stale bot commented Jun 16, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

4 participants