mirror of https://git.ffmpeg.org/ffmpeg.git
examples/encode_video: only add sequence end code for mpeg1/2 video
Only add sequence end code for mpeg1/mpeg2 video, or else use the encoder libx264 or libx265 in this sample, decoding the output file will get unknow NALU type error. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This commit is contained in:
parent
e282b7ed7b
commit
e512d893bf
|
@ -186,6 +186,7 @@ int main(int argc, char **argv)
|
||||||
encode(c, NULL, pkt, f);
|
encode(c, NULL, pkt, f);
|
||||||
|
|
||||||
/* add sequence end code to have a real MPEG file */
|
/* add sequence end code to have a real MPEG file */
|
||||||
|
if (codec->id == AV_CODEC_ID_MPEG1VIDEO || codec->id == AV_CODEC_ID_MPEG2VIDEO)
|
||||||
fwrite(endcode, 1, sizeof(endcode), f);
|
fwrite(endcode, 1, sizeof(endcode), f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue