2014-11-14 12 views
1

과 함께 raw image (1.8MB)을 표시하려고합니다. 이것이 성취되기 전에 데이터를 JPG로 인코딩해야한다는 것을 이해합니다. 이미지가 이미 JPG 파일로 저장 한 경우 이야기는 아주 간단 할 것이다 :GStreamer 1.0을 사용하여 원시 BGRA 이미지를 JPG로 변환하는 방법은 무엇입니까?

gst-launch-1.0.exe -v filesrc location=output.jpg ! decodebin ! imagefreeze ! autovideosink 

그러나, 나는 raw BGRA 800x600 image를 표시 할 수있는 파이프 라인을 조립하기 위해 필요한 것은 (위의 것과 같은 모양) 그것은 3D 응용 프로그램에 의해 디스크에 버려졌습니다.

이것은 내가 지금까지 한 일이지만, 문제는 디스크에 완전히 검은 이미지를 생성하는 것입니다 :

gst-launch-1.0.exe -v filesrc location=dumped.bin ! video/x-raw,format=BGRA,width=800,height=600,framerate=1/1 ! videoconvert ! video/x-raw,format=RGB,framerate=1/1 ! jpegenc ! filesink location=out.jpg 

이 작업을 처리 gstreamer를 할 수 있습니까?

답변

4

해결! 내가 직면 2 개의 주요 문제가 있었다 : dump.bin

  • 내 시스템 (Cygwin에서)에와 gst-launch-1.0가 작동 할 수 없습니다 어떤 이유로 심볼릭 링크이었다;
  • 원시 데이터로 작업 할 때 이어야하며 blocksizefilesrc으로 지정해야합니다.

    gst-launch-1.0.exe -v filesrc location=dumped.bin blocksize=1920000 ! video/x-raw,format=BGRA,width=800,height=600,framerate=1/1 ! videoconvert ! video/x-raw,format=RGB,framerate=1/1 ! videoflip method=vertical-flip ! jpegenc ! filesink location=out.jpg 
    
    : I는 또한 captured from the OpenGL framebuffer of a 3D application이었다 수직 때문에 이미지를 뒤집을 필요가 이러한 특정 케이스

gst-launch-1.0.exe -v filesrc location=dumped.bin blocksize=1920000 ! video/x-raw,format=BGRA,width=800,height=600,framerate=1/1 ! videoconvert ! video/x-raw,format=RGB,framerate=1/1 ! jpegenc ! filesink location=out.jpg