Issue with FFmpeg encode-decode examples for libvpx-VP9 ( v1.11.0)

908 views
Skip to first unread message

rohit khali

unread,
Jan 31, 2022, 1:34:23 PM1/31/22
to WebM Discussion
I am trying to use encode_video.c and decode_video.c from https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples to evaluate VP9 codec. However I'm getting "invalid frame marker issue" while decoding the encoded VP9 stream. Below are the required details. **** Encode example: I got a 25KB VP9 encoded stream, which I guess is RAW vp9 stream. [root at a28becddbffa encode]# ./encode_video enc.vp9 libvpx-vp9 *[libvpx-vp9 @ 0x1cf6040] v1.11.0* Send frame 0 ....... Send frame 24 .... Write packet 24 (size= 761) **** Decode Example:I've changed the codec_id to AV_CODEC_ID_VP9. [root at a28becddbffa decode]# ./decode_video enc.vp9 vp [Frame 1(352x288),codedPicNum=0, I] saving frame 1[352-384 x 288] [vp9 @ 0x1fb6300] Invalid frame marker Error sending a packet for decoding **** Any idea, what am I missing here.

James Zern

unread,
Jan 31, 2022, 2:26:52 PM1/31/22
to WebM Discussion
Hi,

On Mon, Jan 31, 2022 at 10:34 AM rohit khali <khali...@gmail.com> wrote:
I am trying to use encode_video.c and decode_video.c from https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples to evaluate VP9 codec. However I'm getting "invalid frame marker issue" while decoding the encoded VP9 stream.

These produce and consume a raw bitstream, VP9 requires some framing. You can try the mux and demux examples instead or use the ffmpeg command directly.
 
Below are the required details. **** Encode example: I got a 25KB VP9 encoded stream, which I guess is RAW vp9 stream. [root at a28becddbffa encode]# ./encode_video enc.vp9 libvpx-vp9 *[libvpx-vp9 @ 0x1cf6040] v1.11.0* Send frame 0 ....... Send frame 24 .... Write packet 24 (size= 761) **** Decode Example:I've changed the codec_id to AV_CODEC_ID_VP9. [root at a28becddbffa decode]# ./decode_video enc.vp9 vp [Frame 1(352x288),codedPicNum=0, I] saving frame 1[352-384 x 288] [vp9 @ 0x1fb6300] Invalid frame marker Error sending a packet for decoding **** Any idea, what am I missing here.

--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webm-discuss...@webmproject.org.
To view this discussion on the web visit https://groups.google.com/a/webmproject.org/d/msgid/webm-discuss/0b7b1008-5870-4aff-9f7d-2816c43c4463n%40webmproject.org.

rohit khali

unread,
Feb 1, 2022, 3:48:04 PM2/1/22
to webm-d...@webmproject.org
Hi James,
Thanks for the response.
Yes, Using mux-demux seems to be the one option here. I have to use FFmpeg APIs so the cmd option is ruled out.
But I am still wondering why the decoder is unable to decode this raw stream unlike other codecs like mpeg2, h264 and hevc. I have confirmed that encoded  bit stream is bit-exact to one wrapped within webm created by muxing code which I could playout in browser.
Is there any specific reason for 'external' dependency on putting framing in vp9 encoded bit stream.  

[root at a28becddbffa decode]# ./decode_video enc.vp9 vp [Frame 1(352x288),codedPicNum=0, I] saving frame 1[352-384 x 288] [vp9 @ 0x1fb6300] Invalid frame marker Error sending a packet for decoding



You received this message because you are subscribed to a topic in the Google Groups "WebM Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/a/webmproject.org/d/topic/webm-discuss/Nee3l4YGTyM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to webm-discuss...@webmproject.org.
To view this discussion on the web visit https://groups.google.com/a/webmproject.org/d/msgid/webm-discuss/CABWgkXKFw7JgUeh7CUTvT-YBDJvqTEN1cQFrBvSaMHTzrLyYcg%40mail.gmail.com.

James Zern

unread,
Feb 1, 2022, 4:07:32 PM2/1/22
to WebM Discussion
Hi Rohit,

On Tue, Feb 1, 2022 at 12:48 PM rohit khali <khali...@gmail.com> wrote:
Hi James,
Thanks for the response.
Yes, Using mux-demux seems to be the one option here. I have to use FFmpeg APIs so the cmd option is ruled out.
But I am still wondering why the decoder is unable to decode this raw stream unlike other codecs like mpeg2, h264 and hevc. I have confirmed that encoded  bit stream is bit-exact to one wrapped within webm created by muxing code which I could playout in browser.
Is there any specific reason for 'external' dependency on putting framing in vp9 encoded bit stream.  

Aside from a key frame, there's no real sync code in the bitstream (and even that one isn't guaranteed to be unique), so an application needs to packetize the frames.
 

[root at a28becddbffa decode]# ./decode_video enc.vp9 vp [Frame 1(352x288),codedPicNum=0, I] saving frame 1[352-384 x 288] [vp9 @ 0x1fb6300] Invalid frame marker Error sending a packet for decoding




On Tue, Feb 1, 2022 at 12:56 AM 'James Zern' via WebM Discussion <webm-d...@webmproject.org> wrote:
Hi,

On Mon, Jan 31, 2022 at 10:34 AM rohit khali <khali...@gmail.com> wrote:
I am trying to use encode_video.c and decode_video.c from https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples to evaluate VP9 codec. However I'm getting "invalid frame marker issue" while decoding the encoded VP9 stream.

These produce and consume a raw bitstream, VP9 requires some framing. You can try the mux and demux examples instead or use the ffmpeg command directly.
 
Below are the required details. **** Encode example: I got a 25KB VP9 encoded stream, which I guess is RAW vp9 stream. [root at a28becddbffa encode]# ./encode_video enc.vp9 libvpx-vp9 *[libvpx-vp9 @ 0x1cf6040] v1.11.0* Send frame 0 ....... Send frame 24 .... Write packet 24 (size= 761) **** Decode Example:I've changed the codec_id to AV_CODEC_ID_VP9. [root at a28becddbffa decode]# ./decode_video enc.vp9 vp [Frame 1(352x288),codedPicNum=0, I] saving frame 1[352-384 x 288] [vp9 @ 0x1fb6300] Invalid frame marker Error sending a packet for decoding **** Any idea, what am I missing here.

--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webm-discuss...@webmproject.org.
To view this discussion on the web visit https://groups.google.com/a/webmproject.org/d/msgid/webm-discuss/0b7b1008-5870-4aff-9f7d-2816c43c4463n%40webmproject.org.

--
You received this message because you are subscribed to a topic in the Google Groups "WebM Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/a/webmproject.org/d/topic/webm-discuss/Nee3l4YGTyM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to webm-discuss...@webmproject.org.
To view this discussion on the web visit https://groups.google.com/a/webmproject.org/d/msgid/webm-discuss/CABWgkXKFw7JgUeh7CUTvT-YBDJvqTEN1cQFrBvSaMHTzrLyYcg%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webm-discuss...@webmproject.org.

rohit khali

unread,
Feb 2, 2022, 2:59:02 PM2/2/22
to webm-d...@webmproject.org
Thanks a lot James !!
This information helps to have the initial context of vp9. 

Regards,
Rohit Khali

Reply all
Reply to author
Forward
0 new messages