How to check if you media file (audio, video, etc.) has some error without actually viewing it for yourself. Just performing a background check. The video.mkv has a duration of 1h 37min 32s. I'm running the command from Cygwin and the ffmpeg build is for Microsoft Windows.
time mplayer.exe -noquiet -speed 100 -ao null -vo null -ss 0 video.mkv 1>stdout-CR.txt 2>stderr.txt
real 20m36.996s
user 0m0.046s
sys 0m0.000s
Normal output goes to stdout.txt and error (if exists) goes to stderr.txt file. You could also change the CR (0x0D) line terminators used in stdout when logging the video and audio frames part (ffmpeg uses it in the terminal to keep displaying frames progress without paging down the terminal so overwrites instead the same line), and replace it with LF (0x0A):
tr '\r' '\n' < stdout-CR.txt > stdout.txt
Note that the stdout files can be very large in size, in my case 40 GB for 1 hour and 40 minutes of video, so it's much better to process the CR inline and then if possible gzip or bzip2 the file before saving to drive.
This is the output in my case:
stdout.txt:
MPlayer sherpya-r38328+g30322ebe3c-10-win32 (C) 2000-2021 MPlayer Team
Playing video.mkv.
libavformat version 59.10.100 (internal)
libavformat file format detected.
[lavf] stream 0: video (hevc), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang eng
VIDEO: [HEVC] 960x720 0bpp 23.810 fps 0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 59.15.102 (internal)
Selected video codec: [ffhevc] vfm: ffmpeg (FFmpeg HEVC / H.265)
==========================================================================
Clip info:
encoder: libebml v1.3.3 + libmatroska v1.4.4
creation_time: 2017-03-12T19:02:38.000000Z
Load subtitles in ./
Load subtitles in C:\cygwin64\home\user/mplayer/sub/
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, floatle, 0.0 kbit/0.00% (ratio: 0->352800)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [null] 44100Hz 2ch floatle (4 bytes per sample)
Starting playback...
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [null] 960x720 => 960x720 Planar 444P 10-bit little-endian
A: 0.1 V: 0.0 A-V: 0.094 ct: 0.009 0/ 0 ??% ??% ??,?% 0 0 4.35x
[...]
A:5374.9 V:1112.8 A-V:4262.073 ct:2097151.875 0/ 0 0% 0% 0.0% 103953 0 4
Exiting... (End of file)
stderr.txt:
************************************************
**** Your system is too SLOW to play this! ****
************************************************
Possible reasons, problems, workarounds:
- Most common: broken/buggy _audio_ driver
- Try -ao sdl or use the OSS emulation of ALSA.
- Experiment with different values for -autosync, 30 is a good start.
- Slow video output
- Try a different -vo driver (-vo help for a list) or try -framedrop!
- Slow CPU
- Don't try to play a big DVD/DivX on a slow CPU! Try some of the lavdopts,
e.g. -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all.
- Broken file
- Try various combinations of -nobps -ni -forceidx -mc 0.
- Slow media (NFS/SMB mounts, DVD, VCD etc)
- Try -cache 8192.
- Are you using -cache to play a non-interleaved AVI file?
- Try -nocache.
Read DOCS/HTML/en/video.html for tuning/speedup tips.
If none of this helps you, read DOCS/HTML/en/bugreports.html.
Possibly bad interleaving detected.
Use -ni option if this causes playback issues and avoid or fix the program that created the file.
Too many buffered pts
[...]
Too many buffered pts
The warning that the system is slow is because we requested the fastest playback speed possible (100x).
Clearly we can see that there is the error "Possibly bad interleaving detected." which means the video is not right. In fact, if I play it with any media player, at time 18min 31s it jumps directly to 26min 34s and the audio continues playing at that point but not the video. So obviously it was not muxed properly.
I've tried using ffmpeg for this but didn't get it to throw any error.
You can also run in batch mode for several files in a folder:
time for i in *.mkv ; do echo "Testing: $i" && mplayer.exe -speed 100 -ao null -vo null -ss 0 "$i" | tr '\r' '\n'>"$i.stdout" 2>"$i.stderr" ; done
Another way to test it:
time mplayer.exe -benchmark -tskeepbroken -mc 0 -vo null -ao null movie.mkv
| tr '\r' '\n'>stdout.txt 2>stderr.txt real 89m35.939s user 0m0.031s sys 0m0.000s
stdout.txt:
MPlayer sherpya-r38328+g30322ebe3c-10-win32 (C) 2000-2021 MPlayer Team
Playing movie.mkv.
libavformat version 59.10.100 (internal)
libavformat file format detected.
[lavf] stream 0: video (hevc), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang eng
VIDEO: [HEVC] 960x720 0bpp 23.810 fps 0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 59.15.102 (internal)
Selected video codec: [ffhevc] vfm: ffmpeg (FFmpeg HEVC / H.265)
==========================================================================
Clip info:
encoder: libebml v1.3.3 + libmatroska v1.4.4
creation_time: 2017-03-12T19:02:38.000000Z
Load subtitles in ./
Load subtitles in C:\cygwin64\home\user/mplayer/sub/
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, floatle, 0.0 kbit/0.00% (ratio: 0->352800)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [null] 44100Hz 2ch floatle (4 bytes per sample)
Starting playback...
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [null] 960x720 => 960x720 Planar 444P 10-bit little-endian
A: 0.0 V: 0.0 A-V: 0.044 ct: 0.000 0/ 0 ??% ??% ??,?% 0 0
[...]
A:5375.6 V:1112.8 A-V:4262.784 ct: 0.000 0/ 0 2% 0% 0.0% 6960 0
BENCHMARKs: VC: 113.302s VO: 0.042s A: 1.618s Sys: 965.784s = 1080.746s
BENCHMARK%: VC: 10.4837% VO: 0.0039% A: 0.1497% Sys: 89.3627% = 100.0000%
Exiting... (End of file)
stderr.txt:
Possibly bad interleaving detected.
Use -ni option if this causes playback issues and avoid or fix the program that created the file.
Too many buffered pts (102022 times)
************************************************
**** Your system is too SLOW to play this! ****
************************************************
Possible reasons, problems, workarounds:
- Most common: broken/buggy _audio_ driver
- Try -ao sdl or use the OSS emulation of ALSA.
- Experiment with different values for -autosync, 30 is a good start.
- Slow video output
- Try a different -vo driver (-vo help for a list) or try -framedrop!
- Slow CPU
- Don't try to play a big DVD/DivX on a slow CPU! Try some of the lavdopts,
e.g. -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all.
- Broken file
- Try various combinations of -nobps -ni -forceidx -mc 0.
- Slow media (NFS/SMB mounts, DVD, VCD etc)
- Try -cache 8192.
- Are you using -cache to play a non-interleaved AVI file?
- Try -nocache.
Read DOCS/HTML/en/video.html for tuning/speedup tips.
If none of this helps you, read DOCS/HTML/en/bugreports.html.
It's highly recommended to use mplayer natively on GNU/Linux rather than Windows, since it's more updated and integrates much better with the system.
Links
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.