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.
ubuntu@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@tegra-ubuntu:~$ |
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@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@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 > [hidden email] > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Jan,
Thanks for your response. I had been messing around with extensions and typed in .mp4 just to see what it would do and forgot to change it back when I posted this on the website. I have been trying to use videoparse/h265parse but these will not work because it says "erroneous pipeline: no element 'videoparse'." Yet, when I go to my libraries, I can easily do a search for these plugins and find them. I do not understand why they are in the libraries but not working. Please help me figure this thing out; I really appreciate your help. Thanks Jackson |
If it really is uncompressed video (raw yuv420p), then you have to set the blocksize property on the filesrc element to the exact number of bytes making up for one frame.
For yuv420p (format=I420) one frame would be: width * height * 3 / 2 bytes, or in your case: 1280 * 720 * 3 / 2 = 1382400. |
That makes a lot of sense. I don't know where or how to set the blocksize property though. Could you show me an example of what you mean?
gst-launch-1.0 filesrc location=/home/ubuntu/user/Videos/small_mem_vid.mov <blocksize property> ! '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.mov -e |
This post was updated on .
You should really get your file extensions straight, otherwise it will be confusion all over the place. I suggest you rename your source file to small_mem_vid.yuv (or small_mem_vid.mov.i420). Furthermore, add a queue element before the encoder.
gst-launch-1.0 filesrc location=/home/ubuntu/user/Videos/small_mem_vid.mov blocksize=1382400 ! capsfilter caps='video/x-raw, framerate=(fraction)30/1, width=(int)1280, height=(int)720, format=(string)I420' ! queue ! omxh265enc ! filesink location=/home/ubuntu/user/Videos/july7-1.h265 -e or, if you want to mux it into a mov container: gst-launch-1.0 filesrc location=/home/ubuntu/user/Videos/small_mem_vid.mov blocksize=1382400 ! capsfilter caps='video/x-raw, framerate=(fraction)30/1, width=(int)1280, height=(int)720, format=(string)I420' ! queue ! omxh265enc ! qtmux ! filesink location=/home/ubuntu/user/Videos/july7-1.mov -e (untested) [EDIT] Fixed typo in last pipeline |
The first one worked!! Thank you so much!
|
In reply to this post by Arjen Veenhuizen
Le vendredi 08 juillet 2016 à 12:10 -0700, Arjen Veenhuizen a écrit :
> If it really is uncompressed video (raw yuv420p), then you have to > set the > blocksize property on the filesrc element to the exact number of > bytes > making up for one frame. > For yuv420p (format=I420) one frame would be: width * height * 3 / 2 > bytes, > or in your case: 1280 * 720 * 3 / 2 = 1382400. There is videoparse element that will manage that for you, plus it will set timestamps. _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (188 bytes) Download Attachment |
In reply to this post by Arjen Veenhuizen
I have a slight problem now. The video I'm trying to encode is a 4:2:2 video not 4:2:0. Do you know what format I could use besides I420? I've tried I422_10LE, I422_10BE, A422_BE, A422_LE. I keep getting an "erroneous pipeline not linking queue to omxh265enc" error.
Also, if this video is 4:2:2 then would that change the byte number (3/2) you used to calculate the blocksize? |
Free forum by Nabble | Edit this page |