cobalt icon indicating copy to clipboard operation
cobalt copied to clipboard

Video length is missing in old software after cobalt's live render

Open wukko opened this issue 1 year ago • 1 comments

why does this happen?

to preserve privacy and maintain efficiency, cobalt merges & streams videos with ffmpeg right away, without ever storing or caching anything on disk.

as result, final file length cannot be predicted, so it's missing from headers of some downloaded files.

what's affected?

this happens only when live rendering is used, most often with youtube videos. older software (vegas pro, windows media player, default players on lower end android devices) cannot generate file length, so it's either missing or shows up as some obnoxious number like 4294967295.

what can be done about it?

at the moment, this is not something that can be fixed, as it's the nature of live rendering process.

however, in most cases, the issue can be worked around by using modern software instead. for playback, vlc media player can be used instead. other (and most accessible) playback option is the built-in media player in any modern web browser.

you can also "fix" files with missing timestamp by remuxing them with ffmpeg:

ffmpeg -i your_video_file_here.mp4 -c copy output_name_for_file.mp4

if you know how to solve this issue in cobalt's rendering pipeline, feel free to make a pull request!

previous related issues

these issues were closed in favor of this one, as they all describe the same problem, but in different apps:

  • #94
  • #204
  • #255
  • #345
  • #348
  • #374
  • #420
  • #483
  • #564

wukko avatar Jun 10 '24 08:06 wukko

I tried to replicate the described issue but I was unable to.

I downloaded 3 of the latest Fireship videos and the same for @homedesign369. All videos showed the correct duration from ffprobe's input.duration. And I was able to play all videos with the playback bar correctly showing the duration with Windows Media Player.

Could you possibly expand on what platforms (e.g. YouTube) this issue occurs on? And possibly link the videos for future contributors? (I won't be contributing to this issue.)

ari-party avatar Jun 12 '24 22:06 ari-party

I tried to replicate the described issue but I was unable to.

Try to download any YouTube video (ex. this one) in 1080p resolution and H.264 codec to replicate this issue.

YouTube stores complete (video with audio) versions in 360p and 720p resolutions and H.264 codec for compatibility.

synzr avatar Jul 12 '24 10:07 synzr

tried the same thing on the video that you linked with the settings you provided and the same thing happens

ihatespawn avatar Jul 12 '24 10:07 ihatespawn

I have the same issue has they.

lostdusty avatar Jul 12 '24 12:07 lostdusty

telegram shows 0:00

Screenshot_20240722_002204_Telegram.jpg

ihatespawn avatar Jul 21 '24 22:07 ihatespawn

possible solution (for yt): since you know the approximate (thanks for reminding me) length of the video (because you check if it's <180 minutes), why don't just send the header with that information?

ihatespawn avatar Jul 28 '24 16:07 ihatespawn

possible solution (for yt): since you know the length of the video (because you check if it's <180 minutes), why don't just send the header with that information?

youtube stores the only approximate duration in the video database. you can see how youtube player adds or takes away the second(s) of video after loading it.

in theory, the forcing of duration in container header can create new problems with compatibility.

synzr avatar Jul 28 '24 16:07 synzr

since you know the length of the video

do you know the exact final bit length of a remuxed video?

wukko avatar Jul 28 '24 16:07 wukko

got this issue in vlc too, but only for videos in h264, not av1 video of me reproducing the issue: https://youtu.be/slYl9DraXEA

ghost avatar Aug 11 '24 21:08 ghost

I hope this gets fixed soon

ItsOpenSourceSoftware avatar Aug 19 '24 22:08 ItsOpenSourceSoftware

I hope so too

inventor7777 avatar Aug 27 '24 23:08 inventor7777