-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Cycling through video tracks seeks forward, breaks video output or crashes #3392
Comments
I see no crashes here. Video track switching doesn't work ideally because it essentially just disables/enables returning packets mid-stream, instead of performing a seek to ensure consistent packets are returned. (This leads to the decoder outputting a bunch of error messages, until decoding can be resumed normally from the next key frame.) For mkv (with mpv's internal mkv demuxer) there is actually a mechanism that tries to deal with this, but apparently it doesn't work if there's no other stream that can serve as reference (like an audio stream). Not really a bug, but a feature request. |
I considered the But why does it work perfectly when cycling only between video tracks loaded from external files? Where's the difference that leads to cycling not working with the main input file? |
No, a crash means the OS kills the process due to an internal error.
Because external files are seeked when the first track from them is enabled. (They'd have the same issue if you played multiple streams from it.) |
Well, I'll probably try to come up with an improvement tomorrow. But before that: why do you even want to do this? Normally, video track switching is "good enough". |
I regularly encode videos and want to compare the source and output to make sure the quality is all right. Or compare two encodes to see how or if certain encoder settings make a difference in quality. |
That's rather questionable, but ok. Keep in mind that if the timestamps are even just a little different, switching video tracks might be off by a frame. |
mpv version and platform
on Manjaro 16.06.1 x64.
Also happens with the 2016-07-10 version from mpv.srsfckn.biz (mpv 0.18.1-git-1e00bcc / ffmpeg N-80954-g70d9b2e) on Windows 7 x64.
Reproduction steps
--no-audio
, reproduces it as well)mpv --no-config --force-window <videofile>
_
to cycle between vid 0 (no video output) and vid 1 (the video track of the input file)Actual behavior
Depending on the file, different problems occur when cycling back to vid 1. You can easily make out similarities, based on the container and video codec.
mkv+H.264: The player seeks forward several seconds (I assume until the next keyframe) and the following errors occur a varying number of times and in varying order:
mkv+MPEG-4: The player seeks forward several seconds and (some of) the following errors occur:
mp4: Sometimes same as mkv, but usually simply goes
[lavf] EOF reached.
and exitsavi: Same errors as with mkv, but doesn't seek forward. Instead video output becomes corrupted until the next keyframe.
When an audio track is active however, the player usually only seeks forward by one frame and no errors occur.
As it happens with a wide variety of file formats and with almost any video I tried, I don't think it is necessary to provide any example files.
Workaround
Say you want to use the cycle function to compare two video files,
a.mkv
andb.mkv
, load one of the files as both input and external-file:mpv --force-window --external-file a.mkv --external-file b.mkv a.mkv
Only cycle between the video tracks of the external files:
_ cycle-values "vid" 2 3
ininput.conf
None of the above errors ever occur and the player never seeks forward even a single frame, no matter how often you cycle the video track.
Log files
Full output of opening the player with an mkv+H.264 file (no audio) as input and cycling between vid 0 and 1 several times: http://sprunge.us/iNBZ
The text was updated successfully, but these errors were encountered: