[mythtv] nuvexport problem with dvb files with fix!
Chris Petersen
lists at forevermore.net
Sun Nov 14 06:52:40 UTC 2004
> (This is my first patch - if ive done it wrong, can someone let me know please?)
Please recreate this with "diff -u" or "cvs diff -u" (the -u option
creates a format that's a bit easier to read.
-Chris
> I have found (and fixed) a 'bug' in nuvexport when it is used with some (but not all) of the files produced by my Nova-T card. It seems that sometimes the mpeg info is buried a little further into the file than tcprobe looks.
>
> When I run nuvinfo on the affected files, it fails to read the width, height or fps of the file, giving errors about
> Use of uninitialized value in concatenation (.) or string at /usr/local/bin/nuvinfo line 23.
>
> This seems to be because tcprobe fails to find any info in the file:
>
> (OUTPUT FROM tcprobe)
>
> tcprobe -i 25728_20041113174700_20041113210000.nuv
> [tcprobe] MPEG packetized elementary stream (PES)
> [tcprobe] summary for 25728_20041113174700_20041113210000.nuv, (*) = not default, 0 = not detected
> audio track: -a 0 [0] -e 48000,16,2 [48000,16,2] -n 0x50 [0x2000] (*)
> PTS=26671.7783, bitrate=192 kbps
> detected (7) presentation unit(s) (SCR reset)
>
> running with -H 100 seems to fix it. (this causes it to parse the first 100 megs, instead of a little bit).
>
> Therefore, what is needed is for nuvinfo to keep looping round with greater and greater values of -H until it either finds the info, or hits a maximium (which I have made 2gigs).
>
> The patch is as follows: (also attached as a text file)
>
> Index: cvs/nuvexport/mythtv/nuvinfo.pm
> ===================================================================
> RCS file: /var/lib/mythcvs/nuvexport/mythtv/nuvinfo.pm,v
> retrieving revision 1.2
> diff -r1.2 nuvinfo.pm
> 128c128,142
> < my $data = `$program -i '$file' 2>/dev/null`;
> ---
>
>> $info{'width'}=0;
>> my $amount=10;
>> my $data;
>> my $gotit = 0;
>> while (!$gotit) {
>> $data = `$program -H $amount -i '$file' 2>/dev/null`;
>> if ($data =~ (/frame\s+rate/)) {
>> $gotit = 1;
>> }
>> $amount += 25;
>> # Sensible maximium
>> if ($amount > 2000) {
>> die "Failed to read info from file using tcprobe\n\n";
>> }
>> }
>
> 132c146
> < $info{'audio_channels'}) = $data =~ /audio\s+track:.+?-e\s+(\d+),(\d+),(\d+)\b/m;
> ---
>
>> $info{'audio_channels'}) = $data =~ /audio\s+track:.+?-e\s+(\d+),(\d+),(\d+)\b/m;
>
>
>
> Could we patch the file nuvinfo.pm to have a larger value for -H please?
>
> thanks
>
> g
>
>
> ------------------------------------------------------------------------
>
> Index: cvs/nuvexport/mythtv/nuvinfo.pm
> ===================================================================
> RCS file: /var/lib/mythcvs/nuvexport/mythtv/nuvinfo.pm,v
> retrieving revision 1.2
> diff -r1.2 nuvinfo.pm
> 128c128,142
> < my $data = `$program -i '$file' 2>/dev/null`;
> ---
>
>> $info{'width'}=0;
>> my $amount=10;
>> my $data;
>> my $gotit = 0;
>> while (!$gotit) {
>> $data = `$program -H $amount -i '$file' 2>/dev/null`;
>> if ($data =~ (/frame\s+rate/)) {
>> $gotit = 1;
>> }
>> $amount += 25;
>> # Sensible maximium
>> if ($amount > 2000) {
>> die "Failed to read info from file using tcprobe\n\n";
>> }
>> }
>
> 132c146
> < $info{'audio_channels'}) = $data =~ /audio\s+track:.+?-e\s+(\d+),(\d+),(\d+)\b/m;
> ---
>
>> $info{'audio_channels'}) = $data =~ /audio\s+track:.+?-e\s+(\d+),(\d+),(\d+)\b/m;
>>
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>mythtv-dev mailing list
>>mythtv-dev at mythtv.org
>>http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
More information about the mythtv-dev
mailing list