Skip to content

[ffmpeg] mp4: track 1: codec frame size is not set #18036

Open

Description

@Rochkiller

mpv Information

mpv v0.41.0-690-g1ac687d79 Copyright © 2000-2026 mpv/MPlayer/mplayer2 projects
 built on May 26 2026 13:45:37
libplacebo version: v7.364.0 (v7.360.0-57-g051cc36-dirty)
FFmpeg version: N-124653-g0ac3b00a1
FFmpeg library versions:
   libavcodec      62.34.102
   libavdevice     62.4.100
   libavfilter     11.17.100
   libavformat     62.18.100
   libavutil       60.31.100
   libswresample   6.4.100
   libswscale      9.7.100

Other Information

- Windows version: Windows 10 IoT Entreprise LTSC 21H2
- GPU model, driver and version: AMD Radeon RX 9070 XT - 32.0.31007.5012 - 26.5.2
- Source of mpv: zhongfly/mpv-winbuild
- Latest known working version: Idk, issue still occurs with oldest build available : mpv-x86_64-v3-20260428-git-a42b1b9103
- Issue started after the following happened: N/A

Reproduction Steps

  1. Open an Youtube video with lastest zhongfly/mpv-winbuild
  2. Dump-cache

Also, same happen with Kick live stream but with this error (red) :

[ffmpeg] mp4: sample rate not set
[recorder] Writing header failed.
Cache dumping stopped due to error.

I don't know if it's the same issue but the result is the same (1MiB outfile not playable)

FYI, same happen with build shinchiro/mpv-winbuild-cmake since build mpv-x86_64-v3-20260517-git-059bc70 : shinchiro/mpv-winbuild-cmake#828

Expected Behavior

Example from shinchiro/mpv-winbuild-cmake mpv-x86_64-v3-20260416-git-d20d108 :
mpv https://youtu.be/hrk8ZhjoB-Q

[auto_profiles] Applying auto profile: youtube
[osd/libass] fontselect: Using default font family: (mpv-osd-symbols, 400, 0) -> ArialMT, 0, ArialMT
Not seekable, but enabling seeking on user request.
● Video --vid=1 (h264 1920x1080 59.9401 fps 3298 kbps) [default]
● Audio --aid=1 --alang=eng (aac 2ch 44100 Hz 128 kbps) [default]
File tags:
Date: 20191121
Uploader: Danucd
Channel_URL: https://www.youtube.com/channel/UCsIiIEGRoBILi8LSkWNPqXA
AO: [wasapi] 192000Hz stereo 2ch float
VO: [gpu-next] 1920x1080 yuv420p
[modernz] URL detected.
[modernz] Approximating file size...
[modernz] Executing: yt-dlp -f (bv*[vcodec~='^(av(0|c)1)']+ba[acodec^=mp4a])/b --no-download -O %(filesize,filesize_approx)s https://youtu.be/hrk8ZhjoB-Q
[osd/libass] fontselect: Using default font family: (mpv-osd-symbols, 400, 0) -> ArialMT, 0, ArialMT
[modernz] Download size: 31.91 MiB
Cache dumping started.
[ffmpeg] mp4: track 0: codec frame size is not set
[recorder] This is an experimental feature. Output files might be broken or not play correctly with various players (including mpv itself).
[recorder] Discontinuity at timestamp 0.000000.
Cache dumping successfully ended.
AV: 00:00:11 / 00:01:16 (16%) A-V: 0.000 Cache: 64s/30MB
Exiting... (Quit)

Outfile 32MiB playable
warning [ffmpeg] mp4: track 0: codec frame size is not set

Actual Behavior

mpv https://youtu.be/hrk8ZhjoB-Q

[auto_profiles] Applying auto profile: youtube
[osd/libass] fontselect: Using default font family: (mpv-osd-symbols, 400, 0) -> ArialMT, 0, ArialMT
Not seekable, but enabling seeking on user request.
● --edition=0 '299 - 1920x1080 (1080p60) (h264 60 fps 3353 kbps)'
○ --edition=1 '301 - 1920x1080 muxed-14 (h264 60 fps) (aac)'
○ --edition=2 '298 - 1280x720 (720p60) (h264 60 fps 1605 kbps)'
○ --edition=3 '300 - 1280x720 muxed-12 (h264 60 fps) (aac)'
○ --edition=4 '18 - 640x360 (360p) muxed-11 (h264 30 fps) (aac 44100 Hz)'
○ --edition=5 '134 - 640x360 (360p) (h264 30 fps 281 kbps)'
○ --edition=6 '93 - 640x360 muxed-9 (h264 30 fps) (aac)'
○ --edition=7 '160 - 256x144 (144p) (h264 30 fps 111 kbps)'
○ --edition=8 '91 - 256x144 muxed-7 (h264 30 fps) (aac)'
● Video --vid=1 '299 - 1920x1080 (1080p60)' (h264 1920x1080 60 fps 3353 kbps) [default]
○ Audio --aid=6 '251 - audio only (medium)' (opus 48000 Hz 130 kbps)
● Audio --aid=7 '140 - audio only (medium)' (aac 44100 Hz 129 kbps) [default]
○ Audio --aid=8 '139 - audio only (low)' (aac 22050 Hz 48 kbps)
File tags:
Date: 20191121
Title: NEW SONG BACK2BACK | DANUCD SKINS | Danucd
Uploader: Danucd
Channel_URL: https://www.youtube.com/channel/UCsIiIEGRoBILi8LSkWNPqXA
[modernz] URL detected.
[modernz] Approximating file size...
[modernz] Executing: yt-dlp -f (bv*[vcodec~='^(av(0|c)1)']+ba[acodec^=mp4a])/b --no-download -O %(filesize,filesize_approx)s https://youtu.be/hrk8ZhjoB-Q
AO: [wasapi] 48000Hz stereo 2ch float
VO: [gpu-next] 1920x1080 yuv420p
[osd/libass] fontselect: Using default font family: (mpv-osd-symbols, 400, 0) -> ArialMT, 0, ArialMT
Cache dumping started.
[ffmpeg] mp4: track 1: codec frame size is not set
[recorder] This is an experimental feature. Output files might be broken or not play correctly with various players (including mpv itself).
[recorder] Discontinuity at timestamp 0.000000.
Cache dumping successfully ended.
[modernz] Download size: 31.91 MiB
Exiting... (Quit)

Output file 1MiB and not playable
warning [ffmpeg] mp4: track 1: codec frame size is not set

Log File

output.txt

Sample Files

No response

I carefully read all instruction and confirm that I did the following:

  • I tested and confirmed that the issue exists with the latest release version or newer.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.

