Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
12th November 2015, 08:39 | #1 | Link |
Registered User
Join Date: Sep 2015
Posts: 5
|
How to connect VSPipe and x264 ?
Yesterday, I did some tests with VapourSynth on linux and wanted to pipe the output to x264 for encoding using 2 pass.
According http://www.vapoursynth.com/doc/gettingstarted.html , I applied the command like this: Code:
vspipe --y4m test.script.vpy - | x264 --level 3.1 --pass 1 --bitrate 1200 ...... --output /dev/null --demuxer y4m - vspipe --y4m test.script.vpy - | x264 --level 3.1 --pass 2 --bitrate 1200 ...... --output encode.1200kb.mkv --demuxer y4m - But after that, I was wondering, because the input file contains only 1500 frames with 25fps, but the output is 32min long with 0.781 fps. Is it not possible to connect vspipe and x264 in that way? What I'm doing wrong here? Any help will be welcome. Edit: Here (https://bbs.archlinux.org/viewtopic.php?id=190192) someone created an intermediate file first. Does this solve the problem or is it not needed? Code:
mkfifo stream.y4m # playing in mpv (e.g., for previewing the script's result) vspipe ~/test.vpy stream.y4m --y4m & mpv stream.y4m # encoding vspipe ~/test.vpy stream.y4m --y4m & x264 --crf 20 --preset fast --output test.mkv stream.y4m Last edited by coiledCoil; 12th November 2015 at 09:25. |
12th November 2015, 19:10 | #6 | Link | ||
Registered User
Join Date: Sep 2015
Posts: 5
|
The first post is done with a subset of the whole video file defined with SelectEvery(). I didn't mentioned this post, because I thought it's not important. But before I went to work, I started the same script without selecting a subset. Now I see the result and it worked fine. Here is the output for both scripts. The only difference is one line, SelectEvery(....).
Quote:
Whole video file: Code:
Width: 694 Height: 572 Frames: 40463 FPS: 25/1 (25.000 fps) Format Name: YUV420P8 Color Family: YUV Bits: 8 SubSampling W: 1 SubSampling H: 1 Code:
Width: 694 Height: 572 Frames: 1500 FPS: 25/32 (0.781 fps) Format Name: YUV420P8 Color Family: YUV Bits: 8 SubSampling W: 1 SubSampling H: 1 Edit: OK, after reading the documentation for SelectEvery it's clear: Quote:
Last edited by coiledCoil; 12th November 2015 at 19:21. |
||
12th November 2015, 20:46 | #8 | Link | |
Registered User
Join Date: Sep 2015
Posts: 5
|
Nice, thanks!
If someone has the same problem. Here is the correct code: Code:
video_subset = core.std.SelectEvery(clip = video, cycle = 8000, offsets = range(250)) video_subset = core.std.AssumeFPS(clip = video_subset, src = video) Quote:
|
|
13th November 2015, 09:03 | #10 | Link | |
Registered User
Join Date: Sep 2015
Posts: 5
|
Quote:
Here is the mediainfo of the wrong encode: Code:
General Complete name : encode.1200kb.mkv Format : Matroska Format version : Version 2 File size : 275 MiB Duration : 32mn 0s Overall bit rate : 1 203 Kbps Writing application : x264 r2389 956c8d8 Writing library : Haali Matroska Writer b0 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.1 Format settings, CABAC : Yes Format settings, ReFrames : 8 frames Codec ID : V_MPEG4/ISO/AVC Duration : 32mn 0s Bit rate : 1 200 Kbps Width : 694 pixels Height : 572 pixels Display aspect ratio : 4:3 Original display aspect ratio : 4:3 Frame rate : 0.781 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 3.871 Stream size : 270 MiB (98%) Writing library : x264 core 142 r2389 956c8d8 Encoding settings : cabac=1 / ref=8 / deblock=1:-3:-3 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=16 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=2pass / mbtree=1 / bitrate=1200 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=17500 / vbv_bufsize=22400 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00 Language : English Default : Yes Forced : No |
|
13th November 2015, 12:18 | #11 | Link | |
Registered User
Join Date: Oct 2010
Posts: 36
|
Quote:
If you're not worried about actual bitrate/filesize then it's not an issue (and you're probably more likely to use crf encoding anyway). |
|
Tags |
vspipe, x264 |
Thread Tools | Search this Thread |
Display Modes | |
|
|