Opened 5 months ago

Last modified 4 months ago

#2348 new defect

-vo png does not create any output

Reported by: drhex Owned by: beastd
Priority: normal Component: undetermined
Version: 1.3 Severity: normal
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

% mplayer -quiet -nolirc -nojoystick -nosound -vo png:z=0:outdir=/tmp/dump -frames 4 -zoom -xy 256 /path/to/my/videofile.mp4

I'm trying (on ubuntu 18.04) to extract a few frames from a videofile into png files in directory /tmp/dump.
This worked fine in mplayer 1.2.1 but not in 1.3
Starting simply "mplayer /path/to/my/videofile.mp4" plays it fine, so it is the png part that causes the problem (the same problem regardless of which video file I try to play)
The output directory /tmp/dump is created by mplayer (but remains empty).
Mplayer also creates a folder called '(null)' in the current directory (this folder also remains empty)
Running mplayer via strace reveals that it successfully find and opens "/usr/lib/x86_64-linux-gnu/libpng16.so.16"
The error messages I get on the console are:
png: output directory: (null)
[png @ 0x7fe63e248920]The encoder timebase is not set.
FATAL: Cannot initialize video driver.

I also get these warnings despite having specified compression level 0 explicitly:
[VO_PNG] Warning: compression level set to 0, compression disabled!
[VO_PNG] Info: Use -vo png:z=<n> to set compression level from 0 to 9.
[VO_PNG] Info: (0 = no compression, 1 = fastest, lowest - 9 best, slowest compression)

Mplayer outputs
png: output directory: /tmp/dump
once, but then keeps saying
png: output directory: (null)

Change History (2)

comment:1 Changed 4 months ago by reimar

Please provide the FULL output, there might things we are missing with the incomplete and out-of-order summary you gave.
The warnings are intentional, they try to tell you that z=0 is a really bad value to choose. They are repeated because initializing the vo fails over and over (which also seems to cause the output directory null thing).
We don't use libpng in libvo anymore.

[png @ 0x7fe63e248920]The encoder timebase is not set.

This is from libavcodec, not libpng. It seems libavcodec was updated, but MPlayer wasn't updated to include r37882 which fixes this.
That patch missing is likely the underlying cause for this issue.

comment:2 Changed 4 months ago by drhex

Is z=0 a "really bad value" if you want the fastest output?
A full output, as requested:

>mplayer -quiet -nolirc -nojoystick -nosound -vo png:z=0:outdir=/tmp/dump -frames 4 -zoom -xy 256 /path/to/my/videofile.mp4                                  20:04:09
MPlayer 1.3.0 (Debian), built with gcc-7 (C) 2000-2016 MPlayer Team

Playing /path/to/my/videofile.mp4.
libavformat version 57.83.100 (external)
libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f24233162a0]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  1280x720  24bpp  25.000 fps  2698.8 kbps (329.4 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 57.107.100 (external)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Clip info:
 major_brand: isom
 minor_version: 512
 compatible_brands: isomiso2avc1mp41
 encoder: Lavf53.21.1
Load subtitles in /path/to/my/
Audio: no sound
Starting playback...
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
[swscaler @ 0x7f24237de020]bicubic scaler, from yuv420p to rgb24 using MMXEXT
VO: [png] 256x144 => 256x144 RGB 24-bit  [zoom]
[VO_PNG] Warning: compression level set to 0, compression disabled!
[VO_PNG] Info: Use -vo png:z=<n> to set compression level from 0 to 9.
[VO_PNG] Info: (0 = no compression, 1 = fastest, lowest - 9 best, slowest compression)
png: /tmp/dump - Output directory successfully created.
[png @ 0x7f2422685920]The encoder timebase is not set.
FATAL: Cannot initialize video driver.
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [png] 256x144 => 256x144 RGB 24-bit  [zoom]
[VO_PNG] Warning: compression level set to 0, compression disabled!
[VO_PNG] Info: Use -vo png:z=<n> to set compression level from 0 to 9.
[VO_PNG] Info: (0 = no compression, 1 = fastest, lowest - 9 best, slowest compression)
png: (null) - Output directory successfully created.
[png @ 0x7f2422685920]The encoder timebase is not set.
FATAL: Cannot initialize video driver.
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [png] 256x144 => 256x144 RGB 24-bit  [zoom]
[VO_PNG] Warning: compression level set to 0, compression disabled!
[VO_PNG] Info: Use -vo png:z=<n> to set compression level from 0 to 9.
[VO_PNG] Info: (0 = no compression, 1 = fastest, lowest - 9 best, slowest compression)
png: output directory: (null)
Note: See TracTickets for help on using tickets.