Author Topic: Need help on x264_encoder_intra_refresh & x264_encoder_invalidate_reference  (Read 2805 times)

Offline GEFORCEXTREME

  • Member
  • Posts: 23
    • View Profile
Hi guys,

I'm using VLC to stream H.264 videos encapsulated in MPEG2-TS. I would like to try out incorporating x264_encoder_intra_refresh() in VLC.
Assuming I have a feedback channel, everytime if the client senses packet loss, it sends a signal to server VLC which then do x264_encoder_intra_refresh. Is this the right way to do it?

How about x264_encoder_invalidate_reference()? From the x264 header it seems I need to know the pts. How do I know what/which pts of the reference frames to invalidate? Thanks.

Offline Dark Shikari

  • x264 developer
  • Administrator
  • Member
  • *****
  • Posts: 650
    • View Profile
You invalidate the reference frames that were lost.

Offline GEFORCEXTREME

  • Member
  • Posts: 23
    • View Profile
How do I know which frames were lost? Is there anything I can do to find out? Thanks.

Offline Dark Shikari

  • x264 developer
  • Administrator
  • Member
  • *****
  • Posts: 650
    • View Profile
If you can identify the loss on the client, surely the client can tell the server which frames were lost?

Offline GEFORCEXTREME

  • Member
  • Posts: 23
    • View Profile
Hmmm, agree. But right now all is just idea and no idea where to start looking for yet. I guess I have to look at libavcodec if I'm using VLC for this?

Thanks a million.

Offline Dark Shikari

  • x264 developer
  • Administrator
  • Member
  • *****
  • Posts: 650
    • View Profile
There are many ways to do it.  In the app I work on, each of our packets has a header telling how many packets there are and which packet it is, so if one is lost, the client knows.  You can also do it just by listening for errors from lavc.

Offline GEFORCEXTREME

  • Member
  • Posts: 23
    • View Profile
Thanks a million, Dark Shikari!  :-*

Offline kierank

  • Member
  • Posts: 58
    • View Profile
What would happen if you lost a bunch of frames? Could you possibly send a range of PTSs or is ref invalidation not worth it?

Offline Dark Shikari

  • x264 developer
  • Administrator
  • Member
  • *****
  • Posts: 650
    • View Profile
What would happen if you lost a bunch of frames? Could you possibly send a range of PTSs or is ref invalidation not worth it?
You can send a range, it's designed to do that and it works.

Offline kierank

  • Member
  • Posts: 58
    • View Profile
You can send a range, it's designed to do that and it works.

I mean a range as in ALL PTSs between 100 and 200 for example. Unless I'm mistaken, with the current API you'd have to send each PTS individually.

Offline Dark Shikari

  • x264 developer
  • Administrator
  • Member
  • *****
  • Posts: 650
    • View Profile
Re: Need help on x264_encoder_intra_refresh & x264_encoder_invalidate_reference
« Reply #10 on: February 26, 2011, 01:29:05 AM »
I mean a range as in ALL PTSs between 100 and 200 for example. Unless I'm mistaken, with the current API you'd have to send each PTS individually.
Yes, so you call it repeatedly.