Opened 10 years ago

Closed 10 years ago

#6774 closed defect (fixed)

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 (3)

bindingpatch.diff (829 bytes) - added by anonymous 10 years ago.
please try this patch.
h264.diff (1005 bytes) - added by disafan@… 10 years ago.
Patch to Allow Bindings to Recognize H264 and Correct Width Height Issues
h264.2.diff (1.6 KB) - added by disafan@… 10 years ago.
Update H264 Patch to correct defined issue

Download all attachments as: .zip

Change History (16)

comment:1 Changed 10 years ago by disafan@…

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.

Changed 10 years ago by anonymous

Attachment: bindingpatch.diff added

please try this patch.

comment:2 Changed 10 years ago by anonymous

Please try the above patch and report back

comment:3 Changed 10 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 10 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 10 years ago by disafan@…

Attachment: h264.diff added

Patch to Allow Bindings to Recognize H264 and Correct Width Height Issues

comment:5 Changed 10 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 10 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 10 years ago by disafan@…

Attachment: h264.2.diff added

Update H264 Patch to correct defined issue

comment:7 Changed 10 years ago by disafan@…

Added updated version h264.2.diff to correct issue with previous.

comment:8 Changed 10 years ago by stuartm

Milestone: 0.22unknown

comment:9 Changed 10 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 10 years ago by beirdo

This is also pertinent to nuvexport which has the same heuristics in the detection code.

comment:11 Changed 10 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 10 years ago by beirdo

Owner: changed from xris to beirdo
Status: newassigned

comment:13 Changed 10 years ago by beirdo

Resolution: fixed
Status: assignedclosed

(In [23616]) Integrated fixes to H264 metadata detection. Fixes #7898 and #6774.

Note: See TracTickets for help on using tickets.