Skip to content
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

Closed
11 tasks done
richardstevenhack opened this issue Nov 23, 2023 · 31 comments
Labels
external issue Issue with an external tool

Comments

@richardstevenhack
Copy link

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

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

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['-vU', 'https://www.youtube.com/watch?v=-Cy4xFMeOxo']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.11.16 from yt-dlp/yt-dlp [24f827875]
[debug] Lazy loading extractors is disabled
[debug] Python 3.11.5 (CPython x86_64 64bit) - Linux-6.6.2-1-default-x86_64-with-glibc2.38 (OpenSSL 3.1.4 24 Oct 2023, glibc 2.38)
[debug] exe versions: ffmpeg 6.0.1 (setts), ffprobe 6.0.1
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, certifi-2023.07.22, mutagen-1.47.0, requests-2.31.0, sqlite3-3.44.0, urllib3-2.1.0, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1915 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2023.11.16 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2023.11.16 from yt-dlp/yt-dlp)
[youtube] Extracting URL: https://www.youtube.com/watch?v=-Cy4xFMeOxo
[youtube] -Cy4xFMeOxo: Downloading webpage
[youtube] -Cy4xFMeOxo: Downloading ios player API JSON
[youtube] -Cy4xFMeOxo: Downloading android player API JSON
[youtube] -Cy4xFMeOxo: Downloading m3u8 information
[youtube] -Cy4xFMeOxo: Downloading m3u8 information
[youtube] -Cy4xFMeOxo: Downloading MPD manifest
[youtube] -Cy4xFMeOxo: Downloading m3u8 information
[youtube] -Cy4xFMeOxo: Downloading MPD manifest
[debug] [youtube] -Cy4xFMeOxo: Video is in Post-Live Manifestless mode
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] -Cy4xFMeOxo: Downloading 1 format(s): 248+140
[debug] Invoking dashsegments downloader on "https://manifest.googlevideo.com/api/manifest/dash/expire/1700745946/ei/ev5eZfKQOb3HsfIPxb6dyAY/ip/2601%3A645%3A8900%3Af0f0%3A%3A963b/id/-Cy4xFMeOxo.1/source/yt_live_broadcast/requiressl/yes/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/force_finished/1/spc/UWF9f-6AVoxcnBSoHfY4fhQLn4tm0ak/vprv/1/pacing/0/itag_bl/376%2C377%2C384%2C385%2C612%2C613%2C617%2C619%2C623%2C628%2C655%2C656%2C660%2C662%2C666%2C671/keepalive/yes/fexp/24007246/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Cas%2Cforce_finished%2Cspc%2Cvprv%2Citag%2Cplaylist_type/sig/ANLwegAwRgIhAJyjGc6ab2Ry_kijQfy6hEebmqL58ECkLp2eozd5WY5sAiEAsSJmjCTECdoQLZoF8z5FEGeEVlP9AUYqlIFlqMRIF7w%3D"
[dashsegments] Total fragments: 1806
[download] Destination: Ninjutsu Training Mind-Control | Warrior's Whiteboard Wed [-Cy4xFMeOxo].f248.webm
[download] 100% of  466.62MiB in 00:01:42 at 4.54MiB/s
[debug] Invoking dashsegments downloader on "https://manifest.googlevideo.com/api/manifest/dash/expire/1700745946/ei/ev5eZfKQOb3HsfIPxb6dyAY/ip/2601%3A645%3A8900%3Af0f0%3A%3A963b/id/-Cy4xFMeOxo.1/source/yt_live_broadcast/requiressl/yes/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/force_finished/1/spc/UWF9f-6AVoxcnBSoHfY4fhQLn4tm0ak/vprv/1/pacing/0/itag_bl/376%2C377%2C384%2C385%2C612%2C613%2C617%2C619%2C623%2C628%2C655%2C656%2C660%2C662%2C666%2C671/keepalive/yes/fexp/24007246/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Cas%2Cforce_finished%2Cspc%2Cvprv%2Citag%2Cplaylist_type/sig/ANLwegAwRgIhAJyjGc6ab2Ry_kijQfy6hEebmqL58ECkLp2eozd5WY5sAiEAsSJmjCTECdoQLZoF8z5FEGeEVlP9AUYqlIFlqMRIF7w%3D"
[dashsegments] Total fragments: 1806
[download] Destination: Ninjutsu Training Mind-Control | Warrior's Whiteboard Wed [-Cy4xFMeOxo].f140.m4a
[download] 100% of   72.88MiB in 00:01:24 at 879.22KiB/s
[Merger] Merging formats into "Ninjutsu Training Mind-Control | Warrior's Whiteboard Wed [-Cy4xFMeOxo].mkv"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Ninjutsu Training Mind-Control | Warrior'"'"'s Whiteboard Wed [-Cy4xFMeOxo].f248.webm' -i 'file:Ninjutsu Training Mind-Control | Warrior'"'"'s Whiteboard Wed [-Cy4xFMeOxo].f140.m4a' -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart 'file:Ninjutsu Training Mind-Control | Warrior'"'"'s Whiteboard Wed [-Cy4xFMeOxo].temp.mkv'
[debug] ffmpeg version 6.0.1 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13 (SUSE Linux)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --optflags='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --enable-version3 --disable-openssl --enable-gnutls --enable-ladspa --enable-libshaderc --enable-vulkan --enable-libplacebo --disable-cuda-sdk --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libdc1394 --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libjack --enable-libjxl --enable-librist --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopenh264-dlopen --enable-libopus --enable-libpulse --enable-librav1e --enable-librubberband --enable-libsvtav1 --enable-libsoxr --enable-libspeex --enable-libssh --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lto --enable-lv2 --enable-libmfx --enable-vaapi --enable-vdpau --enable-version3 --enable-muxers --enable-demuxers --disable-encoders --disable-decoders --disable-decoder='mpeg4,h263,h264,hevc,vc1' --enable-encoder=',aac,apng,ass,ayuv,bmp,ffv1,ffvhuff,flac,gif,huffyuv,jpegls,libaom,libaom_av1,libcodec2,libgsm,libjxl,libmp3lame,libopenh264,libopenjpeg,libopus,librav1e,libschroedinger,libspeex,libsvtav1,libtheora,libtwolame,libvorbis,libvpx_vp8,libvpx_vp9,libwebp,libwebp_anim,mjpeg,mp2,mp2fixed,mpeg1video,mpeg2video,opus,pam,pbm,pcm_alaw,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_mulaw,pcm_s16be,pcm_s16be_planar,pcm_s16le,pcm_s16le_planar,pcm_s24be,pcm_s24le,pcm_s24le_planar,pcm_s32be,pcm_s32le,pcm_s32le_planar,pcm_s8,pcm_s8_planar,pcm_u16be,pcm_u16le,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,pcm_u8,pcx,pgm,pgmyuv,png,ppm,rawvideo,sgi,srt,ssa,sunrast,targa,text,tiff,v210,v308,v408,v410,vorbis,webvtt,wrapped_avframe,xbm,xwd,y41p,yuv4,zlib,' --enable-decoder=',aac,ac3,ansi,apng,ass,ayuv,bmp,dirac,exr,ffv1,ffvhuff,ffwavesynth,flac,gif,gsm,huffyuv,ilbc,libaom,libaom_av1,libcodec2,libdav1d,libgsm,libopenh264,libopenjpeg,libopus,libschroedinger,libspeex,libvorbis,libvpx_vp8,libvpx_vp9,mjpeg,mp1,mp1float,mp2,mp2float,mp3,mp3float,mpeg1video,mpeg2video,,opus,pam,pbm,pcm_alaw,pcm_bluray,pcm_dvd,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_mulaw,pcm_s16be,pcm_s16be_planar,pcm_s16le,pcm_s16le_planar,pcm_s24be,pcm_s24le,pcm_s24le_planar,pcm_s32be,pcm_s32le,pcm_s32le_planar,pcm_s8,pcm_s8_planar,pcm_u16be,pcm_u16le,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,pcm_u8,pcx,pgm,pgmyuv,pgssub,png,ppm,rawvideo,sgi,srt,ssa,sunrast,targa,text,theora,tiff,v210,v210x,v308,v408,v410,vorbis,vp3,vp5,vp6,vp6a,vp6f,vp8,vp9,webp,webvtt,wrapped_avframe,xbm,xwd,y41p,yuv4,zlib,'
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Input #0, matroska,webm, from 'file:Ninjutsu Training Mind-Control | Warrior's Whiteboard Wed [-Cy4xFMeOxo].f248.webm':
  Metadata:
    encoder         : google/video-file
    http://youtube.com/streaming/metadata/segment/102015: Sequence-Number: 0 
                    : Ingestion-Walltime-Us: 1700683384160270 
                    : Ingestion-Uncertainty-Us: 73 
                    : Stream-Duration-Us: 0 
                    : Max-Dvr-Duration-Us: 7200000000 
                    : Target-Duration-Us: 2000000 
                    : Streamable: T 
                    : First-Frame-Time-Us: 1700683387518007 
                    : First-Frame-Uncertainty-Us: 87 
                    :  
                    : 
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709), 1920x1080, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 1k tbn (default)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55c7c01b4f00] error reading header
file:Ninjutsu Training Mind-Control | Warrior's Whiteboard Wed [-Cy4xFMeOxo].f140.m4a: Invalid data found when processing input

