Add buttons to download images and videos in Twitter, also does some other enhancements.
< Отзив за Twitter Click'n'Save
Something like this has already happened before:
The videos works fine even in old browsers and in MPC-HC player, for example. The problem is with player (VLC). Create, or bump a bug report on VLC forum.
If you want to "fix" the videos you only need to remux them without re-encoding. It just repacks the video streams from one mp4 container to a new mp4 container.
Use my bash script for ffmpeg from the issue above. It's fast and lossless.
Damn, I can't edit my comment anymore. Use Github for discussions.
So far all media players with the exception of MPC-HC and webbrowsers are having this bug. WMP(32 and 64), Media Player, ACG Player, VCL, Microsoft Photos, etc.
Also uploading the vidoes to other social media, like whatsapp, twitter itself, discord, all video uploaded there play normal as well. The core issue are the everyday players I mentioned above, but then again, Twitter is in fact giving badly muxed videos to the downloading tools.
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002d259e057c0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002d259e057c0] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002d259e057c0] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002d259e057c0] Processing st: 0, edit list 0 - media time: 27000000, duration: 50400000
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002d259e057c0] Offset DTS by 27000000 to make first pts zero.
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002d259e057c0] Setting codecpar->delay to 2 for stream st: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002d259e057c0] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002d259e057c0] Before avformat_find_stream_info() pos: 364836 bytes read:32826 seeks:1 nb_streams:2
I used FFmpeg to check what's up, this came up. Same with this one.
Por cierto, el edit list cambia dependiendo de la duracion del video
[AVFormatContext @ 000001843bb82080] Opening 'User-ID-20250726_092335-vid1.mp4' for reading
[file @ 000001843bb7a240] Setting default whitelist 'file,crypto,data'
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001843bb82080] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001843bb82080] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001843bb82080] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001843bb82080] Processing st: 0, edit list 0 - media time: 4608000, duration: 33792049
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001843bb82080] Offset DTS by 4608000 to make first pts zero.
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001843bb82080] Setting codecpar->delay to 2 for stream st: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001843bb82080] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001843bb82080] Before avformat_find_stream_info() pos: 3490170 bytes read:32826 seeks:1 nb_streams:2
[h264 @ 000001843bbdb080] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 000001843bbdb080] Decoding VUI
[h264 @ 000001843bbdb080] nal_unit_type: 8(PPS), nal_ref_idc: 3
Every video there is a delay where the music/sounds starts from 0 but the pictures don't, after 6 seconds, sometimes 7, "no picture" is repeated several times throught the analysis file, which explains why the frames are freezing or messed up. It has 0 decode errors tho, so the splitters and decoders ain't the issue.
But hey, thanks for giving me a fix, BTW, is there an option to just download the videos directly instead of in a zip file?
This userscript does not download ZIP files. It downloads MP4 files directly.
Yeah my bad, I confused it with another video downloader that does that, sorry.
Twitter broke something with their video and audio muxer that messed the moov atoms, now every video that was downloaded from june 23rd (at least I noticed it was since then) have audio and video that don't sync, and freezing frames
https://www.reddit.com/r/Twitter/comments/1lqj32t/anyones_third_party_downloaded_videos_freezing/
So far the only solutions are to run the videos through a compressor like uncut or sony vegas 17, you convert mp4 to mp4 as funny as it sounds it also works but it increases file size a little bit, If you use K-Lite Codec Pack thier built-in player MPC-HC can play the videos fixed so no need to do anything there, cuz their filters can sync them again. Another solution is to use FFmpeg, either you have it installed or from here "https://ffmpeg-online.vercel.app/?inputOptions=-i&output=output.mp4&outputOptions=", this also will increase the file size a little bit.
The most painful one is to re-download the videos again using yt-dlp, doing this won't increase the file size.
So until either the extensions work again or Twitter puts it shit together, these are what we can do.