b73a7248 by David LaPalomento

Create a page to compare transmux outputs

When debugging transmux issues, it can be handy to be able to easily compare the result of the javascript segment parser with the working output from a tool like ffmpeg. Put together a test page to display the hex dump of segment-parser output side-by-side with a working example. Fixed the hex dump utility to produce more than one line of output per tag.
1 parent 7fbc62b9
...@@ -14,13 +14,15 @@ ...@@ -14,13 +14,15 @@
14 } 14 }
15 return '.'; 15 return '.';
16 }, 16 },
17 result = '',
17 hex, 18 hex,
18 ascii; 19 ascii;
19 for (var j = 0; j < bytes.length / step; j++) { 20 for (var j = 0; j < bytes.length / step; j++) {
20 hex = bytes.slice(j * step, j * step + step).map(formatHexString).join(' '); 21 hex = bytes.slice(j * step, j * step + step).map(formatHexString).join(' ');
21 ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString).join(''); 22 ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString).join('');
22 return hex + ' ' + ascii; 23 result += hex + ' ' + ascii + '\n';
23 } 24 }
25 return result;
24 }, 26 },
25 tagDump: function(tag) { 27 tagDump: function(tag) {
26 return module.hexDump(tag.bytes); 28 return module.hexDump(tag.bytes);
......
1 (function(window) { 1 (function(window) {
2 2
3 if (!window.videojs) {
4 window.videojs = {};
5 }
6 if (!window.videojs.hls) {
7 window.videojs.hls = {};
8 }
9
3 var 10 var
4 hls = window.videojs.hls, 11 hls = window.videojs.hls,
5 12
......
1 /* ==========================================================================
2 HTML5 Boilerplate styles - h5bp.com (generated via initializr.com)
3 ========================================================================== */
4
5 html,
6 button,
7 input,
8 select,
9 textarea {
10 color: #222;
11 }
12
13 body {
14 font-size: 1em;
15 line-height: 1.4;
16 }
17
18 ::-moz-selection {
19 background: #b3d4fc;
20 text-shadow: none;
21 }
22
23 ::selection {
24 background: #b3d4fc;
25 text-shadow: none;
26 }
27
28 hr {
29 display: block;
30 height: 1px;
31 border: 0;
32 border-top: 1px solid #ccc;
33 margin: 1em 0;
34 padding: 0;
35 }
36
37 img {
38 vertical-align: middle;
39 }
40
41 fieldset {
42 border: 0;
43 margin: 0;
44 padding: 0;
45 }
46
47 textarea {
48 resize: vertical;
49 }
50
51 .chromeframe {
52 margin: 0.2em 0;
53 background: #ccc;
54 color: #000;
55 padding: 0.2em 0;
56 }
57
58
59 /* ===== Initializr Styles ==================================================
60 Author: Jonathan Verrecchia - verekia.com/initializr/responsive-template
61 ========================================================================== */
62
63 body {
64 font: 16px/26px Helvetica, Helvetica Neue, Arial;
65 }
66
67 .wrapper {
68 width: 90%;
69 margin: 0 5%;
70 }
71
72 /* ===================
73 ALL: Orange Theme
74 =================== */
75
76 .header-container {
77 border-bottom: 20px solid #e44d26;
78 }
79
80 .footer-container,
81 .main aside {
82 border-top: 20px solid #e44d26;
83 }
84
85 .header-container,
86 .footer-container,
87 .main aside {
88 background: #f16529;
89 }
90
91 .title {
92 color: white;
93 }
94
95 /* ==============
96 MOBILE: Menu
97 ============== */
98
99 nav ul {
100 margin: 0;
101 padding: 0;
102 }
103
104 nav a {
105 display: block;
106 margin-bottom: 10px;
107 padding: 15px 0;
108
109 text-align: center;
110 text-decoration: none;
111 font-weight: bold;
112
113 color: white;
114 background: #e44d26;
115 }
116
117 nav a:hover,
118 nav a:visited {
119 color: white;
120 }
121
122 nav a:hover {
123 text-decoration: underline;
124 }
125
126 /* ==============
127 MOBILE: Main
128 ============== */
129
130 .main {
131 padding: 30px 0;
132 }
133
134 .main article h1 {
135 font-size: 2em;
136 }
137
138 .main aside {
139 color: white;
140 padding: 0px 5% 10px;
141 }
142
143 .footer-container footer {
144 color: white;
145 padding: 20px 0;
146 }
147
148 /* ===============
149 ALL: IE Fixes
150 =============== */
151
152 .ie7 .title {
153 padding-top: 20px;
154 }
155
156 /* ==========================================================================
157 Author's custom styles
158 ========================================================================== */
159
160 form label {
161 display: block;
162 }
163
164 .result-wrapper {
165 float: left;
166 margin: 10px 0;
167 min-width: 422px;
168 width: 50%;
169 }
170
171 .result {
172 border: thin solid #aaa;
173 border-radius: 5px;
174 font-size: 10px;
175 line-height: 15px;
176 margin: 0 5px;
177 padding: 0 10px;
178 }
179
180 /* ==========================================================================
181 Media Queries
182 ========================================================================== */
183
184 @media only screen and (min-width: 480px) {
185
186 /* ====================
187 INTERMEDIATE: Menu
188 ==================== */
189
190 nav a {
191 float: left;
192 width: 27%;
193 margin: 0 1.7%;
194 padding: 25px 2%;
195 margin-bottom: 0;
196 }
197
198 nav li:first-child a {
199 margin-left: 0;
200 }
201
202 nav li:last-child a {
203 margin-right: 0;
204 }
205
206 /* ========================
207 INTERMEDIATE: IE Fixes
208 ======================== */
209
210 nav ul li {
211 display: inline;
212 }
213
214 .oldie nav a {
215 margin: 0 0.7%;
216 }
217 }
218
219 @media only screen and (min-width: 768px) {
220
221 /* ====================
222 WIDE: CSS3 Effects
223 ==================== */
224
225 .header-container,
226 .main aside {
227 -webkit-box-shadow: 0 5px 10px #aaa;
228 -moz-box-shadow: 0 5px 10px #aaa;
229 box-shadow: 0 5px 10px #aaa;
230 }
231
232 /* ============
233 WIDE: Menu
234 ============ */
235
236 .title {
237 float: left;
238 }
239
240 nav {
241 float: right;
242 width: 38%;
243 }
244
245 /* ============
246 WIDE: Main
247 ============ */
248
249 .main article {
250 float: left;
251 width: 100%;
252 }
253 }
254
255 @media only screen and (min-width: 1140px) {
256
257 /* ===============
258 Maximal Width
259 =============== */
260
261 .wrapper {
262 width: 1026px; /* 1140px - 10% for margins */
263 margin: 0 auto;
264 }
265 }
266
267 /* ==========================================================================
268 Helper classes
269 ========================================================================== */
270
271 .ir {
272 background-color: transparent;
273 border: 0;
274 overflow: hidden;
275 *text-indent: -9999px;
276 }
277
278 .ir:before {
279 content: "";
280 display: block;
281 width: 0;
282 height: 150%;
283 }
284
285 .hidden {
286 display: none !important;
287 visibility: hidden;
288 }
289
290 .visuallyhidden {
291 border: 0;
292 clip: rect(0 0 0 0);
293 height: 1px;
294 margin: -1px;
295 overflow: hidden;
296 padding: 0;
297 position: absolute;
298 width: 1px;
299 }
300
301 .visuallyhidden.focusable:active,
302 .visuallyhidden.focusable:focus {
303 clip: auto;
304 height: auto;
305 margin: 0;
306 overflow: visible;
307 position: static;
308 width: auto;
309 }
310
311 .invisible {
312 visibility: hidden;
313 }
314
315 .clearfix:before,
316 .clearfix:after {
317 content: " ";
318 display: table;
319 }
320
321 .clearfix:after {
322 clear: both;
323 }
324
325 .clearfix {
326 *zoom: 1;
327 }
328
329 /* ==========================================================================
330 Print styles
331 ========================================================================== */
332
333 @media print {
334 * {
335 background: transparent !important;
336 color: #000 !important; /* Black prints faster: h5bp.com/s */
337 box-shadow: none !important;
338 text-shadow: none !important;
339 }
340
341 a,
342 a:visited {
343 text-decoration: underline;
344 }
345
346 a[href]:after {
347 content: " (" attr(href) ")";
348 }
349
350 abbr[title]:after {
351 content: " (" attr(title) ")";
352 }
353
354 /*
355 * Don't show links for images, or javascript/internal links
356 */
357
358 .ir a:after,
359 a[href^="javascript:"]:after,
360 a[href^="#"]:after {
361 content: "";
362 }
363
364 pre,
365 blockquote {
366 border: 1px solid #999;
367 page-break-inside: avoid;
368 }
369
370 thead {
371 display: table-header-group; /* h5bp.com/t */
372 }
373
374 tr,
375 img {
376 page-break-inside: avoid;
377 }
378
379 img {
380 max-width: 100% !important;
381 }
382
383 @page {
384 margin: 0.5cm;
385 }
386
387 p,
388 h2,
389 h3 {
390 orphans: 3;
391 widows: 3;
392 }
393
394 h2,
395 h3 {
396 page-break-after: avoid;
397 }
398 }
...\ No newline at end of file ...\ No newline at end of file
1 /*! normalize.css v1.1.2 | MIT License | git.io/normalize */
2
3 /* ==========================================================================
4 HTML5 display definitions
5 ========================================================================== */
6
7 /**
8 * Correct `block` display not defined in IE 6/7/8/9 and Firefox 3.
9 */
10
11 article,
12 aside,
13 details,
14 figcaption,
15 figure,
16 footer,
17 header,
18 hgroup,
19 main,
20 nav,
21 section,
22 summary {
23 display: block;
24 }
25
26 /**
27 * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.
28 */
29
30 audio,
31 canvas,
32 video {
33 display: inline-block;
34 *display: inline;
35 *zoom: 1;
36 }
37
38 /**
39 * Prevent modern browsers from displaying `audio` without controls.
40 * Remove excess height in iOS 5 devices.
41 */
42
43 audio:not([controls]) {
44 display: none;
45 height: 0;
46 }
47
48 /**
49 * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.
50 * Known issue: no IE 6 support.
51 */
52
53 [hidden] {
54 display: none;
55 }
56
57 /* ==========================================================================
58 Base
59 ========================================================================== */
60
61 /**
62 * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using
63 * `em` units.
64 * 2. Prevent iOS text size adjust after orientation change, without disabling
65 * user zoom.
66 */
67
68 html {
69 font-size: 100%; /* 1 */
70 -ms-text-size-adjust: 100%; /* 2 */
71 -webkit-text-size-adjust: 100%; /* 2 */
72 }
73
74 /**
75 * Address `font-family` inconsistency between `textarea` and other form
76 * elements.
77 */
78
79 html,
80 button,
81 input,
82 select,
83 textarea {
84 font-family: sans-serif;
85 }
86
87 /**
88 * Address margins handled incorrectly in IE 6/7.
89 */
90
91 body {
92 margin: 0;
93 }
94
95 /* ==========================================================================
96 Links
97 ========================================================================== */
98
99 /**
100 * Address `outline` inconsistency between Chrome and other browsers.
101 */
102
103 a:focus {
104 outline: thin dotted;
105 }
106
107 /**
108 * Improve readability when focused and also mouse hovered in all browsers.
109 */
110
111 a:active,
112 a:hover {
113 outline: 0;
114 }
115
116 /* ==========================================================================
117 Typography
118 ========================================================================== */
119
120 /**
121 * Address font sizes and margins set differently in IE 6/7.
122 * Address font sizes within `section` and `article` in Firefox 4+, Safari 5,
123 * and Chrome.
124 */
125
126 h1 {
127 font-size: 2em;
128 margin: 0.67em 0;
129 }
130
131 h2 {
132 font-size: 1.5em;
133 margin: 0.83em 0;
134 }
135
136 h3 {
137 font-size: 1.17em;
138 margin: 1em 0;
139 }
140
141 h4 {
142 font-size: 1em;
143 margin: 1.33em 0;
144 }
145
146 h5 {
147 font-size: 0.83em;
148 margin: 1.67em 0;
149 }
150
151 h6 {
152 font-size: 0.67em;
153 margin: 2.33em 0;
154 }
155
156 /**
157 * Address styling not present in IE 7/8/9, Safari 5, and Chrome.
158 */
159
160 abbr[title] {
161 border-bottom: 1px dotted;
162 }
163
164 /**
165 * Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome.
166 */
167
168 b,
169 strong {
170 font-weight: bold;
171 }
172
173 blockquote {
174 margin: 1em 40px;
175 }
176
177 /**
178 * Address styling not present in Safari 5 and Chrome.
179 */
180
181 dfn {
182 font-style: italic;
183 }
184
185 /**
186 * Address differences between Firefox and other browsers.
187 * Known issue: no IE 6/7 normalization.
188 */
189
190 hr {
191 -moz-box-sizing: content-box;
192 box-sizing: content-box;
193 height: 0;
194 }
195
196 /**
197 * Address styling not present in IE 6/7/8/9.
198 */
199
200 mark {
201 background: #ff0;
202 color: #000;
203 }
204
205 /**
206 * Address margins set differently in IE 6/7.
207 */
208
209 p,
210 pre {
211 margin: 1em 0;
212 }
213
214 /**
215 * Correct font family set oddly in IE 6, Safari 4/5, and Chrome.
216 */
217
218 code,
219 kbd,
220 pre,
221 samp {
222 font-family: monospace, serif;
223 _font-family: 'courier new', monospace;
224 font-size: 1em;
225 }
226
227 /**
228 * Improve readability of pre-formatted text in all browsers.
229 */
230
231 pre {
232 white-space: pre;
233 white-space: pre-wrap;
234 word-wrap: break-word;
235 }
236
237 /**
238 * Address CSS quotes not supported in IE 6/7.
239 */
240
241 q {
242 quotes: none;
243 }
244
245 /**
246 * Address `quotes` property not supported in Safari 4.
247 */
248
249 q:before,
250 q:after {
251 content: '';
252 content: none;
253 }
254
255 /**
256 * Address inconsistent and variable font size in all browsers.
257 */
258
259 small {
260 font-size: 80%;
261 }
262
263 /**
264 * Prevent `sub` and `sup` affecting `line-height` in all browsers.
265 */
266
267 sub,
268 sup {
269 font-size: 75%;
270 line-height: 0;
271 position: relative;
272 vertical-align: baseline;
273 }
274
275 sup {
276 top: -0.5em;
277 }
278
279 sub {
280 bottom: -0.25em;
281 }
282
283 /* ==========================================================================
284 Lists
285 ========================================================================== */
286
287 /**
288 * Address margins set differently in IE 6/7.
289 */
290
291 dl,
292 menu,
293 ol,
294 ul {
295 margin: 1em 0;
296 }
297
298 dd {
299 margin: 0 0 0 40px;
300 }
301
302 /**
303 * Address paddings set differently in IE 6/7.
304 */
305
306 menu,
307 ol,
308 ul {
309 padding: 0 0 0 40px;
310 }
311
312 /**
313 * Correct list images handled incorrectly in IE 7.
314 */
315
316 nav ul,
317 nav ol {
318 list-style: none;
319 list-style-image: none;
320 }
321
322 /* ==========================================================================
323 Embedded content
324 ========================================================================== */
325
326 /**
327 * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.
328 * 2. Improve image quality when scaled in IE 7.
329 */
330
331 img {
332 border: 0; /* 1 */
333 -ms-interpolation-mode: bicubic; /* 2 */
334 }
335
336 /**
337 * Correct overflow displayed oddly in IE 9.
338 */
339
340 svg:not(:root) {
341 overflow: hidden;
342 }
343
344 /* ==========================================================================
345 Figures
346 ========================================================================== */
347
348 /**
349 * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11.
350 */
351
352 figure {
353 margin: 0;
354 }
355
356 /* ==========================================================================
357 Forms
358 ========================================================================== */
359
360 /**
361 * Correct margin displayed oddly in IE 6/7.
362 */
363
364 form {
365 margin: 0;
366 }
367
368 /**
369 * Define consistent border, margin, and padding.
370 */
371
372 fieldset {
373 border: 1px solid #c0c0c0;
374 margin: 0 2px;
375 padding: 0.35em 0.625em 0.75em;
376 }
377
378 /**
379 * 1. Correct color not being inherited in IE 6/7/8/9.
380 * 2. Correct text not wrapping in Firefox 3.
381 * 3. Correct alignment displayed oddly in IE 6/7.
382 */
383
384 legend {
385 border: 0; /* 1 */
386 padding: 0;
387 white-space: normal; /* 2 */
388 *margin-left: -7px; /* 3 */
389 }
390
391 /**
392 * 1. Correct font size not being inherited in all browsers.
393 * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,
394 * and Chrome.
395 * 3. Improve appearance and consistency in all browsers.
396 */
397
398 button,
399 input,
400 select,
401 textarea {
402 font-size: 100%; /* 1 */
403 margin: 0; /* 2 */
404 vertical-align: baseline; /* 3 */
405 *vertical-align: middle; /* 3 */
406 }
407
408 /**
409 * Address Firefox 3+ setting `line-height` on `input` using `!important` in
410 * the UA stylesheet.
411 */
412
413 button,
414 input {
415 line-height: normal;
416 }
417
418 /**
419 * Address inconsistent `text-transform` inheritance for `button` and `select`.
420 * All other form control elements do not inherit `text-transform` values.
421 * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.
422 * Correct `select` style inheritance in Firefox 4+ and Opera.
423 */
424
425 button,
426 select {
427 text-transform: none;
428 }
429
430 /**
431 * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
432 * and `video` controls.
433 * 2. Correct inability to style clickable `input` types in iOS.
434 * 3. Improve usability and consistency of cursor style between image-type
435 * `input` and others.
436 * 4. Remove inner spacing in IE 7 without affecting normal text inputs.
437 * Known issue: inner spacing remains in IE 6.
438 */
439
440 button,
441 html input[type="button"], /* 1 */
442 input[type="reset"],
443 input[type="submit"] {
444 -webkit-appearance: button; /* 2 */
445 cursor: pointer; /* 3 */
446 *overflow: visible; /* 4 */
447 }
448
449 /**
450 * Re-set default cursor for disabled elements.
451 */
452
453 button[disabled],
454 html input[disabled] {
455 cursor: default;
456 }
457
458 /**
459 * 1. Address box sizing set to content-box in IE 8/9.
460 * 2. Remove excess padding in IE 8/9.
461 * 3. Remove excess padding in IE 7.
462 * Known issue: excess padding remains in IE 6.
463 */
464
465 input[type="checkbox"],
466 input[type="radio"] {
467 box-sizing: border-box; /* 1 */
468 padding: 0; /* 2 */
469 *height: 13px; /* 3 */
470 *width: 13px; /* 3 */
471 }
472
473 /**
474 * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
475 * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
476 * (include `-moz` to future-proof).
477 */
478
479 input[type="search"] {
480 -webkit-appearance: textfield; /* 1 */
481 -moz-box-sizing: content-box;
482 -webkit-box-sizing: content-box; /* 2 */
483 box-sizing: content-box;
484 }
485
486 /**
487 * Remove inner padding and search cancel button in Safari 5 and Chrome
488 * on OS X.
489 */
490
491 input[type="search"]::-webkit-search-cancel-button,
492 input[type="search"]::-webkit-search-decoration {
493 -webkit-appearance: none;
494 }
495
496 /**
497 * Remove inner padding and border in Firefox 3+.
498 */
499
500 button::-moz-focus-inner,
501 input::-moz-focus-inner {
502 border: 0;
503 padding: 0;
504 }
505
506 /**
507 * 1. Remove default vertical scrollbar in IE 6/7/8/9.
508 * 2. Improve readability and alignment in all browsers.
509 */
510
511 textarea {
512 overflow: auto; /* 1 */
513 vertical-align: top; /* 2 */
514 }
515
516 /* ==========================================================================
517 Tables
518 ========================================================================== */
519
520 /**
521 * Remove most spacing between table cells.
522 */
523
524 table {
525 border-collapse: collapse;
526 border-spacing: 0;
527 }
1 /*! normalize.css v1.1.2 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}html,button,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em;margin:.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:.83em;margin:1.67em 0}h6{font-size:.67em;margin:2.33em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:1em 40px}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}p,pre{margin:1em 0}code,kbd,pre,samp{font-family:monospace,serif;_font-family:'courier new',monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}q{quotes:none}q:before,q:after{content:'';content:none}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}dl,menu,ol,ul{margin:1em 0}dd{margin:0 0 0 40px}menu,ol,ul{padding:0 0 0 40px}nav ul,nav ol{list-style:none;list-style-image:none}img{border:0;-ms-interpolation-mode:bicubic}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0;white-space:normal;*margin-left:-7px}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;*overflow:visible}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*height:13px;*width:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html>
2 <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
3 <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
4 <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
5 <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
6 <head>
7 <meta charset="utf-8">
8 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
9 <title></title>
10 <meta name="description" content="">
11 <meta name="viewport" content="width=device-width">
12
13 <link rel="stylesheet" href="css/normalize.min.css">
14 <link rel="stylesheet" href="css/main.css">
15
16 <script src="js/vendor/modernizr-2.6.2.min.js"></script>
17 </head>
18 <body>
19 <!--[if lt IE 7]>
20 <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
21 <![endif]-->
22
23 <div class="header-container">
24 <header class="wrapper clearfix">
25 <h1 class="title">Transmux Analyzer</h1>
26 </header>
27 </div>
28
29 <div class="main-container">
30 <div class="main wrapper clearfix">
31
32 <article>
33 <header>
34 <p>
35 This page can help you compare the results of the
36 transmuxing performed by videojs-contrib-hls with a known,
37 working file produced by another tool. You could use
38 ffmpeg to transform an MPEG-2 transport stream into an FLV
39 with a command like this:
40 <pre>ffmpeg -i input.ts -acodec copy -vcodec copy output.flv</pre>
41 </p>
42 </header>
43 <section>
44 <h2>Inputs</h2>
45 <form id="inputs">
46 <label>
47 Your original MP2T segment:
48 <input type="file" id="original">
49 </label>
50 <label>
51 A working, FLV version of the underlying stream
52 produced by another tool:
53 <input type="file" id="working">
54 </label>
55 </form>
56 </section>
57 <section>
58 <h2>Results</h2>
59 <div class="result-wrapper">
60 <h3>videojs-contrib-hls</h3>
61 <div class="vjs-hls-output result">
62 <p>
63 The results of transmuxing your input file with
64 videojs-contrib-hls will show up here.
65 </p>
66 </div>
67 </div>
68 <div class="result-wrapper">
69 <h3>Working</h3>
70 <div class="working-output result">
71 <p>
72 The "good" version of the file will show up here.
73 </p>
74 </div>
75 </div>
76 </section>
77 </article>
78
79 </div> <!-- #main -->
80 </div> <!-- #main-container -->
81
82 <div class="footer-container">
83 <footer class="wrapper">
84 <h3>footer</h3>
85 </footer>
86 </div>
87
88
89 <!-- transmuxing -->
90 <script src="../../src/flv-tag.js"></script>
91 <script src="../../src/exp-golomb.js"></script>
92 <script src="../../src/h264-stream.js"></script>
93 <script src="../../src/aac-stream.js"></script>
94 <script src="../../src/segment-parser.js"></script>
95
96 <script src="../../src/bin-utils.js"></script>
97 <script>
98 var inputs = document.getElementById('inputs'),
99 original = document.getElementById('original'),
100 working = document.getElementById('working'),
101 vjsOutput = document.querySelector('.vjs-hls-output'),
102 workingOutput = document.querySelector('.working-output');
103
104 original.addEventListener('change', function() {
105 var reader = new FileReader();
106 reader.addEventListener('loadend', function() {
107 var parser = new videojs.hls.SegmentParser(),
108 tags = [parser.getFlvHeader()],
109 hex,
110 byteLength = 0,
111 data,
112 i,
113 pos;
114
115 parser.parseSegmentBinaryData(new Uint8Array(reader.result));
116 // collect all the tags
117 while (parser.tagsAvailable()) {
118 tags.push(parser.getNextTag().bytes);
119 }
120 // create a uint8array for the entire segment and copy everything over
121 i = tags.length;
122 while (i--) {
123 byteLength += tags[i].byteLength;
124 }
125 data = new Uint8Array(byteLength);
126 i = tags.length;
127 pos = byteLength;
128 while (i--) {
129 pos -= tags[i].byteLength;
130 data.set(tags[i], pos);
131 }
132
133 hex = '<pre>'
134 hex += videojs.hls.utils.hexDump(data);
135 hex += '</pre>'
136
137 vjsOutput.innerHTML = hex;
138 });
139 reader.readAsArrayBuffer(this.files[0]);
140 }, false);
141
142 working.addEventListener('change', function() {
143 var reader = new FileReader();
144 reader.addEventListener('loadend', function() {
145 var hex = '<pre>';
146 hex += videojs.hls.utils.hexDump(new Uint8Array(reader.result));
147 hex += '</pre>';
148 workingOutput.innerHTML = hex;
149 });
150 reader.readAsArrayBuffer(this.files[0]);
151 }, false);
152 </script>
153 </body>
154 </html>