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.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th October 2015, 15:29   #1  |  Link
serhannn
Registered User
 
Join Date: Sep 2015
Posts: 11
FFmpeg error while encoding raw video into H.264

I use the following FFmpeg command to encode the well-known Akiyo sequence from raw `y4m` format with H.264:

Code:
    ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 352x288 -r 30 -i akiyo_cif.y4m -c:v libx264 akiyo_cif.mp4
However, the encoded video I get is distorted, i.e. there is horizontal panning/sliding of frames and the colors are not accurate. FFmpeg yields the following error:

Code:
    [rawvideo @ 0x7f5e7c57b140] Invalid buffer size, packet size 1844 < expected frame_size 152064
    Error while decoding stream #0:0: Invalid argument
I don't understand the error. I provided the CIF resolution (352x288) and frame rate (30 fps) as input, so there shouldn't be anything wrong with those. What could be the source of this problem?
serhannn is offline   Reply With Quote
Old 19th October 2015, 17:18   #2  |  Link
vivan
/人 ◕ ‿‿ ◕ 人\
 
Join Date: May 2011
Location: Russia
Posts: 643
Quote:
rawvideo
y4m is not raw video - it has headers. You should just omit everything,
Code:
ffmpeg -i akiyo_cif.y4m -c:v libx264 akiyo_cif.mp4
vivan is offline   Reply With Quote
Old 20th October 2015, 08:15   #3  |  Link
serhannn
Registered User
 
Join Date: Sep 2015
Posts: 11
This solved my problem. I didn't know that y4m was not raw video. Thank you!
serhannn is offline   Reply With Quote
Reply

Tags
ffmpeg, h264, yuv

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:01.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.