Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would transcode a GRAY or YUV400 video file into an AVI (YUV420P). My input file is 1920x1080 Y only, its size is 22809600 => 11 frame. I used the following command line but ffmpeg generate an AVI with only 1 frame. Note that I also used "gray" for the input pix_fmt.

Have you a trick to do that or is it a bug of ffmpeg ?

ffmpeg -s 1920x1080 -pix_fmt pal8 -i YFrames_stub_1920x1080.y -c:v rawvideo -pix_fmt yuv420p YFrames_stub_1920x1080_Y.avi
ffmpeg version N-58949-g0e575c2 Copyright (c) 2000-2013 the FFmpeg developers
  built on Dec  9 2013 22:06:49 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib
--enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray
--enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 58.100 / 52. 58.100
  libavcodec     55. 45.100 / 55. 45.100
  libavformat    55. 22.100 / 55. 22.100
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     3. 92.100 /  3. 92.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from 'YFrames_stub_1920x1080.y':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo, pal8, 1920x1080, 25 tbr, 25 tbn, 25 tbc
File 'YFrames_stub_1920x1080_Y.avi' already exists. Overwrite ? [y/N] y
Output #0, avi, to 'YFrames_stub_1920x1080_Y.avi':
  Metadata:
    ISFT            : Lavf55.22.100
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080, q=2-31, 200 kb/s, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> rawvideo)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 Lsize=    3043kB time=00:00:00.04 bitrate=623221.2kbits/s
video:3038kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.183449%
share|improve this question
    
Add -loop 1 before the -i. Can't say anything about the .y format- never encountered it, but ffmpeg says it's an image, (stream 0 shows raw video, though), so I guess you need the -loop 1 parameter. Also, set a duration with -t xx where xx is the duration you want. –  Rajib Dec 28 '13 at 11:31

1 Answer 1

After some experiment on that topic, I found where my mistake was! In the command line I used:

ffmpeg -s 1920x1080 -pix_fmt pal8 -i YFrames_1920x1080.y -c:v rawvideo -pix_fmt yuv420p out.avi

there is some missing parameters, but the more important was -f rawvideo. If I add it at the beginning of the cmd:

ffmpeg -f rawvideo -pix_fmt pal8 -s:v 1920x1080 -i YFrames_1920x1080.y -c:v rawvideo -pix_fmt yuv420p out.avi

We can use both pix_fmt gray or pal8.

share|improve this answer
1  
Yes, the -f rawvideo is always needed when reading, well, raw video. Otherwise it'll guess the container and therefore not accept all kinds of options. In your case it wrongly used the image2 demuxer. –  slhck Jan 10 at 10:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.