you'll want to init your muxer with avformat_alloc_output_context2, then make your stream with avformat_new_stream, configure all the basics in stream->codecpar; that includes extradata from x264_encoder_headers if writing a format with a global header (MP4, MKV; not MPEGTS)
-
-
Replying to @11rcombs @whitequark
then you avformat_write_header; make AVPackets, pass to av_write_frame; finish with av_write_trailer, cleanup with avformat_free_context
1 reply 0 retweets 0 likes -
Replying to @11rcombs
... I think I'll just save the raw h264 stream and instruct the user to run ffmpeg on it
1 reply 0 retweets 0 likes -
Replying to @whitequark
rudimentary scaling: SwsContext* ctx = sws_getCachedContext(0, w, h, AV_PIX_FMT_RGB24, w, h, AV_PIX_FMT_YUV420P, SWS_LANCZOS, NULL, NULL, NULL); sws_scale(ctx, inData, inStride, 0, h, outData, outStride);
1 reply 0 retweets 0 likes -
Replying to @11rcombs @whitequark
that'll convert from RGB to YUV at the same resolution; you might want to double the resolution to mitigate subsampling artifacts, and maybe use SWS_POINT for nearest-neighbor instead of lanczos (¯\_(ツ)_/¯)
1 reply 0 retweets 0 likes -
Replying to @11rcombs @whitequark
Boo, 4:2:0. There is absolutely no excuse for not encoding GBA video in 4:4:4.
1 reply 0 retweets 0 likes -
Replying to @marcan42 @whitequark
I mean, 4:4:4 YUV is more likely to be supported than H.264 RGB, I'll give you that
1 reply 0 retweets 0 likes -
Replying to @11rcombs @whitequark
I'm going to take a cheap shot and ask: if
@whitequark goes with ffmpeg, how many ffmpeg releases will the code last before the APIs it uses are deprecated? One? Two? (hi I just upgraded my box to ffmpeg-4 and had to drop four packages)2 replies 0 retweets 0 likes -
Heh, I just tried compiling OpenLASE with ffmpeg-4. It builds (surprising!), but raises 19 ffmpeg API deprecation warnings just in qplayvid.c.
1 reply 0 retweets 0 likes -
Replying to @marcan42
how many are about accesses to an AVStream's AVCodecContext that should now be using the AVCodecParameters?
1 reply 0 retweets 0 likes
None, I think.pic.twitter.com/P9WTFS9jPy
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.