SlideShare a Scribd company logo
1 of 20
Download to read offline
Frame accurate video client
in the browser
By Jordi Cenzano
Nov 2016
Apr 2017
Motivation
● 2011: Build a NRCS for 35 journalists
○ Peak 45 people on special events (elections), 8 people on weekends
○ Based on Barcelona, offices in Madrid, but contributions from everywhere
○ Cheap, reliable, easy to support, etc
Motivation
● 2017: we have available:
○ Cloud CMS
○ Cloud Video edition APIs
○ Cloud storage
○ Reliable, powerful, and more affordable internet links
○ Video editor player? Broadcast UX?
Spoiler alert!
● VOD demo, check it out!
○ https://jordicenzano.github.io/frame-accurate-scrubbing/
Introduction - design goals
● Accuracy is our main concern
● Full control & feedback about displayed video / audio frame
● Use common browser technologies: Javascript / HTML5
● Assumptions (just trimming player):
○ BW is NOT 1st concern (few users, good connections)
○ Maximise image quality is NOT a concern
○ Full mobile device compatibility not a concern
● Market research:
○ Vimond IO (IBC 09/2016)
○ Grabyo (tested 03/2016)
○ Volicon (tested 03/2016)
○ Accurate player
How it works for VOD? JUST A P.O.C.
VOD Backend process
● Extracts media information (fps, length, audio fs, etc)
● Extracts time code (SMPTE timecode) information
● Detects scene changes, and add it as cue point information
● Extract AV initial delay, to compensate it later
● Ready to extract other timed metadata (Cue points)
● For video
○ Decodes video and encodes each frame using JPEG (quality as a parameter)
● For audio
○ Decodes audio and encodes each portion as PCM (video frame aligned) with sample accuracy
● Generate a JSON manifest with all the information
Backend: step by step
● Extract media information: ffprobe
"streams": [{
"index": 0,
"codec_type": "video",
"r_frame_rate": "30/1",
"nb_frames": "781",
"start_time": "0.000000",
...
"tags": {
"timecode": "01:00:00:00"
...
}
}
{
"codec_name": "aac",
"codec_type": "audio",
"sample_rate": "44100",
"channels": 2,
"channel_layout": "stereo",
"start_time": "0.000000",
...
"tags": {
"timecode": "01:00:00:00"
..
}
}, {
..
}]
Backend: step by step
● Transcode video to single frame files: ffmpeg
Backend: step by step
● Decode audio to PCM (wav): ffmpeg
● Create one PCM audio “frame” per video file: Our own lib
● Compensate A/V delay at the beginning and end of stream: Our own lib
Current constraint:
Audio fs multiple of fps
ex: 44.1Khz / 30fps =
1470 asamples/vframe
Backend: step by step
● Detect scene changes: ffmpeg (+video filter)
...
[Parsed_showinfo_1 @ 0x7febc6600700] n: 0 pts: 251904 pts_time:16.4
pos: 4594281 fmt:rgb24 sar:1/1 s:1280x720 i:P iskey:1 type:I
checksum:D1C91F26 plane_checksum:[D1C91F26] mean:[119 ] stdev:[69.3 ]
...
Backend: The manifest (.json)
"video": {
"num_frames": 781,
"base_frame_path": "./a1/854x480/video",
"base_file_name": "test1v_q14_",
"num_digits_frame": 5,
"frame_ext": ".jpg",
"fps": 30
},
"audio": {
"num_frames": 781,
"base_frame_path": "./a1/854x480/audio",
"base_file_name": "test1a_",
"num_digits_frame": 5,
"frame_ext": ".wav",
"sample_rate": 44100,
"channels": 2,
"bit_per_sample": 16,
"sample_type": "signed"
},
"metadata": {
"0": { "smpte_tc": 108000 },
"204": {
"smpte_tc": 108204,
"cue_info": {
"info": "scene
change",
"mean": "152",
"stddev": "72.2"
}
},
…
}
Frontend process: Pure javascript (NO MSE)
● Fetch the manifest
● Fetch all video frames files in the manifest (&)
○ Download & store then in a Image() matrixV[0..NFrames]
● Fetch all the audio files in the manifest (&)
○ Store them as a byte object matrixA[0..NFrames] (Uses XMLHttpRequest with arraybuffer)
● Wait for user events (pos, play, rev, +/-1 frame, etc):
○ Position X
■ Show video frame X and metadata
■ Create audio context (if not created), write all frame samples into buffer and play it.
○ Playback
■ For Video: Show video frame X+1 every 1/fps (SetInterval function)
■ Create audio context (if not created), write the samples for Ys into a buffer, and play it.
Now yes, the demo (VOD)!
● Check it out!
○ https://jordicenzano.github.io/frame-accurate-scrubbing/
Live player (initial approach)
Now the live demo!
Pros and Cons (as a trimming tool)
● Accuracy
● Responsivity
● Cloud: accessed from everywhere, easy support & upgrade
● Run (almost) everywhere: HTML5 + Javascript
● Broadcast friendly (uses TC, easy to integrate Broadcast workflows)
● Requires more BW than regular playback (x3...x5)
● Probable audio clicks every anchor point (20s). Not designed for long
playback.
● Current limitations:
○ Audio fs must much player device (most common = 44.1Khz)
○ Audio fs multiple of fps
Future work
● Accept any audio sample frequency
● Implement live ingest approach
● Add intelligence to download algorithm:
○ Download all the audio and for the video just a the range that surround the cursor
○ Using ABR, download the lowest quality. And improve quality arround the cursor
● Test JPG2000 instead of JPG (½ BW savings?)
● Compensate video speed in long playbacks (avoid long term A/V drift)
● Try to use WebWorkers to download (and/or process) audio
● Implement multiple speeds (super easy)
● Implement multiple qualities (ABR approach)
Q&A
Thanks!
jcenzano@brightcove.com
@jordicenzano
www.linkedin.com/in/jordicenzano
jordicenzano
https://jordicenzano.github.io/frame-accurate-scrubbing/

More Related Content

Similar to Frame accurate video client in the browser

A Japanese Way to Maintain Constant Quality on Streaming Chaotically Supplied...
A Japanese Way to Maintain Constant Quality on Streaming Chaotically Supplied...A Japanese Way to Maintain Constant Quality on Streaming Chaotically Supplied...
A Japanese Way to Maintain Constant Quality on Streaming Chaotically Supplied...Yusuke Goto
 
HTML5 Multimedia Accessibility
HTML5 Multimedia AccessibilityHTML5 Multimedia Accessibility
HTML5 Multimedia Accessibilitybrucelawson
 
Web player
Web playerWeb player
Web playerMir Ali
 
Industrial Technology Multimedia Video Theory Prelim Course
Industrial Technology Multimedia Video Theory Prelim CourseIndustrial Technology Multimedia Video Theory Prelim Course
Industrial Technology Multimedia Video Theory Prelim Coursejliang2145
 
ORTC SVC SimulCast
ORTC SVC SimulCastORTC SVC SimulCast
ORTC SVC SimulCastJxck Jxck
 
Taipei Video Tech #5 talk : A Japanese Way to Maintain Constant Quality on St...
Taipei Video Tech #5 talk : A Japanese Way to Maintain Constant Quality on St...Taipei Video Tech #5 talk : A Japanese Way to Maintain Constant Quality on St...
Taipei Video Tech #5 talk : A Japanese Way to Maintain Constant Quality on St...Yusuke Goto
 
Intro to Compression: Audio and Video Optimization for Learning
Intro to Compression: Audio and Video Optimization for LearningIntro to Compression: Audio and Video Optimization for Learning
Intro to Compression: Audio and Video Optimization for LearningNick Floro
 
An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...
An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...
An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...Tanya Vernitsky
 
An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...
An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...
An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...Bitmovin Inc
 
4 camera cctv quotation bangladesh
4 camera cctv quotation bangladesh4 camera cctv quotation bangladesh
4 camera cctv quotation bangladeshJamField Solution
 
4 camera cctv quotation www.unicodebd.com
4 camera cctv quotation www.unicodebd.com4 camera cctv quotation www.unicodebd.com
4 camera cctv quotation www.unicodebd.comJamField Solution
 
Castle Game Engine and the joy of making and using a custom game engine
Castle Game Engine and the joy  of making and using a custom game engineCastle Game Engine and the joy  of making and using a custom game engine
Castle Game Engine and the joy of making and using a custom game engineMichalis Kamburelis
 
Materi Editing Foto & Video Basic sampai Medium
Materi Editing Foto & Video  Basic sampai MediumMateri Editing Foto & Video  Basic sampai Medium
Materi Editing Foto & Video Basic sampai MediumAJISUSILO5
 
Distributed high-quality image manipulation and review in a virtual collabora...
Distributed high-quality image manipulation and review in a virtual collabora...Distributed high-quality image manipulation and review in a virtual collabora...
Distributed high-quality image manipulation and review in a virtual collabora...ETCenter
 
Encoding Video for the Web - Webinar from ReelSEO.com
Encoding Video for the Web  - Webinar from ReelSEO.comEncoding Video for the Web  - Webinar from ReelSEO.com
Encoding Video for the Web - Webinar from ReelSEO.comMark Robertson ⏩
 

Similar to Frame accurate video client in the browser (20)

A Japanese Way to Maintain Constant Quality on Streaming Chaotically Supplied...
A Japanese Way to Maintain Constant Quality on Streaming Chaotically Supplied...A Japanese Way to Maintain Constant Quality on Streaming Chaotically Supplied...
A Japanese Way to Maintain Constant Quality on Streaming Chaotically Supplied...
 
HTML5 Multimedia Accessibility
HTML5 Multimedia AccessibilityHTML5 Multimedia Accessibility
HTML5 Multimedia Accessibility
 
Web player
Web playerWeb player
Web player
 
Industrial Technology Multimedia Video Theory Prelim Course
Industrial Technology Multimedia Video Theory Prelim CourseIndustrial Technology Multimedia Video Theory Prelim Course
Industrial Technology Multimedia Video Theory Prelim Course
 
ORTC SVC SimulCast
ORTC SVC SimulCastORTC SVC SimulCast
ORTC SVC SimulCast
 
What’s new in MPEG?
What’s new in MPEG?What’s new in MPEG?
What’s new in MPEG?
 
Taipei Video Tech #5 talk : A Japanese Way to Maintain Constant Quality on St...
Taipei Video Tech #5 talk : A Japanese Way to Maintain Constant Quality on St...Taipei Video Tech #5 talk : A Japanese Way to Maintain Constant Quality on St...
Taipei Video Tech #5 talk : A Japanese Way to Maintain Constant Quality on St...
 
Intro to Compression: Audio and Video Optimization for Learning
Intro to Compression: Audio and Video Optimization for LearningIntro to Compression: Audio and Video Optimization for Learning
Intro to Compression: Audio and Video Optimization for Learning
 
An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...
An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...
An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...
 
An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...
An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...
An Introduction to AV1 - The Next-Gen Royalty-Free Codec From the Alliance fo...
 
4 camera cctv quotation bangladesh
4 camera cctv quotation bangladesh4 camera cctv quotation bangladesh
4 camera cctv quotation bangladesh
 
4 camera cctv quotation www.unicodebd.com
4 camera cctv quotation www.unicodebd.com4 camera cctv quotation www.unicodebd.com
4 camera cctv quotation www.unicodebd.com
 
Castle Game Engine and the joy of making and using a custom game engine
Castle Game Engine and the joy  of making and using a custom game engineCastle Game Engine and the joy  of making and using a custom game engine
Castle Game Engine and the joy of making and using a custom game engine
 
Materi Editing Foto & Video Basic sampai Medium
Materi Editing Foto & Video  Basic sampai MediumMateri Editing Foto & Video  Basic sampai Medium
Materi Editing Foto & Video Basic sampai Medium
 
Video editing
Video editingVideo editing
Video editing
 
Dcp
DcpDcp
Dcp
 
Multi Streaming Player
Multi Streaming PlayerMulti Streaming Player
Multi Streaming Player
 
Distributed high-quality image manipulation and review in a virtual collabora...
Distributed high-quality image manipulation and review in a virtual collabora...Distributed high-quality image manipulation and review in a virtual collabora...
Distributed high-quality image manipulation and review in a virtual collabora...
 
Encoding Video for the Web - Webinar from ReelSEO.com
Encoding Video for the Web  - Webinar from ReelSEO.comEncoding Video for the Web  - Webinar from ReelSEO.com
Encoding Video for the Web - Webinar from ReelSEO.com
 
JS Days Mobile Meow
JS Days Mobile MeowJS Days Mobile Meow
JS Days Mobile Meow
 

Recently uploaded

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 

Recently uploaded (20)

Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 

