swscale

ffmpeg record change color

时间秒杀一切 提交于 2019-12-11 01:28:03
问题 Im try record video from screen, for write to video file im use ffmpeg(libavcodec). But on result i see other colors, my example: AVCodec *codec; AVCodecContext *c= NULL; AVStream *video_stream; AVOutputFormat *out; AVFormatContext *out_context; int i, ret, x, y, got_output; AVFrame *frame; AVPacket pkt; uint8_t endcode[] = { 0, 0, 1, 0xb7 }; printf("Encode video file %s\n", filename); out = av_guess_format(NULL, filename, NULL); if (!out) { std::cout << "Could not deduce output format from

swscaler@0dd9e620: deprecated pixel format used, make sure you did set range correctly"

£可爱£侵袭症+ 提交于 2019-12-07 06:09:22
问题 I am decoding RTSP video stream with FFMpeg. At display time (call to cv::imshow(...) ), I get the following exception: [swscaler @ 0d55e5c0] deprecated pixel format used, make sure you did set range correctly I am converting the pixel format from "AV_PIX_FMT_YUVJ420P" to "AV_PIX_FMT_YUV420P". Still getting the above exception. Any help is appreciated; int Decodestream() { av_register_all(); avdevice_register_all(); avcodec_register_all(); avformat_network_init(); const char *filenameSrc =

Pixel format conversion issue [FFMPEG]

*爱你&永不变心* 提交于 2019-12-02 04:14:11
问题 I wrote a small program using ffmpeg's libraries. which does the following- 1)decode a frame. 2)convert frame to rgb24 . 3)convert rgb24 frame back to yuv420p. 4)encode the yuv420p frame and pack it into video file. But the end video is not same as the input video. there is some artifacts in final video (horizontal lines).i also get a warning when the rgbToYuv method gets called - Warning: data is not aligned! This can lead to a speedloss i suspect something is wrong with my format conversion