-
Notifications
You must be signed in to change notification settings - Fork 379
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
[Discussion] Bottleneck of the project #157
Comments
H.264 in MP4 is the closest.
Small frame size, baseline profile.
Doubt it.
In practice, 16x16. Anything lower will be padded and crop signaled to the decoder. Frame duration can be arbitrarily set in the format. But players cache ahead, so I would stick to >= 1 fps.
Think not. But since the purpose here, iirc, is to avert display sleep, I would think the answer depends on the OS, whether it checks for video foreground focus and audio presence..etc Try,
|
Thanks for your support. I'm making a wild guess: ---- [ Quote GyanD @ CE 2023-04-18 07:42:50 UTC: [ Quote (previous): [ Quote (previous): [ Quote MasterInQuestion @ CE 2023-04-18 00:18:28 UTC: [ Quote (previous): ---- A sidenote for using `ffmpeg` to encode: ---- [ Quote MasterInQuestion @ CE 2023-04-18 14:02:44 UTC: [ Quote MasterInQuestion @ CE 2023-04-18 00:18:28 UTC: |
[ Quote MasterInQuestion @ CE 2023-04-18 14:02:44 UTC: See also: [ Quote (previous): References: ---- Test snippet: ---- @boardhead, any idea on the metadata reduction? [[ --- .h264_420_128x96.an.mp4
+++ mathiasbynens/small/Mpeg4.mp4
---- MOV-FileType:Video ----
MajorBrand : MP4 Base Media v1 [IS0 14496-12:2003]
MinorVersion : 0.2.0
CompatibleBrands : isom, iso2, avc1, mp41
---- MOV:Video ----
Free : (Binary data 0 bytes, use -b option to extract)
-MediaDataSize : 696
-MediaDataOffset : 771
-MediaData : (Binary data 696 bytes, use -b option to extract)
+MediaDataSize : 0
+MediaDataOffset : 48
+MediaData : (Binary data 0 bytes, use -b option to extract)
---- MOV-Movie-MovieHeader:Video ----
MovieHeaderVersion : 0
TimeScale : 1000
-Duration : 34 days 18:10:00
+Duration : 0 s
PreferredRate : 1
PreferredVolume : 100.00%
MatrixStructure : 1 0 0 0 1 0 0 0 1
PreviewTime : 0 s
PreviewDuration : 0 s
PosterTime : 0 s
SelectionTime : 0 s
SelectionDuration : 0 s
CurrentTime : 0 s
NextTrackID : 2
---- MOV-Movie-MovieHeader:Time ----
CreateDate : 0000:00:00 00:00:00
ModifyDate : 0000:00:00 00:00:00
----- MOV-Movie-Track-TrackHeader:Video ----
-TrackHeaderVersion : 1
-TrackID : 1
-TrackDuration : 34 days 18:10:00
-TrackLayer : 0
-TrackVolume : 0.00%
-MatrixStructure : 1 0 0 0 1 0 0 0 1
-ImageWidth : 128
-ImageHeight : 96
----- MOV-Movie-Track-TrackHeader:Time ----
-TrackCreateDate : 0000:00:00 00:00:00
-TrackModifyDate : 0000:00:00 00:00:00
----- MOV-Movie-Track-Media-MediaHeader:Video ----
-MediaHeaderVersion : 0
-MediaTimeScale : 1
-MediaDuration : 34 days 18:10:00
-MediaLanguageCode : und
----- MOV-Movie-Track-Media-MediaHeader:Time ----
-MediaCreateDate : 0000:00:00 00:00:00
-MediaModifyDate : 0000:00:00 00:00:00
----- MOV-Movie-Track-Media-Handler:Video ----
-HandlerType : Video Track
----- MOV-Movie-Track-Media-MediaInfo-VideoHeader:Video ----
-GraphicsMode : srcCopy
-OpColor : 0 0 0
----- MOV-Movie-Track-Media-MediaInfo-SampleTable-VideoSampleDesc:Image ----
-CompressorID : avc1
-SourceImageWidth : 128
-SourceImageHeight : 96
-XResolution : 72
-YResolution : 72
-CompressorName : Lavc libx264
-BitDepth : 24
-AVCConfiguration : (Binary data 39 bytes, use -b option to extract)
-PixelAspectRatio : 1:1
----- MOV-Movie-Track-Media-MediaInfo-SampleTable:Video ----
-VideoFrameRate : 0
-SyncSampleTable : (Binary data 12 bytes, use -b option to extract)
-SampleToChunk : (Binary data 20 bytes, use -b option to extract)
-SampleSizes : (Binary data 24 bytes, use -b option to extract)
-ChunkOffset : (Binary data 12 bytes, use -b option to extract)
---- MOV-Movie-UserData-Meta-Handler:Video ----
HandlerType : Metadata
HandlerVendorID : Apple
+---- MOV-Movie-UserData-Meta-ItemList:Audio ----
+Encoder : Lavf57.41.100 ]] [[ --- vp8_420_8x8.an.webm
+++ mathiasbynens/small/webm.webm
---- MKV:Video ----
EBMLVersion : 1
EBMLReadVersion : 1
EBMLMaxIDLength : 4
EBMLMaxSizeLength : 8
DocType : webm
DocTypeVersion : 2
DocTypeReadVersion : 2
-SeekID : (Binary data 4 bytes, use -b option to extract)
-SeekPosition : 161
-SeekID : (Binary data 4 bytes, use -b option to extract)
-SeekPosition : 198
-SeekID : (Binary data 4 bytes, use -b option to extract)
-SeekPosition : 265
-SeekID : (Binary data 4 bytes, use -b option to extract)
-SeekPosition : 351
TimecodeScale : 1 ms
-MuxingApp : Lavf
-WritingApp : Lavf
+MuxingApp : whammy
+WritingApp : whammy
Duration : 1.00 s
TrackNumber : 1
-TrackUID :
-TagTrackUID :
+TagTrackUID : 01
TrackLacing : No
TrackLanguage : und
CodecID : V_VP8
+CodecName : VP8
TrackType : Video
-VideoFrameRate : 1
ImageWidth : 8
ImageHeight : 8
-VideoScanType : Unknown (2)
-Encoder : Lavc libvpx
-Duration : 00:00:01.000000000
TimeCode : 0 s
-CueTime : 0 s
-CueTrack : 1
-CueClusterPosition : 373
-Matroska_0x0070 : . ]] |
== Off-Topic == @GyanD, I also noticed several problems of FFmpeg during the testing. Please help forwarding: |
You are going to have to provide specific info for each of your issues. And this is best done at the bug tracker. |
I'll setup an account when I have the time. |
After some analysis [ https://github.com/richtr/NoSleep.js/issues/68#issuecomment-1510390259 ], the bottleneck (reliability, performance, etc.) of the project appears much originated from the video used to exploit the WakeLock.
.
To address which, the following has to be determined:
|1| What video (both container and stream) format to use, that should best fit the needs?
|1.1| The format should be supported by as many browsers as possible. [ Only Chromium and Firefox, and mostly mobile: need to be considered. ]
|1.2| Ideally, the decoding should consume as little resource as possible. (least possible arithmetic complexity)
|1.3| Would uncompressed formats work? (as the content doesn't really matter)
|1.4| What's the minimum possible image size? And frame rate? (how long can a single frame be stretched (through time metadata manipulation) to last?)
.
|2| Is the presence of audio stream really necessary?
|2.1| If audio must present, would a single frame audio (duration unmatching the video) just suffice?
@GyanD, @boardhead,
Would you mind providing some insights?
=== Reference info ===
NoSleep.js @ 2ebb9011f7849d033e0c9250e49b9e2f09dc6bf6 (CE 2020-12-15 23:58:20 UTC):
[[
>
ffprobe -hide_banner -threads 0 -show_entries "stream=time_base:format=size" -of "flat=h=0" "0.m4v"
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '0.m4v':
Metadata:
major_brand : M4V
minor_version : 512
compatible_brands: isomiso2avc1
encoder : Lavf55.33.100
Duration: 00:00:01.06, start: 0.000000, bitrate: 28 kb/s
Stream #0:0[0x1](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 176x144 [SAR 1:1 DAR 11:9], 8 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 3 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
stream.0.time_base="1/30000"
stream.1.time_base="1/48000"
format.size="3753"
>
ffprobe -hide_banner -threads 0 -show_entries "stream=time_base:format=size" -of "flat=h=0" "0.webm"
Input #0, matroska,webm, from '0.webm':
Metadata:
encoder : Lavf55.33.100
Duration: 00:00:01.05, start: 0.000000, bitrate: 42 kb/s
Stream #0:0: Video: vp8, yuv420p(progressive), 176x144, SAR 1:1 DAR 11:9, 25 fps, 25 tbr, 1k tbn (default)
Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp (default)
stream.0.time_base="1/1000"
stream.1.time_base="1/1000"
format.size="5577"
]]
(same files as @ 7a34e29dc5608193b999ecd1825f421d4a270a64)
.
NoSleep.js @ 7a34e29dc5608193b999ecd1825f421d4a270a64 (CE 2015-04-21 08:11:15 UTC):
[[
>
ffprobe -hide_banner -threads 0 -show_entries "stream=time_base:format=size" -of "flat=h=0" "0.ogv"
Input #0, ogg, from '0.ogv':
Duration: 00:00:01.05, start: 0.000000, bitrate: 60 kb/s
Stream #0:0: Video: theora, yuv444p, 176x144 [SAR 1:1 DAR 11:9], 25 fps, 25 tbr, 25 tbn
Metadata:
encoder : Lavf55.33.100
Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp, 112 kb/s
Metadata:
encoder : Lavf55.33.100
stream.0.time_base="1/25"
stream.1.time_base="1/48000"
format.size="7854"
]]
NoSleep.js @ 4cc289bea129b0351e6290fba9bdb2ad0bd127da (CE 2015-04-23 13:36:54 UTC):
[[
>
ffprobe -hide_banner -threads 0 -show_entries "stream=time_base:format=size" -of "flat=h=0" "1.mp4"
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
creation_time : 1970-01-01T00:00:00.000000Z
encoder : Lavf52.78.3
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0[0x1](und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 8x8 [SAR 1:1 DAR 1:1], 1k tbn (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
vendor_id : [0][0][0][0]
stream.0.time_base="1/1000"
format.size="808"
>
ffprobe -hide_banner -threads 0 -show_entries "stream=time_base:format=size" -of "flat=h=0" "1.webm"
Input #0, matroska,webm, from '1.webm':
Metadata:
encoder : whammy
Duration: 00:00:01.00, start: 0.000000, bitrate: 1 kb/s
Stream #0:0: Video: vp8, yuv420p(progressive), 8x8, SAR 1:1 DAR 1:1, 1k tbr, 1k tbn (default)
stream.0.time_base="1/1000"
format.size="185"
>
ffprobe -hide_banner -threads 0 -show_entries "stream=time_base:format=size" -of "flat=h=0" "1.ogv"
Input #0, ogg, from '1.ogv':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: theora, yuv420p, 8x8 [SAR 1:1 DAR 1:1], 1k tbr, 1k tbn
Metadata:
encoder : Lavf52.78.3
stream.0.time_base="1/1000"
format.size="3402"
]]
The very WebM was added back @ 016580ddd200ff6e7a12f0904c314e3ee2c9bae1 (CE 2018-12-04 07:12:10 UTC); also used by StayAwake.js.
The MP4 may not play normally in the browser.
NoSleep.js @ 83edf7779fa1b4a87b67587da5d8250ca14c40f9 (CE 2017-07-04 00:31:09 UTC):
[[
>
ffprobe -hide_banner -threads 0 -show_entries "stream=time_base:format=size" -of "flat=h=0" "2.mp4"
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':
Metadata:
major_brand : mp42
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 2017-07-03T23:23:11.000000Z
encoder : HandBrake 0.10.2 2015061100
Duration: 00:00:02.04, start: 0.000000, bitrate: 18 kb/s
Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 202x202, 6 kb/s, 30 fps, 30 tbr, 90k tbn (default)
Metadata:
creation_time : 2017-07-03T23:23:11.000000Z
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 2 kb/s (default)
Metadata:
creation_time : 2017-07-03T23:23:11.000000Z
handler_name : Stereo
vendor_id : [0][0][0][0]
stream.0.time_base="1/90000"
stream.1.time_base="1/44100"
format.size="4841"
]]
(also used by StayAwake.js)
mil-no-sleep:
[[
>
ffprobe -hide_banner -threads 0 -show_entries "stream=time_base:format=size" -of "flat=h=0" "mil-no-sleep.mp4"
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'mil-no-sleep.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.42.101
Duration: 00:00:03.00, start: 0.000000, bitrate: 7 kb/s
Stream #0:0[0x1](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 20x20, 5 kb/s, 23.98 fps, 23.98 tbr, 24k tbn (default)
Metadata:
handler_name : L-SMASH Video Handler
vendor_id : [0][0][0][0]
stream.0.time_base="1/24000"
format.size="3000"
]]
(also used by lovelace-wallpanel before)
lovelace-wallpanel @ 69ec1c29531665ca266c279b8e3dd82abb69d94e (CE 2023-03-31 18:11:41 UTC):
[[
>
ffprobe -hide_banner -threads 0 -show_entries "stream=time_base:format=size" -of "flat=h=0" "lovelace-wallpanel.mp4"
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'lovelace-wallpanel.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf59.27.100
Duration: 00:00:10.00, start: 0.000000, bitrate: 1 kb/s
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 8x8 [SAR 1:1 DAR 1:1], 0 kb/s, 1 fps, 1 tbr, 16384 tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
encoder : Lavc59.37.100 libx264
stream.0.time_base="1/16384"
format.size="1838"
]]
The text was updated successfully, but these errors were encountered: