2013-01-20 90 views
6

我想從任何圖像在Ubuntu上創建示例YUV422幀,以便我可以編寫YUV422至RGB888函數以便學習。我真的很希望能夠使用可信任的工具來創建樣本並將其轉換回JPEG格式。如何在Ubuntu上從JPEG或其他圖像創建YUV422幀

我試過ImageMagick的,但我清楚地做錯了什麼:

convert -size 640x480 -depth 24 test.jpg -colorspace YUV -size 640x480 -depth 16 -sampling-factor 4:2:2 tmp422.yuv 

enter image description here

convert -colorspace YUV -size 640x480 -depth 16 -sampling-factor 4:2:2 tmp422.yuv -size 640x480 -depth 24 -colorspace RGB test2.jpg 

enter image description here

我也安裝在Ubuntu mpegtools包,以使用jpeg2yuv:

>> jpeg2yuv -f 1 test.jpg 
    INFO: [jpeg2yuv] Reading jpeg filenames from stdin. 
    INFO: [jpeg2yuv] Parsing & checking input files. 

**ERROR: [jpeg2yuv] System error while opening: "": No such file or directory 

顯然,別的是錯的。有人能告訴我怎麼做到這一點嗎?謝謝 -

回答

10

ffmpeg開始:

ffmpeg -i a.jpg -s 640x480 -pix_fmt yuv422p a.yuv 
ffmpeg -pix_fmt yuv422p -s 640x480 -i a.yuv b.jpg 
相關問題