View Full Version : P frame only intra refresh
sinkers
2nd February 2021, 07:39
Is it possible with x264 to create a P frame only intra refresh stream/file?
I have a test file from another encoder that is all P frames + recovery points I am trying to recreate with this command:
x264 --input-res 1920x1080 --intra-refresh out.yuv --b-pyramid none --ref 0 -b 0 -o out.264
But I always get an I frame at the start
Blue_MiSfit
2nd February 2021, 10:53
You sure the other encode wasn't trimmed?
benwaggoner
2nd February 2021, 18:06
You sure the other encode wasn't trimmed?
Yeah, I can't imagine how else you could get a file like that. Since the first frame can't reference anything else, it has to be all-intra for it to be displayable.
sinkers
2nd February 2021, 23:49
You sure the other encode wasn't trimmed?
Quite likely it was and I'll try trimming to regenerate. It was a capture from a live feed but it could be decoded and played back.
benwaggoner
3rd February 2021, 04:34
Quite likely it was and I'll try trimming to regenerate. It was a capture from a live feed but it could be decoded and played back.
Is the first frame playable by itself?
I think bidirectional prediction could be used to make a non-IDR first frame playable using intra refresh if predicted blocks in the first frame refer to intra blocks later in the GOP. But I'd be surprised someone would bother to make such an esoteric encoder feature. And that would require B-frames as well.
An interesting concept for a "crazy encoder stunt."
rwill
3rd February 2021, 21:08
For streaming SPS and PPS have to be transferred for decode as well. When streaming with RTP or similar these are relayed by the application layer, which gets them from the encoder or from the start of the stream the encoder put out. I dont know if it is possible to insert SPS/PPS at random points at certain P frames with x264 out of the box. So you may need this first I frame for stream headers.
By the way you should use more reference frames than 0, more like 3 or 4.
benwaggoner
3rd February 2021, 23:26
By the way you should use more reference frames than 0, more like 3 or 4.
Yeah, --ref 0 would be the same as --keyint 1, I'd think. All I-frames. Can't have a Predicted frame without a frame to predict from!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.