IMX95 v4l2h264enc encoded frame corrupted I am using IMX95's v4l2h264enc encoder to test H264 video encoding. Test command line is below: gst-launch-1.0 -v videotestsrc pattern=ball num-buffers=150 ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 ! v4l2h264enc ! filesink location=enc_test.h264 The video file is generated successfully, but when I try to play it with ffplay, it fails and shows error below: ffplay version 4.2.7-0ubuntu0.1 Copyright (c) 2003-2022 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1) configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 [h264 @ 0x7fbea4002840] Overread VUI by 7 bits [h264 @ 0x7fbea4002840] sps_id 0 out of range [h264 @ 0x7fbea4002840] non-existing PPS 0 referenced Last message repeated 2 times [h264 @ 0x7fbea4002840] Overread VUI by 8 bits0KB sq= 0B f=0/0 [h264 @ 0x7fbea4002840] Overread VUI by 7 bits [h264 @ 0x7fbea4002840] Overread VUI by 8 bits [h264 @ 0x7fbea4002840] non-existing PPS 0 referenced Last message repeated 26 times [h264 @ 0x7fbea4002840] Overread VUI by 7 bits [h264 @ 0x7fbea4002840] sps_id 0 out of range [h264 @ 0x7fbea4002840] non-existing PPS 0 referenced Last message repeated 29 times [h264 @ 0x7fbea4002840] Overread VUI by 7 bits [h264 @ 0x7fbea4002840] sps_id 0 out of range [h264 @ 0x7fbea4002840] non-existing PPS 0 referenced Last message repeated 29 times [h264 @ 0x7fbea4002840] Overread VUI by 7 bits [h264 @ 0x7fbea4002840] sps_id 0 out of range [h264 @ 0x7fbea4002840] non-existing PPS 0 referenced Last message repeated 29 times [h264 @ 0x7fbea4002840] Overread VUI by 7 bits [h264 @ 0x7fbea4002840] sps_id 0 out of range [h264 @ 0x7fbea4002840] non-existing PPS 0 referenced Last message repeated 29 times Input #0, h264, from 'enc_test.h264': Duration: N/A, bitrate: N/A Stream #0:0: Video: h264 (Baseline), yuv420p, 1280x720, 25.17 fps, 25 tbr, 1200k tbn, 50 tbc [h264 @ 0x7fbea4007f00] Overread VUI by 8 bits Failed to open file 'enc_test.h264' or configure filtergraph From the log above, it appears that the video head is corrupted. Then I try to use gstreamer debug, and found logs below: 0:00:05.727025935 13024 0xffffa0000d00 FIXME videoencoder gstvideoencoder.c:2408:gst_video_encoder_transform_meta_unlocked: Can't copy metadata because input frame disappeared My system info: Linux imx95-19x19-lpddr5-evk 6.12.49+ #9 SMP PREEMPT Wed Jul 22 11:47:53 UTC 2026 aarch64 GNU/Linux Re: IMX95 v4l2h264enc encoded frame corrupted Discussing with the AE team. Re: IMX95 v4l2h264enc encoded frame corrupted According to your hints, I try to execute two command line you provide. But none of them work. The encoded video still not playable. For command: gst-launch-1.0 -e -v videotestsrc pattern=ball num-buffers=150 ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 ! v4l2h264enc ! h264parse config-interval=-1 ! filesink location=enc_test.h264 When I try to play the encoded video file, error is shown below: ffprobe version 4.2.7-0ubuntu0.1 Copyright (c) 2007-2022 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1) configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 [h264 @ 0x557b5dc1e980] Format h264 detected only with low score of 1, misdetection possible! [h264 @ 0x557b5dc20380] sps_id 0 out of range Last message repeated 1 times [h264 @ 0x557b5dc20380] non-existing PPS 0 referenced Last message repeated 2 times [h264 @ 0x557b5dc20380] sps_id 0 out of range Last message repeated 1 times [h264 @ 0x557b5dc20380] non-existing PPS 0 referenced [h264 @ 0x557b5dc20380] decode_slice_header error [h264 @ 0x557b5dc20380] no frame! [h264 @ 0x557b5dc20380] non-existing PPS 0 referenced [h264 @ 0x557b5dc20380] decode_slice_header error ...... Last message repeated 1 times [h264 @ 0x557b5dc20380] decode_slice_header error [h264 @ 0x557b5dc20380] no frame! [h264 @ 0x557b5dc1e980] decoding for stream 0 failed [h264 @ 0x557b5dc1e980] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options Input #0, h264, from 'enc_test.h264': Duration: N/A, bitrate: N/A Stream #0:0: Video: h264, none, 25.17 fps, 25 tbr, 1200k tbn, 50 tbc I try to debug it, and it shows warning like below: 0:00:00.129727669 2003 0xffffa8000b70 WARN v4l2bufferpool gstv4l2bufferpool.c:884:gst_v4l2_buffer_pool_start: Uncertain or not enough buffers, enabling copy threshold 0:00:00.152626502 2003 0xffffa8000d00 FIXME videoencoder gstvideoencoder.c:2408:gst_video_encoder_transform_meta_unlocked: Can't copy metadata because input frame disappeared 0:00:00.153013002 2003 0xffffa8000d00 WARN codecparsers_h264 gsth264parser.c:435:gst_h264_parse_vui_parameters: failed to read uint8 for 'vui->aspect_ratio_idc', nbits: 8 0:00:00.153052211 2003 0xffffa8000d00 WARN codecparsers_h264 gsth264parser.c:516:gst_h264_parse_vui_parameters: error parsing "VUI Parameters" 0:00:00.153071752 2003 0xffffa8000d00 WARN codecparsers_h264 gsth264parser.c:2155:gst_h264_parse_sps: error parsing "Sequence parameter set" 0:00:00.153092044 2003 0xffffa8000d00 WARN h264parse gsth264parse.c:993:gst_h264_parse_process_nal: failed to parse SPS: 0:00:00.153120336 2003 0xffffa8000d00 WARN h264parse gsth264parse.c:1529:gst_h264_parse_handle_frame: broken/invalid nal Type: 7 SPS, Size: 9 will be dropped 0:00:00.153205086 2003 0xffffa8000d00 WARN codecparsers_h264 gsth264parser.c:2284:gst_h264_parse_pps: couldn't find associated sequence parameter set with id: 0 0:00:00.153230627 2003 0xffffa8000d00 WARN h264parse gsth264parse.c:1026:gst_h264_parse_process_nal: failed to parse PPS: 0:00:00.153418211 2003 0xffffa8000d00 WARN codecparsers_h264 gsth264parser.c:2473:gst_h264_parser_parse_slice_hdr: couldn't find associated picture parameter set with id: 0 0:00:00.153690127 2003 0xffffa8000d00 WARN v4l2bufferpool gstv4l2bufferpool.c:491:gst_v4l2_buffer_pool_alloc_buffer: newly allocated buffer 0 is not free Pipeline is PREROLLED ... Setting pipeline to PLAYING ... Redistribute latency... New clock: GstSystemClock 0:00:00.180972628 2003 0xffffa8000d00 FIXME videoencoder gstvideoencoder.c:2408:gst_video_encoder_transform_meta_unlocked: Can't copy metadata because input frame disappeared 0:00:00.181182169 2003 0xffffa8000d00 WARN codecparsers_h264 gsth264parser.c:2473:gst_h264_parser_parse_slice_hdr: couldn't find associated picture parameter set with id: 0 0:00:00.211927795 2003 0xffffa8000d00 FIXME videoencoder gstvideoencoder.c:2408:gst_video_encoder_transform_meta_unlocked: Can't copy metadata because input frame disappeared 0:00:00.212148128 2003 0xffffa8000d00 WARN codecparsers_h264 gsth264parser.c:2473:gst_h264_parser_parse_slice_hdr: couldn't find associated picture parameter set with id: 0 0:00:00.242748712 2003 0xffffa8000d00 FIXME videoencoder gstvideoencoder.c:2408:gst_video_encoder_transform_meta_unlocked: Can't copy metadata because input frame disappeared 0:00:00.242969462 2003 0xffffa8000d00 WARN codecparsers_h264 gsth264parser.c:2473:gst_h264_parser_parse_slice_hdr: couldn't find associated picture parameter set with id: 0 For command: gst-launch-1.0 -e -v videotestsrc pattern=ball num-buffers=150 ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 ! v4l2h264enc ! h264parse config-interval=-1 ! mp4mux ! filesink location=enc_test.mp4 It couldn't encode a video file, it shows error like below: root@imx95-19x19-lpddr5-evk:~# GST_DEBUG=3 gst-launch-1.0 -e -v videotestsrc pattern=ball num-buffers=150 ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 ! v4l2h264enc ! h264parse config-interval=-1 ! mp4mux ! filesink location=enc_test.mp4 Setting pipeline to PAUSED ... ====== V4L2ENC: 1.24.7 build on Jan 2 2025 07:23:23. ====== 0:00:00.078378376 2059 0xaaaadecda320 WARN v4l2 gstv4l2object.c:5350:gst_v4l2_object_probe_caps: Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Invalid argument 0:00:00.079377793 2059 0xffffa8000b70 WARN aggregator gstaggregator.c:2283:gst_aggregator_query_latency_unlocked: Latency query failed Pipeline is PREROLLING ... 0:00:00.079857126 2059 0xffffa8000d00 FIXME default gstutils.c:4089:gst_element_decorate_stream_id_internal: Creating random stream-id, consider implementing a deterministic way of creating a stream-id /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1 /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1 /GstPipeline:pipeline0/v4l2h264enc:v4l2h264enc0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, level=(string)1, profile=(string)baseline, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, level=(string)1, profile=(string)baseline, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono Redistribute latency... /GstPipeline:pipeline0/v4l2h264enc:v4l2h264enc0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1 /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1 0:00:00.140337252 2059 0xffffa8000d00 WARN v4l2bufferpool gstv4l2bufferpool.c:884:gst_v4l2_buffer_pool_start: Uncertain or not enough buffers, enabling copy threshold 0:00:00.165691544 2059 0xffffa8000e90 FIXME videoencoder gstvideoencoder.c:2408:gst_video_encoder_transform_meta_unlocked: Can't copy metadata because input frame disappeared 0:00:00.166079919 2059 0xffffa8000e90 WARN codecparsers_h264 gsth264parser.c:435:gst_h264_parse_vui_parameters: failed to read uint8 for 'vui->aspect_ratio_idc', nbits: 8 0:00:00.166119002 2059 0xffffa8000e90 WARN codecparsers_h264 gsth264parser.c:516:gst_h264_parse_vui_parameters: error parsing "VUI Parameters" 0:00:00.166138877 2059 0xffffa8000e90 WARN codecparsers_h264 gsth264parser.c:2155:gst_h264_parse_sps: error parsing "Sequence parameter set" 0:00:00.166159335 2059 0xffffa8000e90 WARN h264parse gsth264parse.c:993:gst_h264_parse_process_nal: failed to parse SPS: 0:00:00.166187127 2059 0xffffa8000e90 WARN h264parse gsth264parse.c:1529:gst_h264_parse_handle_frame: broken/invalid nal Type: 7 SPS, Size: 9 will be dropped 0:00:00.166277252 2059 0xffffa8000e90 WARN codecparsers_h264 gsth264parser.c:2284:gst_h264_parse_pps: couldn't find associated sequence parameter set with id: 0 0:00:00.166301710 2059 0xffffa8000e90 WARN h264parse gsth264parse.c:1026:gst_h264_parse_process_nal: failed to parse PPS: 0:00:00.166486835 2059 0xffffa8000e90 WARN codecparsers_h264 gsth264parser.c:2473:gst_h264_parser_parse_slice_hdr: couldn't find associated picture parameter set with id: 0 0:00:00.166826460 2059 0xffffa8000b70 WARN qtmux gstqtmux.c:6357:gst_qt_mux_video_sink_set_caps: no codec_data in h264 caps 0:00:00.166923502 2059 0xffffa8000b70 WARN qtmux gstqtmux.c:6856:gst_qt_mux_video_sink_set_caps: pad video_0 refused caps video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)1, profile=(string)baseline, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, i/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)1, profile=(string)baseline, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, parsed=(boolean)true nterlace-mode=(string)progressive, colorimetry=(string)bt601, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, parsed=(boolean)true 0:00:00.166977794 2059 0xffffa8000e90 WARN v4l2bufferpool gstv4l2bufferpool.c:491:gst_v4l2_buffer_pool_alloc_buffer: newly allocated buffer 0 is not free /GstPipeline:pipeline0/GstMP4Mux:mp4mux0.GstQTMuxPad:video_0: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)1, profile=(string)baseline, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, parsed=(boolean)true 0:00:00.167488335 2059 0xffffa8000b70 FIXME basesink gstbasesink.c:3399:gst_base_sink_default_event: stream-start event without group-id. Consider implementing group-id handling in the upstream elements /GstPipeline:pipeline0/GstMP4Mux:mp4mux0.GstAggregatorPad:src: caps = video/quicktime, variant=(string)iso /GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = video/quicktime, variant=(string)iso Pipeline is PREROLLED ... Setting pipeline to PLAYING ... 0:00:00.168202544 2059 0xffffa8000b70 WARN qtmux gstqtmux.c:5415:gst_qt_mux_add_buffer: error: format wasn't negotiated before buffer flow on pad video_0 Redistribute latency... ERROR: from element /GstPipeline:pipeline0/GstMP4Mux:mp4mux0: GStreamer error: negotiation problem. Additional debug info: /usr/src/debug/gstreamer1.0-plugins-good/1.24.7.imx/gst/isomp4/gstqtmux.c(5415): gst_qt_mux_add_buffer (): /GstPipeline:pipeline0/GstMP4Mux:mp4mux0: format wasn't negotiated before buffer flow on pad video_0 0:00:00.168413044 2059 0xffffa8000b70 FIXME aggregator gstaggregator.c:1478:gst_aggregator_loop: Subclass should call gst_aggregator_selected_samples() from its aggregate implementation. Execution ended after 0:00:00.000556000 Setting pipeline to NULL ... 0:00:00.174238335 2059 0xaaaadecda320 WARN bufferpool gstbufferpool.c:1429:gst_buffer_pool_set_flushing: can't change flushing state of inactive pool 0:00:00.199404961 2059 0xaaaadecda320 WARN bufferpool gstbufferpool.c:1429:gst_buffer_pool_set_flushing: can't change flushing state of inactive pool Freeing pipeline ... Re: IMX95 v4l2h264enc encoded frame corrupted The encoder output is probably not “video header corruption” from your test source; the pipeline is missing the H.264 parser stage that NXP’s i.MX Linux guidance expects for i.MX 8 / i.MX 95 VPU encoder pipelines. The i.MX 95 v4l2h264enc output is H.264 stream-format=byte-stream / alignment=au , and NXP documentation says h264parse/h265parse should be added because the VPU supports only byte-stream output on i.MX 8 and i.MX 95 .
Use this first:
gst-launch-1.0 -e -v \
videotestsrc pattern=ball num-buffers=150 ! \
video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 ! \
v4l2h264enc ! \
h264parse config-interval=-1 ! \
filesink location=enc_test.h264
Then play it explicitly as raw H.264:
ffplay -f h264 enc_test.h264
If you want a normal playable container file, use a muxer:
gst-launch-1.0 -e -v \
videotestsrc pattern=ball num-buffers=150 ! \
video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 ! \
v4l2h264enc ! \
h264parse ! \
mp4mux ! \
filesink location=enc_test.mp4
or:
gst-launch-1.0 -e -v \
videotestsrc pattern=ball num-buffers=150 ! \
video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 ! \
v4l2h264enc ! \
h264parse ! \
matroskamux ! \
filesink location=enc_test.mkv
NXP’s recording examples place h264parse between the encoder and muxer/filesink path, e.g. $videoEncoderPlugin ! [h264parse] ! $MUXER ! filesink ... . For MP4, the -e option is important so GStreamer sends EOS and lets the muxer finalize the file correctly.
The GStreamer message:
FIXME videoencoder ... Can't copy metadata because input frame disappeared
is not, by itself, proof that the H.264 bitstream header is corrupted. It is a GStreamer videoencoder metadata-copy warning/FIXME that has been seen in v4l2h264enc pipelines . The ffplay errors — Overread VUI , sps_id 0 out of range , non-existing PPS 0 referenced — are more consistent with the downstream reader seeing an H.264 stream that has not been normalized/parsed as expected, especially around SPS/PPS handling.
If the parsed raw .h264 still fails, check the first bytes:
xxd -l 64 enc_test.h264
For Annex-B byte-stream H.264, you should see start codes such as:
00 00 00 01
near the beginning, followed by SPS/PPS NAL units before slices.
Recommended fix: insert h264parse after v4l2h264enc ; for general playback, prefer h264parse ! mp4mux ! filesink location=enc_test.mp4 rather than writing the encoder output directly to a raw .h264 file.
Re: IMX95 v4l2h264enc encoded frame corrupted We can use the gstreamer to play the h264 video, and it plays well:
gst-launch-1.0 filesrc location=enc_test.h264 ! decodebin ! glupload ! autovideosink
so I don't think it's the v4l2h264enc issue.
查看全文