Log in

View Full Version : ffmpeg pipe to x264.exe under Windows?


Selur
26th February 2008, 08:57
Is it possible to pipe output from ffmpeg into x264.
thought that something like:
ffmpeg -i test.avi -f rawvideo - | x264 --crf 18 -o test.mp4 - 1280x720 would work, bt it doesn't. :(

And no using ffmpeg/mencoder itself is not an option, since I would like to have the possibility to access all x264 Options. (even zones ;))

So if anyone knows how to decode material with ffmpeg (or mplayer) and pipe it to x264 for encoding please post. :)

If this isn't possible at all due to some restrictions of Windows or x264.exe please post too. :)

Thanks.

Cu Selur

nm
26th February 2008, 09:37
And no using ffmpeg/mencoder itself is not an option, since I would like to have the possibility to access all x264 Options. (even zones ;))
Don't know about the piping problem, but MEncoder does give you access to the zones settings.

Selur
26th February 2008, 09:56
Thanks. You are right about mencoder, good to have this as a 'fallback'. :)
Though I would prefer a pipeing solution, since it's easier to test non standard svn patches like -aud, -nal-hrd and the new adaptive quantizer solutions. :)

J_Darnley
26th February 2008, 13:00
ffmpeg -i input.file -vcodec rawvideo -f rawvideo - | x264
This works but you may need to specify the correct -pix_fmt yuv420p if the input isn't YV12. Unfortunately, when I have used this, with Avisynth input, in the past I got the chroma planes swapped somewhere. This was easy to correct with the avs input but I could never see a filter or argument for ffmpeg to stop it doing this.

Selur
26th February 2008, 15:31
@J_Darnley: which ffmpeg&x264 version do you user,...

ffmpeg -i test.avi -vcodec rawvideo -pix_fmt yuv420p -f rawvideo - | x264 --crf 18 -o test.mp4 --fps 25.0 - 640x352
gives me:
FFmpeg version SVN-r10464, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-liba52 --enable-avisynth --enable
-libamr-nb --enable-libamr-wb --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libnut --en
able-libogg --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --cpu=i686 --enable-memalign-hack --
extra-ldflags=-static
x264 [info]: libavutil version: 49.5.0
using cpu capabilities: MMX MMXEXT SSE SSE2 SSE3 3DNow!
libavcodec version: 51.43.0
libavformat version: 51.12.2
built on Sep 10 2007 10:31:22, gcc: 4.2.1
mp4 [info]: initial delay 0 (scale 25000)
Input #0, avi, from 'test.avi':
Duration: 00:00:20.4, start: 0.000000, bitrate: 1240 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 624x352, 25.00 fps(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 96 kb/s
Output #0, rawvideo, to 'pipe:':
Stream #0.0: Video: rawvideo, yuv420p, 624x352, q=2-31, 200 kb/s, 25.00 fps(c)
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding

frame= 510 fps=441 q=0.0 Lsize= 164093kB time=20.4 bitrate=65894.4kbits/s
video:164093kB audio:0kB global headers:0kB muxing overhead 0.000000%
using x264&ffmpeg versions that come with megui :(

ffmpeg -i input.file -vcodec rawvideo -f rawvideo - | x264
doesn't start x264 at all as far as I can tell :(

Cu Selur

buzzqw
26th February 2008, 15:38
here is working.. jsut with an update ffmpeg build (sherpya's latest ffmpeg build)


C:\Programmi\PureBasic410\_test files>ffmpeg -i _aaa.vob -vcodec rawvideo -pix_fmt yuv420p -r 25 -f rawvideo - | x264 --crf 18 -o test.m
p4 --fps 25.0 - 640x352
x264 [info]: using cpu capabilities: MMX MMXEXT SSE SSE2 Cache64
mp4 [info]: initial delay 0 (scale 25000)
FFmpeg version Sherpya-r11050, Copyright (c) 2000-2007 Fabrice Bellard, et al.
libavutil version: 49.5.0
libavcodec version: 51.48.0
libavformat version: 51.19.0
built on Nov 18 2007 09:00:58, gcc: 4.2.1 [Sherpya]
Input #0, mpeg, from '_aaa.vob':
Duration: 00:00:12.4, start: 0.186278, bitrate: 5278 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576 [PAR 64:45 DAR 16:9], 4610 kb/s, 25.00 tb(r)
Stream #0.1[0x80]: Audio: liba52, 48000 Hz, 5:1, 384 kb/s
Stream #0.2[0x1c1]: Audio: mp2, 48000 Hz, stereo, 128 kb/s
Output #0, rawvideo, to 'pipe:':
Stream #0.0: Video: rawvideo, yuv420p, 720x576 [PAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 25.00 tb(c)
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
[mpeg2video @ 00A50410]qscale == 090148kB time=12.5 bitrate=124416.0kbits/s
[mpeg2video @ 00A50410]Warning MVs not available
[mpeg2video @ 00A50410]concealing 810 DC, 810 AC, 810 MV errors
frame= 315 fps= 4 q=0.0 Lsize= 191363kB time=12.6 bitrate=124416.0kbits/s
video:191363kB audio:0kB global headers:0kB muxing overhead 0.000000%
x264 [info]: slice I:517 Avg QP:12.98 size: 49975 PSNR Mean Y:54.59 U:56.34 V:56.29 Avg:53.88 Global:50.75
x264 [info]: slice P:63 Avg QP:15.43 size: 6743 PSNR Mean Y:70.40 U:74.30 V:75.02 Avg:68.48 Global:47.73
x264 [info]: mb I I16..4: 34.8% 0.0% 65.2%
x264 [info]: mb P I16..4: 74.5% 0.0% 24.9% P16..4: 0.2% 0.0% 0.0% 0.0% 0.0% skip: 0.4%
x264 [info]: SSIM Mean Y:0.9979793
x264 [info]: PSNR Mean Y:56.304 U:58.290 V:58.323 Avg:55.467 Global:50.304 kb/s:9055.80

encoded 580 frames, 6.79 fps, 9056.58 kb/s

C:\Programmi\PureBasic410\_test files>

BHH

Selur
26th February 2008, 15:55
using: http://sourceforge.net/project/showfiles.php?group_id=205275&package_id=248632&release_id=575227
with:ffmpeg -i test.avi -vcodec rawvideo -f rawvideo - | x264 --crf 18 -o test.mp4 --fps 25.0 - 640x352
I get:
FFmpeg version Sherpya-r11881, Copyright (c) 2000-2008 Fabrice Bellard, et al.
libavutil version: 49.6.0
libavcodec version: 51.50.0
libavformat version: 52.7.0
libavdevice version: 52.0.0
built on Feb 9 2008 06:54:05, gcc: 4.2.3
x264 [info]: using cpu capabilities: MMX MMXEXT SSE SSE2 SSE3 3DNow!
mp4 [info]: initial delay 0 (scale 25000)
Input #0, avi, from 'test.avi':
Duration: 00:00:20.4, start: 0.000000, bitrate: 1240 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 624x352 [PAR 1:1 DAR 39:22], 25.00 tb(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 96 kb/s
Output #0, rawvideo, to 'pipe:':
Stream #0.0: Video: rawvideo, yuv420p, 624x352 [PAR 1:1 DAR 39:22], q=2-31, 200 kb/s, 25.00 tb(c)
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding

av_interleaved_write_frame(): Error while opening file

arghh,...
tried know the ffmpeg build that caomes with AutoFF007.zip -> 'av_interleaved_write_frame(): Error while opening file'
(does not matter is I open an .avi, a mp4, or an .avs skript :()


Cu Selur

Ps.: thanks to those trying to help :)

Selur
26th February 2008, 16:22
seems to work with:
x264.exe from Cef: x264_x86_r736.7z
http://mirror05.x264.nl/Cef/
and
ffmpeg.exe from CelticDruid: ffmpeg.rev11870.7z
http://tirnanog.fate.jp/mirror/ffmpeg/

-> will check later if it was x264 or ffmpeg which was causing the problem.


THANKS :)

Cu Selur

buzzqw
26th February 2008, 16:23
i am using cef 736 x264 version ... if important

BHH

Selur
26th February 2008, 16:33
Just confirmed, problem was the x264.exe which ships with megui, cef's builds work fine. :)

Cu Selur