straight_to_video 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/app/assets/javascripts/straight-to-video.js +5 -4
- data/index.js +4 -3
- data/lib/straight_to_video/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4783067cfef03451a12e35404133f518b5e73fedd306c99e47d02791022300b1
|
|
4
|
+
data.tar.gz: 8cabcf1177d87439fd41ac63be9dc88fddecca8123f7efc70c5a849061096340
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 26e1e12b9fb1cfcfcece442b49fcde59b5e19b429f70914286b59bc9efa8423761f98fccd0992807bdecbf5b50f97584e6e83ccaefd88a761d5cef2c52e8e4a8
|
|
7
|
+
data.tar.gz: 1980a0f482a87965ef98d3287fc2ccdfe51edd3d9127d3f0903c5d0a0336bc9b19d81785a012fb8dfddcf10b444d462af666f28d02c8e11eacafb8b4484da1d9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.11
|
|
4
|
+
|
|
5
|
+
* Work around WebKit labeling the requested first HEVC keyframe as a delta packet.
|
|
6
|
+
* Keep browser-encoded video below the 25 Mbps delivery limit.
|
|
7
|
+
* Accept WebKit's full-range `yuvj420p` output as progressive 4:2:0 video.
|
|
8
|
+
|
|
3
9
|
## 0.0.10
|
|
4
10
|
|
|
5
11
|
- Fix Safari macOS Tahoe bug where native video controls never auto-hide by rewriting the moov atom to match ffmpeg's conventions (zero timestamps, standard handler names, edts/elst, extended esds, btrt, sgpd/sbgp)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// straight-to-video@0.0.
|
|
1
|
+
// straight-to-video@0.0.11 vendored by the straight_to_video gem
|
|
2
2
|
// straight-to-video - https://github.com/searlsco/straight-to-video
|
|
3
3
|
|
|
4
4
|
// ----- External imports -----
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
// ----- Constants -----
|
|
12
12
|
const MAX_LONG_SIDE = 1920
|
|
13
|
+
const TARGET_VIDEO_BITRATE = 12_000_000
|
|
13
14
|
const TARGET_AUDIO_BITRATE = 96_000
|
|
14
15
|
const TARGET_AUDIO_SR = 48_000
|
|
15
16
|
const TARGET_AUDIO_CHANNELS = 2
|
|
@@ -161,11 +162,11 @@ async function optimizeVideo (file, { onProgress } = {}) {
|
|
|
161
162
|
}
|
|
162
163
|
|
|
163
164
|
async function selectVideoEncoderConfig ({ width, height, fps }) {
|
|
164
|
-
const hevc = { codec: 'hvc1.1.4.L123.B0', width, height, framerate: fps, hardwareAcceleration: 'prefer-hardware', hevc: { format: 'hevc' } }
|
|
165
|
+
const hevc = { codec: 'hvc1.1.4.L123.B0', width, height, framerate: fps, bitrate: TARGET_VIDEO_BITRATE, hardwareAcceleration: 'prefer-hardware', hevc: { format: 'hevc' } }
|
|
165
166
|
const supH = await VideoEncoder.isConfigSupported(hevc).catch(() => ({ supported: false }))
|
|
166
167
|
if (supH.supported) return { codecId: 'hevc', config: supH.config }
|
|
167
168
|
|
|
168
|
-
const avc = { codec: 'avc1.64002A', width, height, framerate: fps, hardwareAcceleration: 'prefer-hardware', avc: { format: 'avc' } }
|
|
169
|
+
const avc = { codec: 'avc1.64002A', width, height, framerate: fps, bitrate: TARGET_VIDEO_BITRATE, hardwareAcceleration: 'prefer-hardware', avc: { format: 'avc' } }
|
|
169
170
|
const supA = await VideoEncoder.isConfigSupported(avc)
|
|
170
171
|
return { codecId: 'avc', config: supA.config }
|
|
171
172
|
}
|
|
@@ -685,7 +686,7 @@ async function encodeVideo ({ file, srcMeta, plan, onProgress }) {
|
|
|
685
686
|
const { chunk } = pendingPackets[i]
|
|
686
687
|
const data = new Uint8Array(chunk.byteLength); chunk.copyTo(data)
|
|
687
688
|
const ts = i * step; const dur = step
|
|
688
|
-
const pkt = new EncodedPacket(data, chunk.type === 'key' ? 'key' : 'delta', ts, dur)
|
|
689
|
+
const pkt = new EncodedPacket(data, i === 0 || chunk.type === 'key' ? 'key' : 'delta', ts, dur)
|
|
689
690
|
await videoTrack.add(pkt, { decoderConfig: { codec: usedCfg.codec, codedWidth: targetWidth, codedHeight: targetHeight, description: codecDesc } })
|
|
690
691
|
}
|
|
691
692
|
|
data/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
|
|
10
10
|
// ----- Constants -----
|
|
11
11
|
const MAX_LONG_SIDE = 1920
|
|
12
|
+
const TARGET_VIDEO_BITRATE = 12_000_000
|
|
12
13
|
const TARGET_AUDIO_BITRATE = 96_000
|
|
13
14
|
const TARGET_AUDIO_SR = 48_000
|
|
14
15
|
const TARGET_AUDIO_CHANNELS = 2
|
|
@@ -160,11 +161,11 @@ async function optimizeVideo (file, { onProgress } = {}) {
|
|
|
160
161
|
}
|
|
161
162
|
|
|
162
163
|
async function selectVideoEncoderConfig ({ width, height, fps }) {
|
|
163
|
-
const hevc = { codec: 'hvc1.1.4.L123.B0', width, height, framerate: fps, hardwareAcceleration: 'prefer-hardware', hevc: { format: 'hevc' } }
|
|
164
|
+
const hevc = { codec: 'hvc1.1.4.L123.B0', width, height, framerate: fps, bitrate: TARGET_VIDEO_BITRATE, hardwareAcceleration: 'prefer-hardware', hevc: { format: 'hevc' } }
|
|
164
165
|
const supH = await VideoEncoder.isConfigSupported(hevc).catch(() => ({ supported: false }))
|
|
165
166
|
if (supH.supported) return { codecId: 'hevc', config: supH.config }
|
|
166
167
|
|
|
167
|
-
const avc = { codec: 'avc1.64002A', width, height, framerate: fps, hardwareAcceleration: 'prefer-hardware', avc: { format: 'avc' } }
|
|
168
|
+
const avc = { codec: 'avc1.64002A', width, height, framerate: fps, bitrate: TARGET_VIDEO_BITRATE, hardwareAcceleration: 'prefer-hardware', avc: { format: 'avc' } }
|
|
168
169
|
const supA = await VideoEncoder.isConfigSupported(avc)
|
|
169
170
|
return { codecId: 'avc', config: supA.config }
|
|
170
171
|
}
|
|
@@ -684,7 +685,7 @@ async function encodeVideo ({ file, srcMeta, plan, onProgress }) {
|
|
|
684
685
|
const { chunk } = pendingPackets[i]
|
|
685
686
|
const data = new Uint8Array(chunk.byteLength); chunk.copyTo(data)
|
|
686
687
|
const ts = i * step; const dur = step
|
|
687
|
-
const pkt = new EncodedPacket(data, chunk.type === 'key' ? 'key' : 'delta', ts, dur)
|
|
688
|
+
const pkt = new EncodedPacket(data, i === 0 || chunk.type === 'key' ? 'key' : 'delta', ts, dur)
|
|
688
689
|
await videoTrack.add(pkt, { decoderConfig: { codec: usedCfg.codec, codedWidth: targetWidth, codedHeight: targetHeight, description: codecDesc } })
|
|
689
690
|
}
|
|
690
691
|
|
data/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "straight-to-video",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "straight-to-video",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.11",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"mediabunny": "^1.27.3"
|
data/package.json
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: straight_to_video
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Justin Searls
|
|
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
77
77
|
- !ruby/object:Gem::Version
|
|
78
78
|
version: '0'
|
|
79
79
|
requirements: []
|
|
80
|
-
rubygems_version:
|
|
80
|
+
rubygems_version: 3.6.9
|
|
81
81
|
specification_version: 4
|
|
82
82
|
summary: Browser-based, hardware-accelerated video upload optimization
|
|
83
83
|
test_files: []
|