Git Product home page Git Product logo

video's People

Contributors

hjc2000 avatar

Watchers

 avatar

video's Issues

::av_interleaved_write_frame 似乎不允许 ::AVPacket 进行浅拷贝

如下所示,::AVPacket pkt = *packet(); 让 ::AVPacket 对象进行了值拷贝

		while (1)
		{
			FFmpeg::AVPacket packet = iformat_context.read_frame();
			::AVPacket pkt = *packet();
			FFmpeg::AVStream input_stream = iformat_context.get_stream(pkt.stream_index);
			// 如果映射表中的目标索引号是负数,表示此流不被复制到输出格式中
			if (stream_map[packet()->stream_index] >= 0)
			{
				// 将此包的流索引号改为目标流索引号,这样这个包就会被写入输出格式的中的目标索引号
				// 的流中
				pkt.stream_index = stream_map[pkt.stream_index];
				FFmpeg::AVStream output_stream = oformat_context.get_stream(pkt.stream_index);
				pkt.pts = av_rescale_q_rnd(pkt.pts, input_stream()->time_base, output_stream()->time_base, ::AVRounding(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));
				pkt.dts = av_rescale_q_rnd(pkt.dts, input_stream()->time_base, output_stream()->time_base, ::AVRounding(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));
				pkt.duration = av_rescale_q(pkt.duration, input_stream()->time_base, output_stream()->time_base);
				pkt.pos = -1;
				oformat_context.interleaved_write_frame(&pkt);
			}
		}

最后一行的 interleaved_write_frame 方法内部代码如下

void interleaved_write_frame(::AVPacket* packet)
{
	int ret = ::av_interleaved_write_frame(_pWrapedObj, packet);
	if (ret < 0)
		throw ret;
}

结果报错了

(进程 21812)已退出,代码为 -1073740940。

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.