Ticket #6774 (closed defect: fixed)
Opened 3 years ago
Last modified 2 years ago
Perl Bindings do not Recognize H264
| Reported by: | disafan@… | Owned by: | beirdo |
|---|---|---|---|
| Priority: | minor | Milestone: | unknown |
| Component: | Bindings - Perl | Version: | head |
| Severity: | low | Keywords: | |
| Cc: | Ticket locked: | no |
Description
Perl bindings in Recordings.pm that gather file information do not currently recognize H264 files recorded off the HD-PVR, causing any program using them to receive uninitialized values.
Attachments
Change History
comment:1 Changed 3 years ago by disafan@…
comment:2 Changed 3 years ago by anonymous
Please try the above patch and report back
comment:3 Changed 3 years ago by disafan@…
Yes. It displays the current height and width, but it changes the value of ID_DEMUXER from mpegts to lavf so that the section:
if ($info{'mpeg_stream_type'} && $info{'mpeg_stream_type'} !~ /mpeg/) {
die "Stream type '$info{'mpeg_stream_type'}' is not an mpeg, and will\n"
."not work with this program.\n";
}
No longer works. But putting in a check to confirm the stream type/demuxer as lavf should fix that.
comment:4 Changed 3 years ago by disafan@…
Also, this...
($info{'video_type'}) = $data =~ m/VIDEO:\s*(MPEG[12])/m;
Expression doesn't account for VIDEO type H264 either.
Changed 3 years ago by disafan@…
Patch to Allow Bindings to Recognize H264 and Correct Width Height Issues
comment:5 Changed 3 years ago by disafan@…
I've submitted a patch above. I'm not fluent in perl, but the above modifications allow a fallback to the alternate DEMUXER for the height and width if the width = 0 and they modify the expression to allow VIDEO H264 or VIDEO: MPEG2, thus eliminating the problems and allowing programs, including Nuvexport(which was my goal), to stop throwing exceptions.
comment:6 Changed 3 years ago by disafan@…
I made a mistake. The line should be:
if (!defined($info{'width'}))
As opposed to width==0. Of course, changing the expression would make it work again, but this seemed to be better.
Changed 3 years ago by disafan@…
- Attachment h264.2.diff added
Update H264 Patch to correct defined issue
comment:7 Changed 3 years ago by disafan@…
Added updated version h264.2.diff to correct issue with previous.
comment:9 Changed 2 years ago by bigras.bruno@…
I opened a new ticket that need to use '-demuxer lavf' but in my case it's for audio_sample_rate and audio_channels. Tickets: #7898
It would be nice to detect when to use '-demuxer'.
comment:10 Changed 2 years ago by beirdo
This is also pertinent to nuvexport which has the same heuristics in the detection code.
comment:11 Changed 2 years ago by disafan@…
Actually, nuvexport uses the Perl Bindings. So, it is pertinent to nuvexport because nuvexport depends on the bindings
comment:12 Changed 2 years ago by beirdo
- Owner changed from xris to beirdo
- Status changed from new to assigned
comment:13 Changed 2 years ago by beirdo
- Status changed from assigned to closed
- Resolution set to fixed

The problem is attributable to the ID_VIDEO_WIDTH and ID_VIDEO_HEIGHT parameters. The Perl bindings uses mplayer to pull these parameters to determine the size of the file. They are set to zero on these files.