mpegts PES packet size mismatch error (DVB-T2)
Added by Tom Tom almost 4 years ago
Hi,
I am using Tvheadend with an MPEG-TS/Spawn streaming profile to transcode a DVB-T2 HEVC stream.
For transcoding I use ffmpeg and I am running it all on a Raspberry Pi 4.
I am watching the transcoded stream on an Android phone (in VLC) and everything is running fine, except that I have some occasional hiccup or glitch every 10-15 minutes in the transcoded stream. It is quite annoying and I was not able to find the cause.
It is possible to see a mpegts PES packet size mismatch
error in output of ffmpeg everytime the glitch happens.
tvheadend[678]: spawn: [mpegts @ 0x1e80440] PES packet size mismatch tvheadend[678]: spawn: [mpegts @ 0x1e80440] Packet corrupt (stream = 1, dts = 811877136). tvheadend[678]: spawn: [hevc @ 0x1eccb20] Phase 1 decode error tvheadend[678]: spawn: [hevc @ 0x1eccb20] hardware accelerator failed to decode picture tvheadend[678]: spawn: [hevc @ 0x1ed1b70] Could not find ref with POC 92 tvheadend[678]: spawn: [hevc @ 0x1ed1b70] Could not find ref with POC 96 tvheadend[678]: spawn: [mpegts @ 0x1e80440] PES packet size mismatch tvheadend[678]: spawn: [mpegts @ 0x1e80440] Packet corrupt (stream = 1, dts = 811914936). tvheadend[678]: spawn: [hevc @ 0x1f02cf0] Phase 1 decode error tvheadend[678]: spawn: [hevc @ 0x1f02cf0] hardware accelerator failed to decode picture tvheadend[678]: spawn: Error while decoding stream #0:1: Invalid data found when processing input tvheadend[678]: spawn: [hevc @ 0x1f8f1a0] Could not find ref with POC 100 tvheadend[678]: spawn: [hevc @ 0x1f8f1a0] Could not find ref with POC 104 tvheadend[678]: spawn: [mpegts @ 0x1e80440] PES packet size mismatch tvheadend[678]: spawn: [mpegts @ 0x1e80440] Packet corrupt (stream = 2, dts = 811817856). tvheadend[678]: spawn: Error while decoding stream #0:1: Invalid data found when processing input
I have tried also recording the stream (to a .ts file) at the same time, but when playing the recorded file, there are no glitches/hiccups visible. The glitches are visible only in transcoded stream.
I have basically 2 questions:
1. First, why do these "PES packet size" errors occur?
2. Second, why the glitches/hiccups are in transcoded stream and how to get rid of them?
I think I have a good DVB signal reception and I am sure it is not a problem of CPU load, since the CPU load never goes high.
I will be very thankful for any help or ideas!
My FFmpeg command line:
ffmpeg -c:v hevc -i pipe:0 -f mpegts -c:v h264_omx -c:a copy -b:v 1500k -r 25 pipe:1
My setup:
Raspberry Pi 4 B with TV hat
Raspberry OS (Buster)
FFmpeg 4.3.1
Tvheadend 4.3-1916~g1884300f0
Replies (1)
RE: mpegts PES packet size mismatch error (DVB-T2) - Added by Sergio Martini almost 2 years ago
Hi, I'm having the same problem on a similarly low-specced machine: did you find a solution?
Regards