Frame accurate video client in the browser

  • 1. Frame accurate video client in the browser By Jordi Cenzano Nov 2016 Apr 2017
  • 2. Motivation ● 2011: Build a NRCS for 35 journalists ○ Peak 45 people on special events (elections), 8 people on weekends ○ Based on Barcelona, offices in Madrid, but contributions from everywhere ○ Cheap, reliable, easy to support, etc
  • 3. Motivation ● 2017: we have available: ○ Cloud CMS ○ Cloud Video edition APIs ○ Cloud storage ○ Reliable, powerful, and more affordable internet links ○ Video editor player? Broadcast UX?
  • 4. Spoiler alert! ● VOD demo, check it out! ○ https://jordicenzano.github.io/frame-accurate-scrubbing/
  • 5. Introduction - design goals ● Accuracy is our main concern ● Full control & feedback about displayed video / audio frame ● Use common browser technologies: Javascript / HTML5 ● Assumptions (just trimming player): ○ BW is NOT 1st concern (few users, good connections) ○ Maximise image quality is NOT a concern ○ Full mobile device compatibility not a concern ● Market research: ○ Vimond IO (IBC 09/2016) ○ Grabyo (tested 03/2016) ○ Volicon (tested 03/2016) ○ Accurate player
  • 6. How it works for VOD? JUST A P.O.C.
  • 7. VOD Backend process ● Extracts media information (fps, length, audio fs, etc) ● Extracts time code (SMPTE timecode) information ● Detects scene changes, and add it as cue point information ● Extract AV initial delay, to compensate it later ● Ready to extract other timed metadata (Cue points) ● For video ○ Decodes video and encodes each frame using JPEG (quality as a parameter) ● For audio ○ Decodes audio and encodes each portion as PCM (video frame aligned) with sample accuracy ● Generate a JSON manifest with all the information
  • 8. Backend: step by step ● Extract media information: ffprobe "streams": [{ "index": 0, "codec_type": "video", "r_frame_rate": "30/1", "nb_frames": "781", "start_time": "0.000000", ... "tags": { "timecode": "01:00:00:00" ... } } { "codec_name": "aac", "codec_type": "audio", "sample_rate": "44100", "channels": 2, "channel_layout": "stereo", "start_time": "0.000000", ... "tags": { "timecode": "01:00:00:00" .. } }, { .. }]
  • 9. Backend: step by step ● Transcode video to single frame files: ffmpeg
  • 10. Backend: step by step ● Decode audio to PCM (wav): ffmpeg ● Create one PCM audio “frame” per video file: Our own lib ● Compensate A/V delay at the beginning and end of stream: Our own lib Current constraint: Audio fs multiple of fps ex: 44.1Khz / 30fps = 1470 asamples/vframe
  • 11. Backend: step by step ● Detect scene changes: ffmpeg (+video filter) ... [Parsed_showinfo_1 @ 0x7febc6600700] n: 0 pts: 251904 pts_time:16.4 pos: 4594281 fmt:rgb24 sar:1/1 s:1280x720 i:P iskey:1 type:I checksum:D1C91F26 plane_checksum:[D1C91F26] mean:[119 ] stdev:[69.3 ] ...
  • 12. Backend: The manifest (.json) "video": { "num_frames": 781, "base_frame_path": "./a1/854x480/video", "base_file_name": "test1v_q14_", "num_digits_frame": 5, "frame_ext": ".jpg", "fps": 30 }, "audio": { "num_frames": 781, "base_frame_path": "./a1/854x480/audio", "base_file_name": "test1a_", "num_digits_frame": 5, "frame_ext": ".wav", "sample_rate": 44100, "channels": 2, "bit_per_sample": 16, "sample_type": "signed" }, "metadata": { "0": { "smpte_tc": 108000 }, "204": { "smpte_tc": 108204, "cue_info": { "info": "scene change", "mean": "152", "stddev": "72.2" } }, … }
  • 13. Frontend process: Pure javascript (NO MSE) ● Fetch the manifest ● Fetch all video frames files in the manifest (&) ○ Download & store then in a Image() matrixV[0..NFrames] ● Fetch all the audio files in the manifest (&) ○ Store them as a byte object matrixA[0..NFrames] (Uses XMLHttpRequest with arraybuffer) ● Wait for user events (pos, play, rev, +/-1 frame, etc): ○ Position X ■ Show video frame X and metadata ■ Create audio context (if not created), write all frame samples into buffer and play it. ○ Playback ■ For Video: Show video frame X+1 every 1/fps (SetInterval function) ■ Create audio context (if not created), write the samples for Ys into a buffer, and play it.
  • 14. Now yes, the demo (VOD)! ● Check it out! ○ https://jordicenzano.github.io/frame-accurate-scrubbing/
  • 15. Live player (initial approach)
  • 16. Now the live demo!
  • 17. Pros and Cons (as a trimming tool) ● Accuracy ● Responsivity ● Cloud: accessed from everywhere, easy support & upgrade ● Run (almost) everywhere: HTML5 + Javascript ● Broadcast friendly (uses TC, easy to integrate Broadcast workflows) ● Requires more BW than regular playback (x3...x5) ● Probable audio clicks every anchor point (20s). Not designed for long playback. ● Current limitations: ○ Audio fs must much player device (most common = 44.1Khz) ○ Audio fs multiple of fps
  • 18. Future work ● Accept any audio sample frequency ● Implement live ingest approach ● Add intelligence to download algorithm: ○ Download all the audio and for the video just a the range that surround the cursor ○ Using ABR, download the lowest quality. And improve quality arround the cursor ● Test JPG2000 instead of JPG (½ BW savings?) ● Compensate video speed in long playbacks (avoid long term A/V drift) ● Try to use WebWorkers to download (and/or process) audio ● Implement multiple speeds (super easy) ● Implement multiple qualities (ABR approach)
  • 19. Q&A