Log in

View Full Version : VSPipe - FFMPEG: Invalid data found when processing input


RGMOfficial
18th July 2022, 18:24
Help me.
I've been using Vapoursynth for the first times, and FFMPEG is only causing error with my vspipe.

Command:
vspipe Kodocha_Restoration.vpy - -c y4m | ffmpeg -i - -i "C:\Users\RGM\Downloads\DISC1_t05.mkv" -c:v libx264 -preset slow -crf 16 -c:a flac -compression_level 8 -pix_fmt yuv420p -aspect 4:3 -report "KodochaRestorationTest.mkv" -y

Script:
import vapoursynth as vs
from vapoursynth import core

import kagefunc as kgf
import havsfunc as haf
import dfmderainbow as dfm
import ASTDR
import jvsfunc
import lvsfunc
from vsutil import *

src = core.ffms2.Source(source=r'C:\Users\RGM\Downloads\DISC1_t05.mkv')

#rainbow = ASTDR.ASTDR(src, strength=20, tempsoftth=3, tempsoftrad=1, tempsoftsc=1)
rainbow = dfm.DFMDerainbow(src, maskthresh=10, mask=False, interlaced=True, radius=1)
dot = core.tcomb.TComb(rainbow, mode=2, fthreshl=9, fthreshc=9, othreshl=6, othreshc=6, map=False, scthresh=12.0)
#dot = core.tcomb.TComb(src, mode=0, fthreshl=4, fthreshc=5, othreshl=5, othreshc=6, map=False, scthresh=12.0)

#video = core.vivtc.VFM(dot,order=1,field=0)
#video = haf.QTGMC(dot, NoiseProcess=0)
#decim = core.vivtc.VDecimate(video)
video = haf.QTGMC(dot,Preset='Slow',TFF=True)
video = haf.srestore(video,frate=24.000/1.001,speed=-1,thresh=8)
video = core.std.SetFieldBased(video, 0)
vinv = jvsfunc.vinverse(video)

#dehalo = vinv
dehalo = lvsfunc.dehalo.masked_dha(vinv, ref=None, rx=1.77, ry=1.77, brightstr=1.0, darkstr=0.0, lowsens=50, highsens=50, rfactor=3.0, maskpull=48, maskpush=192, show_mask=False)
dehalo = lvsfunc.dehalo.fine_dehalo(dehalo, rx=2.2, ry=2.2)

#qtgmc = haf.QTGMC(vinv, Preset="Slow", NoisePreset="Slower", InputType=1, TR0=2, TR1=0, TR2=3, ThSAD2=96, NoiseProcess=1, Sigma=10, NoiseRestore=0, GrainRestore=0, DenoiseMC=True)

#crop = core.std.Crop(vinv, top=0, bottom=0, left=8, right=8)
#bicubic = core.resize.Bicubic(crop, 704, 528)
final = dehalo
final.set_output()

FFMPEG Log:
ffmpeg started on 2022-07-18 at 14:21:51
Report written to "ffmpeg-20220718-142151.log"
Log level: 48
ffmpeg version 5.0.1-essentials_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
libavutil 57. 17.100 / 57. 17.100
libavcodec 59. 18.100 / 59. 18.100
libavformat 59. 16.100 / 59. 16.100
libavdevice 59. 4.100 / 59. 4.100
libavfilter 8. 24.100 / 8. 24.100
libswscale 6. 4.100 / 6. 4.100
libswresample 4. 3.100 / 4. 3.100
libpostproc 56. 3.100 / 56. 3.100
Input #0, yuv4mpegpipe, from 'pipe:':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p(progressive), 720x480, 23.98 fps, 23.98 tbr, 23.98 tbn
Guessed Channel Layout for Input Stream #1.1 : stereo
Input #1, matroska,webm, from 'C:\Users\RGM\Downloads\DISC1_t05.mkv':
Metadata:
title : 「こどものおもちゃ」小学生編Blu-rayBOX DISC1
encoder : libmakemkv v1.17.0 (1.3.10/1.5.2) win(x64-release)
creation_time : 2022-07-02T21:06:36.000000Z
Duration: 00:24:37.01, start: 0.000000, bitrate: 8532 kb/s
Chapters:
Chapter #1:0: start 0.000000, end 91.024267
Metadata:
title : Chapter 00
Chapter #1:1: start 91.024267, end 746.011933
Metadata:
title : Chapter 01
Chapter #1:2: start 746.011933, end 1477.010000
Metadata:
title : Chapter 02
Stream #1:0(eng): Video: h264 (High), yuv420p(top first), 720x480 [SAR 10:11 DAR 15:11], SAR 109:120 DAR 109:80, 29.97 fps, 29.97 tbr, 1k tbn
Metadata:
BPS-eng : 6992741
DURATION-eng : 00:24:37.008866666
NUMBER_OF_FRAMES-eng: 44266
NUMBER_OF_BYTES-eng: 1291041831
SOURCE_ID-eng : 001011
_STATISTICS_WRITING_APP-eng: MakeMKV v1.17.0 win(x64-release)
_STATISTICS_WRITING_DATE_UTC-eng: 2022-07-02 21:06:36
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
Stream #1:1(jpn): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default)
Metadata:
title : Stereo
BPS-eng : 1536000
DURATION-eng : 00:24:37.010000000
NUMBER_OF_FRAMES-eng: 44311
NUMBER_OF_BYTES-eng: 283585920
SOURCE_ID-eng : 001100
_STATISTICS_WRITING_APP-eng: MakeMKV v1.17.0 win(x64-release)
_STATISTICS_WRITING_DATE_UTC-eng: 2022-07-02 21:06:36
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Stream #1:1 -> #0:1 (pcm_s16le (native) -> flac (native))
[libx264 @ 0000016a7928dc00] using SAR=8/9
[libx264 @ 0000016a7928dc00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0000016a7928dc00] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0000016a7928dc00] 264 - core 164 r3094 bfc87b7 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=16.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'KodochaRestorationTest.mkv':
Metadata:
encoder : Lavf59.16.100
Chapters:
Chapter #0:0: start 0.000000, end 91.024267
Metadata:
title : Chapter 00
Chapter #0:1: start 91.024267, end 746.011933
Metadata:
title : Chapter 01
Chapter #0:2: start 746.011933, end 1477.010000
Metadata:
title : Chapter 02
Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p(progressive), 720x480 [SAR 8:9 DAR 4:3], q=2-31, 23.98 fps, 1k tbn
Metadata:
encoder : Lavc59.18.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1(jpn): Audio: flac ([172][241][0][0] / 0xF1AC), 48000 Hz, stereo, s16, 128 kb/s (default)
Metadata:
title : Stereo
BPS-eng : 1536000
DURATION-eng : 00:24:37.010000000
NUMBER_OF_FRAMES-eng: 44311
NUMBER_OF_BYTES-eng: 283585920
SOURCE_ID-eng : 001100
_STATISTICS_WRITING_APP-eng: MakeMKV v1.17.0 win(x64-release)
_STATISTICS_WRITING_DATE_UTC-eng: 2022-07-02 21:06:36
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
encoder : Lavc59.18.100 flac
pipe:: Invalid data found when processing input00:00:00.00 bitrate=N/A speed= 0x
[matroska @ 0000016a79176d40] Starting new cluster due to timestamp 605.6kbits/s speed=46.6x
frame= 1 fps=0.7 q=21.0 Lsize= 6995kB time=00:01:05.37 bitrate= 876.5kbits/s speed=44.2x
video:168kB audio:6820kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.092093%
[libx264 @ 0000016a7928dc00] frame I:1 Avg QP:26.45 size:171430
[libx264 @ 0000016a7928dc00] mb I I16..4: 1.3% 51.1% 47.6%
[libx264 @ 0000016a7928dc00] 8x8 transform intra:51.1%
[libx264 @ 0000016a7928dc00] coded y,uvDC,uvAC intra: 96.7% 100.0% 100.0%
[libx264 @ 0000016a7928dc00] i16 v,h,dc,p: 100% 0% 0% 0%
[libx264 @ 0000016a7928dc00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 6% 75% 8% 5% 0% 1% 0% 3% 1%
[libx264 @ 0000016a7928dc00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 39% 12% 4% 1% 6% 1% 3% 1%
[libx264 @ 0000016a7928dc00] i8c dc,h,v,p: 35% 30% 34% 1%
[libx264 @ 0000016a7928dc00] kb/s:32881.68
Exiting normally, received signal 2.

Selur
20th July 2022, 18:03
FFmpeg assumes rawvideo, not y4m.
Here's an example what I would use in Hybrid:
vspipe "E:\Temp\encodingTempSynthSkript_2022-07-20@19_01_21_7510.vpy" - -c y4m | ffmpeg -y -noautorotate -nostdin -threads 8 -f yuv4mpegpipe -i - -an -sn -vf zscale=rangein=tv:range=tv -pix_fmt yuv444p -vsync 0 -vcodec ffvhuff -coder 0 -context 0 "E:\Temp\test_2022-07-20@19_01_21_7510_03.mkv"when encoding to ffvhuff. The '-f yuv4mpegpipe' might help,...

RGMOfficial
23rd December 2022, 15:57
Actually, i discovered this is a problem with Powershell's piping.

There are an workaround?

poisondeathray
23rd December 2022, 16:41
Actually, i discovered this is a problem with Powershell's piping.

There are an workaround?

Are you saying it works without powershell ?

RGMOfficial
23rd December 2022, 19:26
Yeah.

I finally resolved the problem using the function in CMD.

Yomiko
24th December 2022, 07:29
maybe you can make it done in python with subprocess.PIPE if you want to continue using powershell

ChaosKing
24th December 2022, 10:27
Powershell works a little bit different

https://github.com/vapoursynth/vapoursynth/issues/536
PowerShell uses an "object-based" pipe system. This means that it fully buffers the output, converts it to unicode, and attempts to parse .NET objects from it. vspipe is a binary output program, so it is not compatible with PowerShell. You can invoke cmd.exe from powershell.exe if you need to use VapourSynth in a PowerShell script.