Activity

  1. added theissue type on May 28, 2026
  2. guidocella commented on May 28, 2026

    @guidocella
    Contributor

    #17936 fixes this for the initially selected video track. It still doesn't work after changing it which requires the proposal in #17936 (comment).

  3. Rochkiller commented on May 28, 2026

    @Rochkiller
    Author

    @guidocella, I tried the artefact : it broke everything !!! :@

    mpv --version

    mpv v0.41.0-dev-g6efd35fa3 Copyright © 2000-2026 mpv/MPlayer/mplayer2 projects
    built on May 17 2026 18:58:42
    libplacebo version: v7.364.0
    FFmpeg version: bbdf847
    FFmpeg library versions:
    libavcodec 62.28.100
    libavdevice 62.3.100
    libavfilter 11.14.100
    libavformat 62.12.100
    libavutil 60.26.100
    libswresample 6.3.100
    libswscale 9.5.100

    mpv https://youtu.be/hrk8ZhjoB-Q

    [auto_profiles] Applying auto profile: youtube
    [osd/libass] fontselect: Using default font family: (mpv-osd-symbols, 400, 0) -> ArialMT, 0, ArialMT
    Not seekable, but enabling seeking on user request.
    No protocol handler found to open URL https://rr4---sn-25glenlz.googlevideo.com/videoplayback?[...]%3D
    The protocol is either unsupported, or was disabled at compile-time.
    EDL: Could not open source file 'https://rr4---sn-25glenlz.googlevideo.com/videoplayback?[...]%3D'.
    No video or audio streams selected.
    Exiting... (Errors when loading file)

    mpv https://kick.com/theburntpeanut

    [auto_profiles] Applying auto profile: kick
    No protocol handler found to open URL https://kick.com/theburntpeanut
    The protocol is either unsupported, or was disabled at compile-time.
    [osd/libass] fontselect: Using default font family: (mpv-osd-symbols, 400, 0) -> ArialMT, 0, ArialMT
    Not seekable, but enabling seeking on user request.
    No protocol handler found to open URL https://fa723fc1b171.euw33.playlist.live-video.net/v1/playlist/[...]P.m3u8
    The protocol is either unsupported, or was disabled at compile-time.
    EDL: Could not open source file 'https://fa723fc1b171.euw33.playlist.live-video.net/v1/playlist/[...].m3u8'.
    No video or audio streams selected.
    Exiting... (Errors when loading file)

  4. guidocella commented on May 28, 2026

    @guidocella
    Contributor

    You can try the modified ytdl_hook.lua without the artifact.

  5. Rochkiller commented on May 28, 2026

    @Rochkiller
    Author

    Sorry but I lose me here.
    I searched ytdl_hook.lua on my computer and didn't find it.

    So I retrieved this file : https://github.com/mpv-player/mpv/blob/master/player/lua/ytdl_hook.lua
    Put it in my scripts folder
    Did this modification : #17936 (comment)

    Did I do the right thing ?

    • If yes, that didn't solve my issue
    • If no, please give me instructions
  6. guidocella commented on May 28, 2026

    @guidocella
    Contributor

    You also need --ytdl=no.

  7. Rochkiller commented on May 28, 2026

    @Rochkiller
    Author

    I added print("DEBUG: ytdl_hook.lua loaded") at end of script to confirm its loading
    Outfile 0KiB and got this error :

    [recorder] Can't mux one of the input streams.
    Cache dumping stopped due to error.

    mpv --ytdl=no https://youtu.be/hrk8ZhjoB-Q

    [ytdl_hook] DEBUG: ytdl_hook.lua loaded
    [auto_profiles] Applying auto profile: youtube
    [osd/libass] fontselect: Using default font family: (mpv-osd-symbols, 400, 0) -> ArialMT, 0, ArialMT
    Not seekable, but enabling seeking on user request.
    ● --edition=0 '299 - 1920x1080 (1080p60) (null 60 fps 3353 kbps)'
    ○ --edition=1 '301 - 1920x1080 muxed-14 (null 60 fps) (null)'
    ○ --edition=2 '298 - 1280x720 (720p60) (null 60 fps 1605 kbps)'
    ○ --edition=3 '300 - 1280x720 muxed-12 (null 60 fps) (null)'
    ○ --edition=4 '18 - 640x360 (360p) muxed-11 (null 30 fps) (null 44100 Hz)'
    ○ --edition=5 '134 - 640x360 (360p) (null 30 fps 281 kbps)'
    ○ --edition=6 '93 - 640x360 muxed-9 (null 30 fps) (null)'
    ○ --edition=7 '160 - 256x144 (144p) (null 30 fps 111 kbps)'
    ○ --edition=8 '91 - 256x144 muxed-7 (null 30 fps) (null)'
    ● Video --vid=1 '299 - 1920x1080 (1080p60)' (null 1920x1080 60 fps 3353 kbps) [default]
    ○ Audio --aid=6 '251 - audio only (medium)' (null 48000 Hz 130 kbps)
    ● Audio --aid=7 '140 - audio only (medium)' (null 44100 Hz 129 kbps) [default]
    ○ Audio --aid=8 '139 - audio only (low)' (null 22050 Hz 48 kbps)
    File tags:
    Date: 20191121
    Title: NEW SONG BACK2BACK | DANUCD SKINS | Danucd
    Uploader: Danucd
    Channel_URL: https://www.youtube.com/channel/UCsIiIEGRoBILi8LSkWNPqXA
    [modernz] URL detected.
    [modernz] Approximating file size...
    [modernz] Executing: yt-dlp -f (bv*[vcodec~='^(av(0|c)1)']+ba[acodec^=mp4a])/b --no-download -O %(filesize,filesize_approx)s https://youtu.be/hrk8ZhjoB-Q
    AO: [wasapi] 48000Hz stereo 2ch float
    VO: [gpu-next] 1920x1080 yuv420p
    [osd/libass] fontselect: Using default font family: (mpv-osd-symbols, 400, 0) -> ArialMT, 0, ArialMT
    Cache dumping started.
    [recorder] Can't mux one of the input streams.
    Cache dumping stopped due to error.
    [modernz] Download size: 31.91 MiB
    AV: 00:00:07 / 00:01:17 (10%) A-V: 0.000 Cache: 69s/32MB
    Exiting... (Quit)

  8. guidocella commented on May 28, 2026

    @guidocella
    Contributor

    That is strange mpv --no-config https://youtu.be/hrk8ZhjoB-Q and dump-cache works for me with or without my PR. It seems the video codec is null in your case for some reason. Try updating yt-dlp.

  9. Rochkiller commented on May 28, 2026

    @Rochkiller
    Author

    I'm already on latest version

    yt-dlp -U

    Latest version: stable@2026.03.17 from yt-dlp/yt-dlp
    yt-dlp is up to date (stable@2026.03.17 from yt-dlp/yt-dlp)

    How did you dump-cache with no-config mpv ?

  10. guidocella commented on May 28, 2026

    @guidocella
    Contributor

    dump-cache 0 9 /tmp/foo.mkv

  11. Rochkiller commented on May 28, 2026

    @Rochkiller
    Author

    So, here what I did :

    input file created : mykeys.conf
    d dump-cache 0 9 C:/tmpvideo.mp4

    mpv --no-config --input-conf="C:/Program Files/mpv/mykeys.conf" https://youtu.be/hrk8ZhjoB-Q

    ● --edition=0 '299 - 1920x1080 (1080p60) (h264 60 fps 3353 kbps)'
    ○ --edition=1 '301 - 1920x1080 muxed-14 (h264 60 fps) (aac)'
    ○ --edition=2 '298 - 1280x720 (720p60) (h264 60 fps 1605 kbps)'
    ○ --edition=3 '300 - 1280x720 muxed-12 (h264 60 fps) (aac)'
    ○ --edition=4 '18 - 640x360 (360p) muxed-11 (h264 30 fps) (aac 44100 Hz)'
    ○ --edition=5 '134 - 640x360 (360p) (h264 30 fps 281 kbps)'
    ○ --edition=6 '93 - 640x360 muxed-9 (h264 30 fps) (aac)'
    ○ --edition=7 '160 - 256x144 (144p) (h264 30 fps 111 kbps)'
    ○ --edition=8 '91 - 256x144 muxed-7 (h264 30 fps) (aac)'
    ● Video --vid=1 '299 - 1920x1080 (1080p60)' (h264 1920x1080 60 fps 3353 kbps) [default]
    ○ Audio --aid=6 '251 - audio only (medium)' (opus 48000 Hz 130 kbps)
    ● Audio --aid=7 '140 - audio only (medium)' (aac 44100 Hz 129 kbps) [default]
    ○ Audio --aid=8 '139 - audio only (low)' (aac 22050 Hz 48 kbps)
    File tags:
    Date: 20191121
    Title: NEW SONG BACK2BACK | DANUCD SKINS | Danucd
    Uploader: Danucd
    Channel_URL: https://www.youtube.com/channel/UCsIiIEGRoBILi8LSkWNPqXA
    AO: [wasapi] 48000Hz stereo 2ch float
    VO: [gpu-next] 1920x1080 yuv420p
    Cache dumping started.
    [ffmpeg] mp4: track 1: codec frame size is not set
    [recorder] This is an experimental feature. Output files might be broken or not play correctly with various players (including mpv itself).
    [recorder] Discontinuity at timestamp 0.000000.
    Cache dumping successfully ended.
    AV: 00:00:10 / 00:01:17 (13%) A-V: 0.000 Cache: 66s/30MB
    Exiting... (Quit)

    Even if Cache dumping successfully ended., output file is too small (163KiB)

    For Kick live stream, got this error (output file empty 0KiB) :

    [ffmpeg] mp4: sample rate not set
    [recorder] Writing header failed.
    Cache dumping stopped due to error

    Tried with mkv, same happen :

    [ffmpeg] matroska: sample rate not set
    [recorder] Writing header failed.
    Cache dumping stopped due to error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions