[GH-ISSUE #172] Twitter videos encoded with Twitter-vork muxer don't play properly on Apple devices #5965

Closed
opened 2026-04-19 07:58:45 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @dumbmoron on GitHub (Aug 12, 2023).
Original GitHub issue: https://github.com/imputnet/cobalt/issues/172

some videos encoded with Twitter-vork muxer (most videos on Twitter are usually encoded with "Vireo Eyes" / "Vireo Ears") appear significantly shorter than they actually are when viewed/downloaded on iOS
ffprobe (example):

  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 720x1556, 884 kb/s, SAR 1:1 DAR 180:389, 37.13 fps, 60 tbr, 6k tbn (default)
    Metadata:
      handler_name    : Twitter-vork muxer
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : Twitter-vork muxer
      vendor_id       : [0][0][0][0]

remuxing it fixes it, with some DTS warnings:

$ ffmpeg -i video.mp4 -map 0 -c copy out.mp4

[mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 107200, current: 107000; changing to 107201. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1655320, current: 1655120; changing to 1655321. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1691320, current: 1691120; changing to 1691321. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1763340, current: 1763140; changing to 1763341. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1799340, current: 1798940; changing to 1799341. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1835140, current: 1835140; changing to 1835141. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1871140, current: 1871140; changing to 1871141. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1907340, current: 1907140; changing to 1907341. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1943340, current: 1943140; changing to 1943341. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 2015160, current: 2015160; changing to 2015161. This may result in incorrect timestamps in the output file.

Originally created by @dumbmoron on GitHub (Aug 12, 2023). Original GitHub issue: https://github.com/imputnet/cobalt/issues/172 some videos encoded with `Twitter-vork muxer` (most videos on Twitter are usually encoded with "Vireo Eyes" / "Vireo Ears") appear significantly shorter than they actually are when viewed/downloaded on iOS ffprobe ([example](https://twitter.com/SwiftOnSecurity/status/1689086007721725952)): ``` Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 720x1556, 884 kb/s, SAR 1:1 DAR 180:389, 37.13 fps, 60 tbr, 6k tbn (default) Metadata: handler_name : Twitter-vork muxer vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : Twitter-vork muxer vendor_id : [0][0][0][0] ``` remuxing it fixes it, with some DTS warnings: ``` $ ffmpeg -i video.mp4 -map 0 -c copy out.mp4 [mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 107200, current: 107000; changing to 107201. This may result in incorrect timestamps in the output file. [mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1655320, current: 1655120; changing to 1655321. This may result in incorrect timestamps in the output file. [mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1691320, current: 1691120; changing to 1691321. This may result in incorrect timestamps in the output file. [mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1763340, current: 1763140; changing to 1763341. This may result in incorrect timestamps in the output file. [mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1799340, current: 1798940; changing to 1799341. This may result in incorrect timestamps in the output file. [mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1835140, current: 1835140; changing to 1835141. This may result in incorrect timestamps in the output file. [mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1871140, current: 1871140; changing to 1871141. This may result in incorrect timestamps in the output file. [mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1907340, current: 1907140; changing to 1907341. This may result in incorrect timestamps in the output file. [mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 1943340, current: 1943140; changing to 1943341. This may result in incorrect timestamps in the output file. [mp4 @ 0x556f47d7d080] Non-monotonous DTS in output stream 0:0; previous: 2015160, current: 2015160; changing to 2015161. This may result in incorrect timestamps in the output file. ```
GiteaMirror added the can reproduce label 2026-04-19 07:58:45 -05:00
Author
Owner

@wukko commented on GitHub (Dec 2, 2023):

jesus christ this is a mess

<!-- gh-comment-id:1837002828 --> @wukko commented on GitHub (Dec 2, 2023): jesus christ this is a mess
Author
Owner

@wukko commented on GitHub (Dec 2, 2023):

quicktime on mac can't play such videos at all

image
<!-- gh-comment-id:1837003387 --> @wukko commented on GitHub (Dec 2, 2023): quicktime on mac can't play such videos at all <img width="372" alt="image" src="https://github.com/wukko/cobalt/assets/71202418/99ce3981-d399-4e0b-9456-287855350271">
Author
Owner

@wukko commented on GitHub (Dec 2, 2023):

they mixed up container info and quicktime (rightfully) refuses to play it. to fix that, video has to be copied over into a proper container (-c copy in ffmpeg).

wouldn't hurt doing this for all twitter videos...

<!-- gh-comment-id:1837004835 --> @wukko commented on GitHub (Dec 2, 2023): they mixed up container info and quicktime (rightfully) refuses to play it. to fix that, video has to be copied over into a proper container (``-c copy`` in ffmpeg). wouldn't hurt doing this for all twitter videos...
Author
Owner

@wukko commented on GitHub (Dec 2, 2023):

this is a more correct way of saying "twitter fucked up the video container in their muxer" btw

<!-- gh-comment-id:1837005252 --> @wukko commented on GitHub (Dec 2, 2023): this is a more correct way of saying "twitter fucked up the video container in their muxer" btw
Sign in to join this conversation.