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

EDL seeking fails in encoding mode #4688

Closed
lachs0r opened this issue Jul 29, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@lachs0r
Copy link
Member

commented Jul 29, 2017

mpv version and platform

mpv 0.26.0-52-g37b7b32d61 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       55.58.100
   libavcodec      57.89.100
   libavformat     57.71.100
   libswscale      4.6.100
   libavfilter     6.82.100
   libswresample   2.7.100
ffmpeg version: 3.3.2

Can also reproduce on FFmpeg git master.

Reproduction steps

mpv 'edl://%22%https://0x0.st/kco.mkv,start=1' -o test.mkv

Expected behavior

mpv encodes the file starting at the first second.

Actual behavior

mpv does not initialize audio encoding and fails to produce any output.
Depending on the start time, it may randomly succeed or fail, even with the same command run multiple times.

Log file

[   0.004][v][cplayer] mpv 0.26.0-52-g37b7b32d61 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
[   0.004][v][cplayer]  built on UNKNOWN
[   0.004][v][cplayer] ffmpeg library versions:
[   0.004][v][cplayer]    libavutil       55.58.100
[   0.004][v][cplayer]    libavcodec      57.89.100
[   0.004][v][cplayer]    libavformat     57.71.100
[   0.004][v][cplayer]    libswscale      4.6.100
[   0.004][v][cplayer]    libavfilter     6.82.100
[   0.004][v][cplayer]    libswresample   2.7.100
[   0.004][v][cplayer] ffmpeg version: 3.3.2
[   0.004][v][cplayer] 
[   0.004][v][cplayer] Configuration: ./waf configure --prefix=/usr --bindir=/usr/bin --mandir=/usr/share/man --libdir=/usr/lib64 --docdir=/usr/share/doc/packages/mpv --confdir=/etc/mpv --enable-cdda --enable-dvdread --enable-dvdnav --enable-libmpv-shared --enable-zsh-comp --enable-manpage-build --enable-libarchive --enable-dvbin --disable-sdl1 --disable-sdl2 --disable-build-date --disable-debug
[   0.004][v][cplayer] List of enabled features: 51fbsd alsa asm atomics avutil-imgcpy-uc caca cdda cplayer cplugins cuda-hwaccel drm dvbin dvdnav dvdread dvdread-common egl-drm egl-helpers egl-x11 encoding fchmod gbm gbm.h gl gl-wayland gl-x11 glibc-thread-name gnuc iconv is_ffmpeg jack jpeg lcms2 libarchive libass libass-osd libav libavcodec libavdevice libbluray libdl libm libmpv-shared librt linux-fstatfs lua nanosleep optimize oss-audio plain-gl posix posix-or-mingw posix-spawn pthreads pulse rubberband shm stdatomic termios uchardet vaapi vaapi-drm vaapi-egl vaapi-glx vaapi-hwaccel vaapi-wayland vaapi-x-egl vaapi-x11 vdpau vdpau-gl-x11 vdpau-hwaccel vt.h wayland x11 xv zlib zsh-comp
[   0.004][v][cplayer] Command line options: '--no-config' '--no-load-scripts' 'edl://%22%https://0x0.st/kco.mkv,start=1' '-o' 'test.mkv' '--log-file' 'test.log'
[   0.004][v][cplayer] mpv 0.26.0-52-g37b7b32d61 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
[   0.004][v][cplayer]  built on UNKNOWN
[   0.004][v][cplayer] ffmpeg library versions:
[   0.004][v][cplayer]    libavutil       55.58.100
[   0.004][v][cplayer]    libavcodec      57.89.100
[   0.004][v][cplayer]    libavformat     57.71.100
[   0.004][v][cplayer]    libswscale      4.6.100
[   0.004][v][cplayer]    libavfilter     6.82.100
[   0.004][v][cplayer]    libswresample   2.7.100
[   0.004][v][cplayer] ffmpeg version: 3.3.2
[   0.004][v][cplayer] 
[   0.004][v][cplayer] Configuration: ./waf configure --prefix=/usr --bindir=/usr/bin --mandir=/usr/share/man --libdir=/usr/lib64 --docdir=/usr/share/doc/packages/mpv --confdir=/etc/mpv --enable-cdda --enable-dvdread --enable-dvdnav --enable-libmpv-shared --enable-zsh-comp --enable-manpage-build --enable-libarchive --enable-dvbin --disable-sdl1 --disable-sdl2 --disable-build-date --disable-debug
[   0.004][v][cplayer] List of enabled features: 51fbsd alsa asm atomics avutil-imgcpy-uc caca cdda cplayer cplugins cuda-hwaccel drm dvbin dvdnav dvdread dvdread-common egl-drm egl-helpers egl-x11 encoding fchmod gbm gbm.h gl gl-wayland gl-x11 glibc-thread-name gnuc iconv is_ffmpeg jack jpeg lcms2 libarchive libass libass-osd libav libavcodec libavdevice libbluray libdl libm libmpv-shared librt linux-fstatfs lua nanosleep optimize oss-audio plain-gl posix posix-or-mingw posix-spawn pthreads pulse rubberband shm stdatomic termios uchardet vaapi vaapi-drm vaapi-egl vaapi-glx vaapi-hwaccel vaapi-wayland vaapi-x-egl vaapi-x11 vdpau vdpau-gl-x11 vdpau-hwaccel vt.h wayland x11 xv zlib zsh-comp
[   0.004][v][cplayer] Setting option 'vo' = 'lavc' (flags = 4)
[   0.004][v][cplayer] Setting option 'ao' = 'lavc' (flags = 4)
[   0.004][v][cplayer] Setting option 'keep-open' = 'no' (flags = 4)
[   0.004][v][cplayer] Setting option 'force-window' = 'no' (flags = 4)
[   0.004][v][cplayer] Setting option 'gapless-audio' = 'yes' (flags = 4)
[   0.004][v][cplayer] Setting option 'resume-playback' = 'no' (flags = 4)
[   0.004][v][cplayer] Setting option 'load-scripts' = 'no' (flags = 4)
[   0.004][v][cplayer] Setting option 'osc' = 'no' (flags = 4)
[   0.004][v][cplayer] Setting option 'framedrop' = 'no' (flags = 4)
[   0.004][v][cplayer] Setting option 'config' = 'no' (flags = 8)
[   0.004][v][cplayer] Setting option 'load-scripts' = 'no' (flags = 8)
[   0.004][v][cplayer] Setting option 'o' = 'test.mkv' (flags = 8)
[   0.004][v][cplayer] Setting option 'log-file' = 'test.log' (flags = 8)
[   0.005][v][global] user path: 'test.log' -> 'test.log'
[   0.005][v][ytdl_hook] Loading lua script @ytdl_hook.lua...
[   0.005][v][ytdl_hook] loading mp.defaults
[   0.006][v][ytdl_hook] loading @ytdl_hook.lua
[   0.006][v][ytdl_hook] lua-settings/ytdl_hook.conf not found. 
[   0.006][v][cplayer] Run command: hook-add, flags=0, args=[on_load, 1, 10]
[   0.006][v][cplayer] Run command: hook-add, flags=0, args=[on_preloaded, 2, 10]
[   0.006][v][cplayer] Done loading @ytdl_hook.lua.
[   0.006][v][cplayer] Setting option 'vo' = 'lavc' (flags = 4)
[   0.006][v][cplayer] Setting option 'ao' = 'lavc' (flags = 4)
[   0.006][v][cplayer] Setting option 'keep-open' = 'no' (flags = 4)
[   0.006][v][cplayer] Setting option 'force-window' = 'no' (flags = 4)
[   0.006][v][cplayer] Setting option 'gapless-audio' = 'yes' (flags = 4)
[   0.006][v][cplayer] Setting option 'resume-playback' = 'no' (flags = 4)
[   0.006][v][cplayer] Setting option 'load-scripts' = 'no' (flags = 4)
[   0.006][v][cplayer] Setting option 'osc' = 'no' (flags = 4)
[   0.006][v][cplayer] Setting option 'framedrop' = 'no' (flags = 4)
[   0.006][i][cplayer] Playing: edl://%22%https://0x0.st/kco.mkv,start=1
[   0.006][v][cplayer] Running hook: ytdl_hook/on_load
[   0.006][v][cplayer] Run command: hook-ack, flags=0, args=[on_load]
[   0.007][v][edl] Opening edl://%22%https://0x0.st/kco.mkv,start=1
[   0.007][v][edl] Stream opened successfully.
[   0.007][v][demux] Trying demuxers for level=request.
[   0.007][v][demux] Detected file format: Edit decision list
[   0.007][v][demux] Stream is not seekable.
[   0.007][v][demux] Opening segment 0...
[   0.007][v][ffmpeg] Opening https://0x0.st/kco.mkv
[   0.210][v][ffmpeg] Mime-type: 'video/x-matroska'
[   0.210][v][ffmpeg] Stream opened successfully.
[   0.210][v][cache] no backbuffer needed
[   0.210][v][cache] Cache size set to 64 KiB (32 KiB backbuffer)
[   0.210][v][demux] Trying demuxers for level=normal.
[   0.210][v][cache] EOF reached.
[   0.211][v][mkv] Found the head...
[   0.211][v][mkv] + a segment...
[   0.211][v][mkv] Parsing seek head...
[   0.211][v][mkv] |+ segment information...
[   0.211][v][mkv] | + muxing app: Lavf57.71.100
[   0.211][v][mkv] | + writing app: Lavf57.71.100
[   0.211][v][mkv] | + timecode scale: 1000000
[   0.211][v][mkv] | + duration: 2.008s
[   0.211][v][mkv] | + segment uid 23 32 91 96 a7 35 8b 2f 98 9b 91 9d b9 14 0e 9a
[   0.211][v][mkv] |+ segment tracks...
[   0.211][v][mkv] | + a track...
[   0.211][v][mkv] |  + Track number: 1
[   0.211][v][mkv] |  + Track type: Audio
[   0.211][v][mkv] |  + Audio track
[   0.211][v][mkv] |   + Sampling frequency: 48000.000000
[   0.211][v][mkv] |   + Bit depth: 32
[   0.211][v][mkv] |   + Channels: 2
[   0.211][v][mkv] |  + Codec ID: A_OPUS
[   0.211][v][mkv] |  + CodecPrivate, length 19
[   0.211][v][mkv] |  + Language: und
[   0.211][v][mkv] | + a track...
[   0.211][v][mkv] |  + Track number: 2
[   0.211][v][mkv] |  + Track type: Video
[   0.211][v][mkv] |  + Video track
[   0.211][v][mkv] |   + Pixel width: 1280
[   0.211][v][mkv] |   + Pixel height: 720
[   0.211][v][mkv] |    + Matrix: bt.709
[   0.211][v][mkv] |    + Levels: limited
[   0.211][v][mkv] |  + Codec ID: V_VP9
[   0.211][v][mkv] |  + Language: und
[   0.211][v][mkv] |  + Default duration: 1.000ms ( = 1000.000 fps)
[   0.211][v][mkv] |+ found cluster
[   0.211][v][mkv] Deferring reading cues.
[   0.211][v][mkv] All headers are parsed!
[   0.211][v][demux] Detected file format: Matroska
[   0.211][v][cache] blocking for STREAM_CTRL 6
[   0.211][v][timeline] Timeline segments:
[   0.211][v][timeline]   0:     0.000000 [    1.000000] (0 1) 0:'https://0x0.st/kco.mkv'
[   0.211][v][timeline] Total duration: 1.008000
[   0.211][v][demux] Detected file format: mkv (timeline segments)
[   0.211][v][cplayer] Opening done: edl://%22%https://0x0.st/kco.mkv,start=1
[   0.211][v][cplayer] Running hook: ytdl_hook/on_preloaded
[   0.211][v][cplayer] Run command: hook-ack, flags=0, args=[on_preloaded]
[   0.211][i][cplayer]  (+) Video --vid=1 (*) (vp9 1280x720 1000.000fps)
[   0.211][i][cplayer]  (+) Audio --aid=1 (*) (opus 2ch 48000Hz)
[   0.211][v][vd] Container reported FPS: 1000.000000
[   0.212][v][vd] Codec list:
[   0.212][v][vd]     vp9 - Google VP9
[   0.212][v][vd]     libvpx-vp9 (vp9) - libvpx VP9
[   0.212][v][vd]     vp9_cuvid (vp9) - Nvidia CUVID VP9 decoder
[   0.212][v][vd] Opening video decoder vp9
[   0.212][v][vd] Using software decoding.
[   0.212][v][vd] Detected 8 logical cores.
[   0.212][v][vd] Requesting 9 threads for decoding.
[   0.212][v][vd] Selected video codec: vp9 (Google VP9)
[   0.212][v][ad] Codec list:
[   0.212][v][ad]     opus - Opus
[   0.212][v][ad]     libopus (opus) - libopus Opus
[   0.212][v][ad] Opening audio decoder opus
[   0.212][v][ad] Requesting 1 threads for decoding.
[   0.212][v][ad] Selected audio codec: opus (Opus)
[   0.212][v][cplayer] Starting playback...
[   0.212][v][timeline] switch to segment 0
[   0.212][v][mkv] queuing seek to 0.000000
[   0.212][v][mkv] execute seek (to 1.000000 flags 40)
[   0.212][v][mkv] Seeking to 4560 to read header element 0x1c53bb6b.
[   0.212][v][mkv] Parsing cues...
[   0.212][w][mkv] Discarding potentially broken or useless index.
[   0.212][v][mkv] creating index until TC 1005000000
[   0.212][v][mkv] seek done
[   0.213][v][mkv] EOF reached.
[   0.213][v][timeline] EOF reached.
[   0.216][v][vd] Decoder format: 1280x720 [0:1] yuv420p bt.709/auto/auto/limited CL=unknown
[   0.216][v][vd] Using container aspect ratio.
[   0.220][v][vf] Video filter chain:
[   0.220][v][vf]   [in] 1280x720 yuv420p bt.709/bt.709/bt.1886/limited SP=1.000000 CL=unknown
[   0.220][v][vf]   [out] 1280x720 yuv420p bt.709/bt.709/bt.1886/limited SP=1.000000 CL=unknown
[   0.220][i][cplayer] VO: [lavc] 1280x720 yuv420p
[   0.220][v][cplayer] VO: Description: video encoding using libavcodec
[   0.220][i][encode-lavc] option --ofps not specified and fps could not be inferred, using guess of 24000/1
[   0.220][v][encode-lavc] setting value '+global_header' for key 'flags'
[   0.220][i][encode-lavc] Opening video encoder: libvpx VP9 [libvpx-vp9]
[   0.220][v][ffmpeg] libvpx-vp9: v1.6.1
[   0.220][v][ffmpeg] libvpx-vp9: --prefix=/usr --libdir=/usr/lib64 --enable-unit-tests --enable-debug --enable-shared --disable-static --enable-vp8 --enable-vp9 --enable-postproc --enable-multithread --enable-experimental --enable-spatial-svc --extra-cflags=-std=gnu89 -U_FORTIFY_SOURCE -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g --extra-cxxflags=-U_FORTIFY_SOURCE -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g --enable-pic
[   0.228][v][cplayer] set video colors output-levels=0 
[   0.228][v][cplayer] Video attribute 'output-levels' is not supported by selected vo.
[   0.228][e][encode-lavc] no audio stream succeeded - invalid codec?
[   0.229][i][encode-lavc] vo-lavc: encoded 0 bytes
[   0.229][i][encode-lavc] ao-lavc: encoded 0 bytes
[   0.229][w][vo/lavc] NOTE: skipped initial video frame (probably because audio is not there yet)
[   0.229][v][cplayer] first video frame after restart shown
[   0.229][v][cplayer] EOF code: 6  
[   0.229][v][ad] Uninit audio decoder.
[   0.229][v][vd] Uninit video.
[   0.230][v][cache] Terminating cache...
[   0.230][v][cache] Cache exiting...
[   0.231][v][cplayer] finished playback, success (reason 3)
[   0.231][i][cplayer] 
[   0.231][i][cplayer] 
[   0.231][i][cplayer] Exiting... (Quit)
[   0.231][v][ytdl_hook] Exiting...

Sample files

https://0x0.st/kco.mkv

Notes

The use case is seeking to a position in a file and then using the afade audio filter to create a fade-in effect. This does not work with regular --start because the audio filter runs from the nearest keyframe, hence the fade will often start before the first output video frame. It does work with EDL cutting, however.

@wm4 wm4 closed this in 0e0b87b Aug 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.