vlc发送的时间戳分析

很多人发送流媒体习惯于使用VLC, 很方便也很好用, 功能很强大.

但是很少人提及VLC 发出的帧的时间戳是什么意义,是如何计算得来的. 本人最近分析了VLC的源代码, 分析了时间戳形成机制, 不敢独享,拿出来与大家共享.

VLC发送实时流的命令一般如下:

 vlc -vvv localFile --sout udp://ip:port

-vvv是输出调试信息的选项

--sout是输出流到某个地址的选项.

在VLC中时间戳的调用栈如下:

1. decoder.c:decoder_New()-->vlc_clone( &p_dec->p_owner->thread, DecoderThread, p_dec, i_priority )

启动线程,回调函数DecoderThread

2. decoder.c:DecoderThread()-->DecoderProcess( p_dec, p_block )

3. decoder.c:DecoderProcess-->DecoderProcessSout( p_dec, p_block )

4. decoder.c:DecoderProcessSout-->DecoderPlaySout( p_dec, p_sout_block )

5. decoder.c:DecoderPlaySout-->DecoderFixTs( p_dec, &p_sout_block->i_dts, &p_sout_block->i_pts,
                      &p_sout_block->i_length, NULL, INT64_MAX )

可以看到该函数的第二第三个参数为引用,也就是在该函数中赋值

6. decoder.c:DecoderFixTs()-->input_clock_ConvertTS( p_clock, &i_rate, pi_ts0, p

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值