ERROR: Postprocessing: file:Ninjutsu Training Mind-Control | Warrior's Whiteboard Wed [-Cy4xFMeOxo].f140.m4a: Invalid data found when processing input
Traceback (most recent call last):
  File "/home/rhack/.local/pipx/venvs/yt-dlp/lib64/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3468, in process_info
    replace_info_dict(self.post_process(dl_filename, info_dict, files_to_move))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rhack/.local/pipx/venvs/yt-dlp/lib64/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3648, in post_process
    info = self.run_all_pps('post_process', info, additional_pps=info.get('__postprocessors'))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rhack/.local/pipx/venvs/yt-dlp/lib64/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3630, in run_all_pps
    info = self.run_pp(pp, info)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/rhack/.local/pipx/venvs/yt-dlp/lib64/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3608, in run_pp
    files_to_delete, infodict = pp.run(infodict)
                                ^^^^^^^^^^^^^^^^
  File "/home/rhack/.local/pipx/venvs/yt-dlp/lib64/python3.11/site-packages/yt_dlp/postprocessor/common.py", line 23, in run
    ret = func(self, info, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rhack/.local/pipx/venvs/yt-dlp/lib64/python3.11/site-packages/yt_dlp/postprocessor/common.py", line 128, in wrapper
    return func(self, info)
           ^^^^^^^^^^^^^^^^
  File "/home/rhack/.local/pipx/venvs/yt-dlp/lib64/python3.11/site-packages/yt_dlp/postprocessor/ffmpeg.py", line 837, in run
    self.run_ffmpeg_multiple_files(info['__files_to_merge'], temp_filename, args)
  File "/home/rhack/.local/pipx/venvs/yt-dlp/lib64/python3.11/site-packages/yt_dlp/postprocessor/ffmpeg.py", line 329, in run_ffmpeg_multiple_files
    return self.real_run_ffmpeg(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/rhack/.local/pipx/venvs/yt-dlp/lib64/python3.11/site-packages/yt_dlp/postprocessor/ffmpeg.py", line 367, in real_run_ffmpeg
    raise FFmpegPostProcessorError(stderr.strip().splitlines()[-1])
yt_dlp.postprocessor.ffmpeg.FFmpegPostProcessorError: file:Ninjutsu Training Mind-Control | Warrior's Whiteboard Wed [-Cy4xFMeOxo].f140.m4a: Invalid data found when processing input
@richardstevenhack richardstevenhack added site-bug Issue with a specific website triage Untriaged issue labels Nov 23, 2023
@pukkandan
Copy link
Member

Pls check whether issue is reproducible with https://github.com/yt-dlp/ffmpeg-builds

@pukkandan pukkandan added the incomplete Further information is needed label Nov 23, 2023
@richardstevenhack
Copy link
Author

richardstevenhack commented Nov 23, 2023

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.

@llc0930
Copy link

llc0930 commented Nov 23, 2023

There is no longer format(s): 248+140 now.
I got the same error while downloading another video that just ended live a few hours ago.
2023-11-24-05:38:05
2023-11-24-05:38:24

@richardstevenhack
Copy link
Author

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.

@llc0930
Copy link

llc0930 commented Nov 23, 2023

@richardstevenhack That's because what you are taking now is format(s): 137+251.
I just downloaded the video through the link you provided.

@richardstevenhack
Copy link
Author

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.

@llc0930
Copy link

llc0930 commented Nov 23, 2023

There appears to be an issue with the file provided by YouTube just after the stream ends.
ffprobe-20231124-062121.log

@dreammu
Copy link

dreammu commented Nov 24, 2023

This problem should come from ffmpeg, and I encountered it after a previous ffmpeg apt update.
It occurs when you download videos using the DASH protocol, and the updated ffmpeg cannot merge them correctly. And it should be triggered when the live_status is post_live or when you use --live-from-start to download when it's live.
Here is a link to another project's fix for it, which may be helpful. Kethsar/ytarchive#164

@pukkandan
Copy link
Member

It occurs when you download videos using the DASH protocol, and the updated ffmpeg cannot merge them correctly. And it should be triggered when the live_status is post_live or when you use --live-from-start to download when it's live.
Here is a link to another project's fix for it, which may be helpful. Kethsar/ytarchive#164

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.

@pukkandan pukkandan added bug Bug that is not site-specific external issue Issue with an external tool and removed incomplete Further information is needed triage Untriaged issue labels Nov 26, 2023
@pukkandan
Copy link
Member

Can someone upload a small sample file with the issue?

@llc0930
Copy link

llc0930 commented Nov 26, 2023

I still keep the file, but obviously it's not that small.

@llc0930
Copy link

llc0930 commented Nov 26, 2023

Well, I processed the file with dd as requested by ffmpeg Bug Reports.
g5lOHaRV-LI.f140.m4a
sha256sum:
5b660872c88046717973633db44f06801a2ed3d466fd38f1221c7915ffd0b7a3 g5lOHaRV-LI.f140.m4a

@dreammu
Copy link

dreammu commented Nov 26, 2023

Here are two files downloaded from https://www.youtube.com/watch?v=21X5lGlDOfg

NASA.Live.Official.Stream.of.NASA.TV.21X5lGlDOfg.f298.mp4
NASA.Live.Official.Stream.of.NASA.TV.21X5lGlDOfg.f140.mp4

FFmpeg seems to have clearer error prompts:
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5583c6ee9700] error reading header

And, if there's just 1 fragment, this problem will not occur.

@tunaflsh
Copy link

tunaflsh commented Dec 3, 2023

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 --test flag.

@abe-101
Copy link

abe-101 commented Dec 5, 2023

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

@Mister-42
Copy link

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.

@richardstevenhack
Copy link
Author

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.

@tunaflsh
Copy link

tunaflsh commented Dec 11, 2023

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"

AlekseyMartynov added a commit to AlekseyMartynov/ytpod that referenced this issue Dec 11, 2023
@barsikus007
Copy link

you can also use ffmpeg 4.4

@HDark15
Copy link

HDark15 commented Dec 16, 2023

@tunaflsh Why? Just use the ffmpeg command that yt-dlp uses instead

ffmpeg -i "file:video.mp4" -i "file:audio.mp4" -c copy -map "0:v:0" -map "1:a:0" -movflags "+faststart" "file:Video.temp.mkv"

@tunaflsh
Copy link

@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

@HDark15
Copy link

HDark15 commented Dec 17, 2023

@tunaflsh "Works on my machine" Never happen to me, I can always do that.

@HDark15
Copy link

HDark15 commented Dec 17, 2023

I believe that it has been fixed on the latest yt-dlp ffmpeg-builds. I'm using the latest master build and having live_status on post_live or using --live-from-start didn't bring that issue.

@tunaflsh
Copy link

@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.

@tunaflsh
Copy link

Yep, the latest builds work!

@richardstevenhack
Copy link
Author

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.

@bashonly
Copy link
Member

bashonly commented Dec 17, 2023

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 (which has not seen proper release yet included in the 6.1.1 release)

So the solution is to upgrade to ffmpeg 6.1.1 or upgrade to an ffmpeg master build starting from revision N-112916 or later

@bashonly bashonly removed bug Bug that is not site-specific site-bug Issue with a specific website labels Dec 17, 2023
@llc0930
Copy link

llc0930 commented Dec 17, 2023

... I downloaded them, moved them to /usr/bin ...

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.

@richardstevenhack, I believe you can actually specify the location of the ffmpeg binary directly.
Post-Processing Options:

--ffmpeg-location PATH          Location of the ffmpeg binary; either the
                                path to the binary or its containing directory

Or you can add the location to your $PATH variable.

@GUUser91
Copy link

GUUser91 commented Jan 3, 2024

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.
https://play.google.com/store/apps/details?id=com.silentlexx.ffmpeggui&pli=1

@bashonly
Copy link
Member

bashonly commented Jan 3, 2024

note that this is now also fixed in ffmpeg 6.1.1 which was released at the beginning of this week

@ISJ-439
Copy link

ISJ-439 commented Jun 22, 2024

Fixed by upgrading to this version on Debian 12:
ffmpeg version 5.1.5-0+deb12u1

@bashonly bashonly changed the title FFMPEG Reports "Invalid data found when processing input" on Youtube Video after postprocessing FFMPEG "Invalid data found when processing input" on live/post-live/dash videos (duplicate ftyp) Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external issue Issue with an external tool
Projects
None yet
Development

No branches or pull requests