-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFMPEG "Invalid data found when processing input" on live/post-live/dash videos (duplicate ftyp) #8641
Comments
Pls check whether issue is reproducible with https://github.com/yt-dlp/ffmpeg-builds |
I don't know how to do that. I looked at that but can't figure out what I'm supposed to do with it. Is there an instructional somewhere? UPDATE: OK, now I see. There are three new FFMPEG binaries there. I suppose I should replace the system binaries with those (after making a backup of those original binaries, of course.) OK, I'll try that. |
Updating the FFMPEG binaries appears to have worked for the same video that produced the error in my case. So I consider my issue closed unless some other video produces the same error going forward. I download 50-100 videos a day, so if the issue remains I'll likely see it today. |
@richardstevenhack That's because what you are taking now is format(s): 137+251. |
Not familiar with the various formats, I just download whatever is handed to me by Youtube. As I say, I'll see if it happens again in my case. |
There appears to be an issue with the file provided by YouTube just after the stream ends. |
This problem should come from ffmpeg, and I encountered it after a previous ffmpeg apt update. |
That is insane. Has someone reported this to ffmpeg? Do we know if this is an intentional change? We could technically fix this, but it would be much more preferably if ffmpeg can. |
Can someone upload a small sample file with the issue? |
I still keep the file, but obviously it's not that small. |
Well, I processed the file with dd as requested by ffmpeg Bug Reports. |
Here are two files downloaded from https://www.youtube.com/watch?v=21X5lGlDOfg NASA.Live.Official.Stream.of.NASA.TV.21X5lGlDOfg.f298.mp4NASA.Live.Official.Stream.of.NASA.TV.21X5lGlDOfg.f140.mp4FFmpeg seems to have clearer error prompts: And, if there's just 1 fragment, this problem will not occur. |
I keep getting this error, too also when downloading from crunchyroll (this episode), even with the win64 build from https://github.com/yt-dlp/ffmpeg-builds. Edit: Actually it worked fine if I download the whole video. It only broke with the |
i find this issue tends to occur when downloading a video immediately after a live stream, particularly with longer videos exceeding roughly 30 minutes in duration |
This is exactly what I encounter as well. |
Agreed. I've noticed previously when using a service like Yt5S.com to download Youtube videos that they can't download a streamed file within a certain period of time after it's been streamed. Apparently Youtube continues processing the file after it's been streamed before it's ready to download. After a certain period of time, usually within 24 hours although I don't know the exact length of time required, the service can then download the file. For those types of files, I usually don't try to use the service or use Media-Downloader but use yt-dlp to download the file. It is these files that tend to produce the error now whereas in the past they didn't. If I wait until the next day, I can then download that file using Yt5s. I haven't tried using yt-dlp directly to download those files the next day. I'll try to do that as an experiment. |
A workaround I found is to use mp4box to repack the broken video/audio file and then finish the ffmpeg job. mp4box -add "audio.part.mp4" -new "output.audio.mp4"
mp4box -add "video.part.mp4" -new "output.video.mp4"
ffmpeg -i "output.audio.mp4" -i "output.video.mp4" -c copy "output.mp4" And if you need to embed the thumbnail: ffmpeg -i "output.mp4" -i "thumbnail.webp" -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic "final.output.mp4" or for matroska ffmpeg -i "output.mkv" -attach "thumbnail.webp" -metadata:s:t mimetype=image/webp -metadata:s:t filename=cover.webp -c copy "final.output.mkv" |
you can also use ffmpeg 4.4 |
@tunaflsh Why? Just use the ffmpeg command that yt-dlp uses instead
|
@HDark15 without repacking, ffmpeg crashes just by providing the input file without even doing anything $ ffmpeg -i "broken.mp4"
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000024a43c9aa40] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000024a43c9aa40] moov atom not found
[in#0 @ 0000024a43c50240] Error opening input: Invalid data found when processing input
Error opening input file broken.mp4.
Error opening input files: Invalid data found when processing input |
@tunaflsh "Works on my machine" Never happen to me, I can always do that. |
I believe that it has been fixed on the latest yt-dlp ffmpeg-builds. I'm using the latest master build and having |
@HDark15 if it works on your machine, then the "Invalid data found..." issue shouldn't even happen in the first place. I'll try the latest build. |
Yep, the latest builds work! |
I just tested the latest ffmpeg build. It works. I was about to report another file that doesn't download correctly when I saw the posts about the latest ffmpeg builds, so I downloaded them, moved them to /usr/bin, and tested the file I was having the problem with. It downloaded fine. I have two more live-streamed videos to download, so I will test them next. I expect it will be fine. Kudos to the developers! I saved the original ffmpeg binaries from my distro and I also saved the new yt-dlp ffmpeg builds elsewhere in the file system, in case openSUSE Tumbleweed should decide to update them in the future, which is very possible. I recommend following that procedure. If videos start breaking again, just reset the binaries to the yt-dlp versions. |
Looks like the regression was introduced with FFmpeg/FFmpeg@19fcf43 (just in time for the 6.1 release) And then was fixed by FFmpeg/FFmpeg@4cdf2c7 ( So the solution is to upgrade to ffmpeg 6.1.1 or upgrade to an ffmpeg master build starting from revision |
@richardstevenhack, I believe you can actually specify the location of the ffmpeg binary directly.
Or you can add the location to your $PATH variable. |
I want to give out a tip for any Android Termux users that updated to the latest version of ffmpeg and have the processing input error. You can use the ffmpeg gui Android app which uses version 6.0.0. It has a commandline option as well. |
note that this is now also fixed in ffmpeg 6.1.1 which was released at the beginning of this week |
Fixed by upgrading to this version on Debian 12: |
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
Checklist
Region
United States
Provide a description that is worded well enough to be understood
I am running openSUSE Tumbleweed on snapshot dated 20231121.
I attempted to download the video at this URL from Youtube:
https://www.youtube.com/watch?v=-Cy4xFMeOxo
This is a live stream video which aired 11 hours before the download attempt.
The download appeared to go fine as shown by the verbose output below, but on post processing by FFMPEG, it reported the following:
yt_dlp.postprocessor.ffmpeg.FFmpegPostProcessorError: file:Ninjutsu Training Mind-Control | Warrior's Whiteboard Wed [-Cy4xFMeOxo].f140.m4a: Invalid data found when processing input
Provide verbose output that clearly demonstrates the problem
yt-dlp -vU <your command line>
)'verbose': True
toYoutubeDL
params instead[debug] Command-line config
) and insert it belowComplete Verbose Output
The text was updated successfully, but these errors were encountered: