13

when I record a video with the Media Recorder API and download & open it with VLC, length of the video is unknow.

Furthermore, on Chrome mobile (52.0.2743.98) if I read it in a video tag, length isn't show, currentTime will always be 0 and the ontimeupdate will only launch when the video end.

On Chrome desktop (52.0.2743.116), length isn't show but ontimeupdate and currentTime seem to work fine.

I've recorded and downloaded the video from the developers google demo. The video is a webm as It seem to be the only type supported by chrome

Any idea ?

Metadata from ffpmeg :

libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 Input #0, matroska,webm, from 'test.webm': Metadata: encoder : Chrome Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0(eng): Audio: opus, 48000 Hz, mono, fltp (default) Stream #0:1(eng): Video: vp9 (Profile 0), yuv420p(tv), 480x640, SAR 1:1 DAR 3:4, 30 fps, 30 tbr, 1k tbn, 1k tbc (default) File 'metadata.txt' already exists. Overwrite ? [y/N] y Output #0, ffmetadata, to 'metadata.txt': Metadata: encoder : Lavf56.40.101 Stream mapping: size= 0kB time=--577014:-32:-22.-77 bitrate=N/A video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Titoine
  • 183
  • 7
  • i noticed it seems to work better the 2nd time its played on chrome desktop. i get a length the first time, but the progress bar is choppy or maybe not working at all. video is tricky and it's amazing this works at all. you might be able to post process the file using ffmpeg to give it more metadata that would enable faster blind seeks, getting total play time, etc. you might also be able to jump to the end of the clip and back to the front, which might let the video controls work smoothly the first _real_ time it's played through. – dandavis Aug 18 '16 at 01:36
  • 3
    Hi! This is a well known bug in Chrome; the duration of the recorded media isn't added to the headers of the final file. Sadly, this bug is currently marked as WontFix by the Chromium team. However, there are a couple of workarounds: - On the backend, using ffmpeg to fix the headers: ffmpeg -i old.webm output.webm - On the frontend, the workaround on [this answer](https://stackoverflow.com/questions/38443084/how-can-i-add-predefined-length-to-audio-recorded-from-mediarecorder-in-chrome/39971175#39971175) or using the package [ts-ebml](https://www.npmjs.com/package/ts-ebml) – ACBM Mar 07 '19 at 23:05
  • Possible duplicate of [How can I add predefined length to audio recorded from MediaRecorder in Chrome?](https://stackoverflow.com/questions/38443084/how-can-i-add-predefined-length-to-audio-recorded-from-mediarecorder-in-chrome) – ACBM Mar 07 '19 at 23:07
  • You need to covert this webm file to other format the it will work fine – kuldeep chopra May 31 '21 at 12:39

0 Answers0