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

[Windows] AviSynth input fails #5

Closed
qyot27 opened this issue Nov 29, 2012 · 9 comments
Closed

[Windows] AviSynth input fails #5

qyot27 opened this issue Nov 29, 2012 · 9 comments

Comments

@qyot27
Copy link
Contributor

qyot27 commented Nov 29, 2012

The script itself works in the usual apps (x264, FFmpeg itself, Windows Media Player...), but in MPV the script fails to render, resulting in the following error message:

mpv.exe -v -v test.avs
Using built-in default codecs.conf.
91 audio & 151 video codecs
Configuration: --prefix=/home/qyot27/mpv_build --disable-debug --enable-static --disable-caca --disable-xv --disable-vdpau --disable-vm --disable-xinerama --disable-x11 --disable-xshape --disable-jack --disable-alsa --disable-pulse --disable-portaudio --disable-rsound --disable-bluray --disable-dvdread --disable-pthreads --disable-avxsynth --disable-libbs2b --extra-cflags=-march=pentium3 -mtune=pentium3 --enable-cross-compile --target=i686-w64-mingw32
Command line: '-v' '-v' 'test.avs'
get_path('fonts') -> 'c:/Program Files/mpv-player/mpv/fonts'
get_path('fonts') -> 'c:/Program Files/mpv-player/mpv/fonts'
[ass] Raster: FreeType 2.4.10
[ass] Shaper: FriBidi 0.19.2 (SIMPLE)
[ass] Initialized
get_path('fonts') -> 'c:/Program Files/mpv-player/mpv/fonts'
get_path('subfont.ttf') -> 'c:/Program Files/mpv-player/mpv/subfont.ttf'
[ass] No usable fontconfig configuration file found, using fallback.
[ass] Updating font cache
get_path('input.conf') -> 'c:/Program Files/mpv-player/mpv/input.conf'
Input config file c:/Program Files/mpv-player/mpv/input.conf missing.
Input config file /home/qyot27/mpv_build/etc/mpv/input.conf missing.
Falling back on default (hardcoded) input config
get_path('test.avs.conf') -> 'c:/Program Files/mpv-player/mpv/test.avs.conf'
getch2: 6 can't get number of input events [disabling console input]

[[[init getch2]]]
Playing test.avs.
WINSOCK2 init: 0
[file] File size is 41 bytes
STREAM: [file] test.avs
STREAM: Description: File
STREAM: Author: Albeu
STREAM: Comment: based on the code from ??? (probably Arpi)
DEMUXER: freeing EDL demuxer at 0259f038
DEMUXER: freeing CUE demuxer at 0259f038
LAVF_check: AVISynth
Detected file format: AVISynth (libavformat)
41=mp_read(024fafd0, 0251e014, 32768), pos: 41, eof:1
Fontconfig error: Cannot load default config file
Fontconfig error: Cannot load default config file
[avs @ 01171860]File position before avformat_find_stream_info() is 0
[avs @ 01171860]All info found
mp_seek(024fafd0, 0, 65536)
mp_seek(024fafd0, 0, 65536)
mp_seek(024fafd0, 0, 65536)
[avs @ 01171860]File position after avformat_find_stream_info() is 0
==> Found video stream: 0
aspect= 608_0/(32_1)
======= VIDEO Format ======
biSize 49
biWidth 608
biHeight 32
biPlanes 0
biBitCount 32
biCompression 1095911234='BGRA'
biSizeImage 77824

Unknown extra header dump: [42] [6f] [74] [74] [6f] [6d] [55] [70] [0]

[lavf] stream 0: video (rawvideo), -vid 0
LAVF: 0 audio and 1 video streams found
LAVF: build 3548516
[ass] Raster: FreeType 2.4.10
[ass] Shaper: FriBidi 0.19.2 (SIMPLE)
[ass] Initialized
get_path('fonts') -> 'c:/Program Files/mpv-player/mpv/fonts'
get_path('subfont.ttf') -> 'c:/Program Files/mpv-player/mpv/subfont.ttf'
[ass] No usable fontconfig configuration file found, using fallback.
[ass] Updating font cache
Load subtitles in .
get_path('sub/') -> 'c:/Program Files/mpv-player/mpv/sub/'
get_path('sub/') -> 'c:/Program Files/mpv-player/mpv/sub/'
[stream] Video (+) --vid=0 (BGRA/rawvideo)
[V] filefmt:24 fourcc:0x41524742 size:608x32 fps:24.000 ftime:=0.0417
<vo_direct3d>Setting backbuffer dimensions to (1024x768).
<vo_direct3d>device_caps_power2_only 0, device_caps_square_only 0
<vo_direct3d>device_texture_sys 0
<vo_direct3d>max_texture_width 4096, max_texture_height 4096
aspect_save_screenres 1024x768
vo: win32: running at 1024x768 with depth 32
Opening video decoder: [ffmpeg] libavcodec video codecs
libavcodec.size: 0 x 0
Selected video codec: raw video [libavcodec]
Video codecs.conf entry: lavc (Generic libavcodec decoder) vfm: ffmpeg

