Encoding uncompressed video in H.265

Jan Schmidt thaytan at noraisin.net
Fri Jul 8 18:49:12 UTC 2016


On 09/07/16 03:44, jack81964 wrote:
> I have an uncompressed .mov file, and I want to encode it through H.265.  My
> pipeline is pretty simple so I do not understand why it doesn't work. The
> primary error is it "cannot write to resource." To further inspect I
> exported GST_DEBUG=*:4 and the only error message I get is "invalid buffer
> size 4096 < 1382400."  Here is the code and error message; this doesn't
> include the GST_DEBUG message due to length.  Any help would really help me.

In your case it looks like it's not actually raw video frames on disk -
since you say they are in a mov file and reference a file that ends in
.mp4. You can use filesrc ! qtdemux to extract the frames, but there's a
better way:

filesrc location=... ! decodebin ! omxh265enc....

decodebin will automatically detect the input file contents and plug
appropriate elements to decode it. The same pipeline snippet then
applies for decoding any supported input file.

If you actually do have raw video frames on disk, and not an mp4 file,
then the element you want is videoparse, which you'd use something like:

filesrc location=... ! videoparse format=i420 width=1280 height=720
framerate=30/1

(note: configured via properties on videoparse, not a caps filter)

Cheers,
Jan.

> 
> ubuntu at tegra-ubuntu:~$ gst-launch-1.0 filesrc
> location=/home/ubuntu/user/Videos/small_mem_vid.mp4 ! 'video/x-raw,
> framerate=(fraction)30/1, width=(int)1280, height=(int)720,
> format=(string)I420' ! omxh265enc ! filesink
> location=/home/ubuntu/user/Videos/july7-1.mp4 -e
> Setting pipeline to PAUSED ...
> Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set
> DPB and MjstreamingInside
> NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and
> MjstreamingPipeline is PREROLLING ...
> Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block :
> BlockType = 8 
> ===== MSENC =====
> NvMMLiteBlockCreate : Block : BlockType = 8 
> ERROR: from element
> /GstPipeline:pipeline0/GstOMXH265Enc-omxh265enc:omxh265enc-omxh265enc0:
> Could not write to resource.
> Additional debug info:
> /dvs/git/dirty/git-master_linux/external/gstreamer/gst-omx/omx/gstomxvideoenc.c(2139):
> gst_omx_video_enc_handle_frame ():
> /GstPipeline:pipeline0/GstOMXH265Enc-omxh265enc:omxh265enc-omxh265enc0:
> Failed to write input into the OpenMAX buffer
> ERROR: pipeline doesn't want to preroll.
> Setting pipeline to NULL ...
> Freeing pipeline ...
> ubuntu at tegra-ubuntu:~$
> 
> 
> 
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Encoding-uncompressed-video-in-H-265-tp4678550.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> 


More information about the gstreamer-devel mailing list