Re: [mediacapture-record] Add replaceStream to MediaRecorder (#186)

@jan-ivar Re "instead" see https://github.com/w3c/mediacapture-record/issues/167#issuecomment-526226683 where @henbos mentioned specifying both `replaceStream()` and `replaceTrack()`. 

Ideally the Media Capture and Streams (main) will eventually abandon the concept of tracks not being ordered https://github.com/w3c/mediacapture-main/issues/611,  https://github.com/w3c/mediacapture-record/issues/179 due to the fact of the issues arising when post-production on the WebM file(s) are performed. 

For this input (some files may have audio track without video track or video track without audio track) 

> https://upload.wikimedia.org/wikipedia/commons/6/6e/Micronesia_National_Anthem.ogg#t=0,2
> https://upload.wikimedia.org/wikipedia/commons/a/a4/Xacti-AC8EX-Sample_video-001.ogv#t=0,4
> https://mirrors.creativecommons.org/movingimages/webm/ScienceCommonsJesseDylan_240p.webm#t=10,20
> https://mirrors.creativecommons.org/movingimages/webm/ASharedCulture_480p.webm#t=22,26
> https://nickdesaulniers.github.io/netfix/demo/frag_bunny.mp4#t=55,60
> https://raw.githubusercontent.com/w3c/web-platform-tests/master/media-source/mp4/test.mp4#t=0,5
> https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4#t=0,5
> https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4#t=0,5
> https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerMeltdowns.mp4#t=0,6

the required mapping to merge the tracks, after creating the corresponding potentially omitted video or audio track 

```
[
  {
    "audio": 1,
    "video": 0
  },
  {
    "audio": 0,
    "video": 1
  },
  {
    "audio": 1,
    "video": 0
  },
  {
    "audio": 0,
    "video": 1
  },
  {
    "audio": 0,
    "video": 1
  },
  {
    "audio": 0,
    "video": 1
  },
  {
    "audio": 0,
    "video": 1
  },
  {
    "audio": 0,
    "video": 1
  },
  {
    "audio": 0,
    "video": 1
  }
]
```

though is not guranteed to be in that same order for each run of the code. To merge with `mkvmerge` `--append-to` mapping is

`1:0:0:1,1:1:0:0,2:1:1:0,2:0:1:1,3:0:2:1,3:1:2:0,4:0:3:0,4:1:3:1,5:0:4:0,5:1:4:1,6:0:5:0,6:1:5:1,7:0:6:0,7:1:6:1,8:0:7:0,8:1:7:1`.

Result https://plnkr.co/edit/8J61Rw?p=info.

Even when WebM file produced by Chromium and Mozilla browsers have the same track order they still cannot be merged; an error is thrown, due to the vastly different parameters passed to the encoder. 

Thus, there is still must ground to be covered for any sort of interoperability, if that term or concept is in fact being considered at all during this specification write-up. Setting consistent track order should eventually be addressed. There is no compelling reason to not have consistent track order, especially within the purview of `MediaRecorder`.

-- 
GitHub Notification of comment by guest271314
Please view or discuss this issue at https://github.com/w3c/mediacapture-record/pull/186#issuecomment-531433368 using your GitHub account

Received on Saturday, 14 September 2019 01:18:17 UTC