*** uninit(0x0)
Audio: no audio
Starting playback...
demux_lavf_fill_buffer()
DEMUX: Append packet to d_video, len=77824 pts=0.000 pos=41 [packs: A=0 V=1]
[ffmpeg] aspect_ratio: 0.000000
VIDEO: 608x32 24.000 fps 14942.2 kbps (1867.8 kB/s)
VDec: vo config request - 608 x 32 (preferred colorspace: bgr32)
Trying filter chain: vo
<vo_direct3d>Accepted image format (StretchRect): bgr32
<vo_direct3d>Accepted image format (texture rendering): bgr32
<vo_direct3d>Accepted rendering methods for format='bgr32': StretchRect=0x16, Texture=0, Texture+Shader=0.
vo_debug: query(bgr32) returned 0x7 (i=0)
VDec: using bgr32 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO Config (608x32->608x32,flags=0,0x42475220)
VO: [direct3d] 608x32 => 608x32 bgr32
VO: Description: Direct3D 9 Renderer
VO: Author: Georgi Petrov (gogothebee) gogothebee@gmail.com and others
aspect_save_screenres 1024x768
aspect(0) fitin: 608x32 monitor_par: 1.00
aspect(1) wh: 608x32 (org: 608x32)
aspect(2) wh: 608x32 (org: 608x32)
<vo_direct3d>Accepted image format (StretchRect): bgr32
<vo_direct3d>Accepted image format (texture rendering): bgr32
<vo_direct3d>Accepted rendering methods for format='bgr32': StretchRect=0x16, Texture=0, Texture+Shader=0.
aspect_save_screenres 1024x768
[vo] reset window bounds: 204:340:616:64
[vo] move window: 208:368
[vo] resize window: 608:32
<vo_direct3d>Accepted image format (StretchRect): bgr32
<vo_direct3d>Accepted image format (texture rendering): bgr32
<vo_direct3d>Accepted rendering methods for format='bgr32': StretchRect=0x16, Texture=0, Texture+Shader=0.
<vo_direct3d>Using StretchRect.
<vo_direct3d>resize_d3d called.
<vo_direct3d>destroy_d3d_surfaces called.
<vo_direct3d>New backbuffer (1024x768), VO (608x32)
<vo_direct3d>create_d3d_surfaces called.
aspect(0) fitin: 608x32 monitor_par: 1.00
aspect(1) wh: 608x32 (org: 608x32)
aspect(2) wh: 608x32 (org: 608x32)
aspect(0) fitin: 608x32 monitor_par: 1.00
aspect(1) wh: 608x32 (org: 608x32)
aspect(2) wh: 608x32 (org: 608x32)
[vo] Window size: 608x32
[vo] Video source: 608x32 (608x32)
[vo] Video display: (0, 0) 608x32 -> (0, 0) 608x32
[vo] Video scale: 1.000000/1.000000
[vo] OSD borders: l=0 t=0 r=0 b=0
[vo] Video borders: l=0 t=0 r=0 b=0
<vo_direct3d>Video rectangle: t: 0, l: 0, r: 608, b:32
*** [vo] Exporting mp_image_t, 608x32x32bpp BGR packed, 77824 bytes
(imgfmt: 42475220, planes: 00000000,00000000,00000000 strides: 0,0,0, chroma: 0x0, shift: h:0,v:0)
*** ftime=0.000 ***
Fontconfig error: Cannot load default config file
Fontconfig error: Cannot load default config file

This also occurs in MPlayer2 (the 'solution' there was to force the use of -demuxer avs, which is obviously not an option here). Not sure if it happens in MPlayer. The script was serving YV12 at 1280x720; 608x32 and BGRA clearly means that AviSynth is throwing an error message of some sort, but the message isn't visible with the Direct3D renderer. Switching to -vo opengl, the error is visible:
Import: unable to locate "mp:test.avs" (try specifying a path)

I've tried fiddling with the path, but that doesn't resolve it. The mp: is still there, sometimes embedded in the middle of the path to the script (you can see this happen if you use ./ in front of the script name).

@0x09
Copy link

0x09 commented Nov 30, 2012

This is actually an issue with all mplayers. For some reason demux_lavf adds "mp:" to the start of filenames before sending it to libavformat. lavf file routines must skip over it somewhere. Since avisynth tries to open the path in fmtctx->filename this happens. Hopefully someone can give a suggestion.

[1]
[2]

This code is the same in mplayer and mplayer2.

@ghost
Copy link

ghost commented Nov 30, 2012

That is correct. The code for adding the "mp:" has always been in demux_lavf; I don't know why it's there, and it doesn't seem to be needed. I'll probably just remove it. It's not possible to use the ffmpeg avisynth demuxer otherwise.

qyot27, can you try changing the "mp:" to "" in demux_lavf?

I don't really get why it behaves differently with vo_direct3d and vo_opengl. It should always fail before initializing the VO, but with vo_direct3d the demuxer and VO seems to initialize. Are you sure you didn't change other things on the command line too? Couldn't test it myself.

@qyot27
Copy link
Contributor Author

qyot27 commented Nov 30, 2012

I'd tried with vanilla builds also, but the only other patches I'd applied to that particular build were a couple of version reporting changes, 12/14bit YUV stubs so I could handle 12/14-bit h264 (and getting the decoded result of those files from VapourSynth to MPV via y4m), and a modified version of the discrete AvxSynth demuxer patch that 0x09 has in the avxsynth/osx branch (which works fine in my builds of MPlayer2 but segfaults for me when I shifted it to MPV). The first three I pushed out to my branch (https://github.com/qyot27/mpv), the modified AvxSynth patch is here: https://gist.github.com/4170453

I'll try the change in demux_lavf and see.

@qyot27
Copy link
Contributor Author

qyot27 commented Nov 30, 2012

Confirmed. Changing "mp:" to "" in demux_lavf.c fixes it. Scripts now play correctly using libavformat.

@ghost
Copy link

ghost commented Nov 30, 2012

qyot27, does it work or not? Looks like you deleted your reply that said that it works.

You deleted your other reply too. This doesn't have to do with this bug report, but I think I want to merge the commits "Add support for 12 and 14 bit YUV colorspaces." and "Identify the build time of the binary in the versioning output.". Is that ok?

And the different/unexpected behavior with vo_direct3d remains a mystery.

@qyot27
Copy link
Contributor Author

qyot27 commented Nov 30, 2012

I didn't delete them, something's going wrong with the comment box. I had this problem last night, too.

@ghost
Copy link

ghost commented Nov 30, 2012

Your comments appeared again (what the hell, github...)

Pushed a working branch to https://github.com/wm4/mpv/commits/dev . This should fix the avs issue plus additional stuff. (Also merges the two commits I mentioned, with some modifications.) Thanks!

@0x09
Copy link

0x09 commented Dec 3, 2012

It turns out that the 'mp:' thing was just a leftover from this very old change away from the ffurl api: de4908b so it's definitely ok to remove. ed: already said in the commit message, how embarrassing ( . _.)

@ghost ghost closed this as completed in aa2c075 Dec 3, 2012
@ghost
Copy link

ghost commented Dec 3, 2012

Thanks for the hint.

@ghost ghost mentioned this issue Aug 18, 2017
martinetd added a commit to martinetd/mpv that referenced this issue Mar 4, 2018
This allows command arguments to use more fancy positioning,
like --ab-loop-a=10% or --ab-loop-b=mpv-player#5
martinetd added a commit to martinetd/mpv that referenced this issue Mar 9, 2018
This allows command arguments to use more fancy positioning,
like --ab-loop-a=10% or --ab-loop-b=mpv-player#5
martinetd added a commit to martinetd/mpv that referenced this issue Mar 9, 2018
This allows command arguments to use more fancy positioning,
like --ab-loop-a=10% or --ab-loop-b=mpv-player#5
martinetd added a commit to martinetd/mpv that referenced this issue Mar 10, 2018
This allows command arguments to use more fancy positioning,
like --ab-loop-a=10% or --ab-loop-b=mpv-player#5
martinetd added a commit to martinetd/mpv that referenced this issue Mar 11, 2018
This allows command arguments to use more fancy positioning,
like --ab-loop-a=10% or --ab-loop-b=mpv-player#5
martinetd added a commit to martinetd/mpv that referenced this issue Jun 4, 2018
This allows command arguments to use more fancy positioning,
like --ab-loop-a=10% or --ab-loop-b=mpv-player#5
martinetd added a commit to martinetd/mpv that referenced this issue Feb 6, 2019
This allows command arguments to use more fancy positioning,
like --ab-loop-a=10% or --ab-loop-b=mpv-player#5
@ghost ghost mentioned this issue Feb 28, 2022
12 tasks
xfangfang pushed a commit to xfangfang/mpv that referenced this issue Jun 23, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants