Log in

View Full Version : ffmpeg pipe to x264 fails


UltraTV
9th December 2009, 22:52
I'm pulling my hair out trying to find a resolution for this issue:

ffmpeg -i inputfile.flv -f rawvideo - | x264 --crf 18 -o test.mp4

results in:

x264 [error]: No input file. Run x264 --help for a list of options.
FFmpeg version SVN-r11870, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --
enable-liba52 --enable-avisynth --enable-libfaac --enable-libfaad --enable-libgs
m --enable-libmp3lame --enable-libnut --enable-libtheora --enable-libvorbis --en
able-libx264 --enable-libxvid --cpu=i686 --enable-memalign-hack --extra-ldflags=
-static
libavutil version: 49.6.0
libavcodec version: 51.50.0
libavformat version: 52.7.0
libavdevice version: 52.0.0
built on Feb 5 2008 23:46:38, gcc: 4.2.3

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000
/1) -> 23.98 (24000/1001)
Input #0, flv, from 'inputfile.flv':
Duration: 00:11:02.0, start: 0.000000, bitrate: 48 kb/s
Stream #0.0: Video: vp6f, yuv420p, 480x360 [PAR 0:1 DAR 0:1], 23.98 tb(r)
Stream #0.1: Audio: mp3, 22050 Hz, stereo, 48 kb/s
Output #0, rawvideo, to 'pipe:':
Stream #0.0: Video: rawvideo, yuv420p, 480x360 [PAR 0:1 DAR 0:1], q=2-31, 20
0 kb/s, 23.98 tb(c)
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
av_interleaved_write_frame(): Error while opening file


I've tried a few different builds of x264 and ffmpeg with no luck. Any help is greatly appreciated.

UltraTV
9th December 2009, 23:32
woah, height of stupidness:

BAD:
ffmpeg -i inputfile.flv -f rawvideo - | x264 --crf 18 -o test.mp4

x264 requires a resolution since it's raw video. hope this helps someone with a similar problem:

BETTER:
ffmpeg -i inputfile.flv -f rawvideo - | x264 --crf 18 - 480x360 -o test.mp4

J_Darnley
10th December 2009, 00:00
Use -f yuv4mpegpipe for ffmpeg and --stdin y4m for x264 then you don't need to specify resolution or framerate.

Your first command failed because you didn't give x264 an input file, as the error said.

Selur
10th December 2009, 09:53
if you don't use yuv4mpegpipe, you also need to make sure you output the right colorspace via -pix_fmt yuv420p;)
BETTER:
ffmpeg -i inputfile.flv -pix_fmt yuv420p -f rawvideo - | x264 --crf 18 - 480x360 -o test.mp4