Permalink
Browse files

Included H264-related fixes from #7898 and #6774 to nuvexport (using …

…-demuxer lavf)

git-svn-id: http://svn.mythtv.org/svn/trunk@23615 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information...
1 parent a8f3c82 commit 162530ad48db17d3b9d778a59b405a85a773dbbc @Beirdo Beirdo committed Feb 27, 2010
Showing with 17 additions and 2 deletions.
  1. +17 −2 mythtv/nuvinfo.pm
View
@@ -178,9 +178,10 @@ package mythtv::nuvinfo;
# Set the is_mpeg flag
$info{'is_mpeg'} = 1;
# Grab the info we want from mplayer (go uber-verbose to override --really-quiet)
- my $data = `$program -v -v -v -v -nolirc -nojoystick -vo null -ao null -frames 0 -identify '$file' 2>/dev/null`;
+ my $idargs = "-v -v -v -v -nolirc -nojoystick -vo null -ao null -frames 0 -identify";
+ my $data = `$program $idargs '$file' 2>/dev/null`;
study $data;
- ($info{'video_type'}) = $data =~ m/^VIDEO:\s*(MPEG[12])/m;
+ ($info{'video_type'}) = $data =~ m/^VIDEO:\s*(MPEG[12]|H264)/m;
($info{'width'}) = $data =~ m/^ID_VIDEO_WIDTH=0*([1-9]\d*)/m;
($info{'height'}) = $data =~ m/^ID_VIDEO_HEIGHT=0*([1-9]\d*)/m;
($info{'fps'}) = $data =~ m/^ID_VIDEO_FPS=0*([1-9]\d*(?:\.\d+)?)/m;
@@ -192,6 +193,20 @@ package mythtv::nuvinfo;
($info{'aspect'}) = $data =~ m/^ID_VIDEO_ASPECT=0*([1-9]\d*(?:[\.\,]\d+)?)/m;
($info{'audio_type'}) = $data =~ m/^ID_AUDIO_CODEC=0*([1-9]\d*(?:\.\d+)?)/m;
($info{'mpeg_stream_type'}) = $data =~ m/^ID_DEMUXER=(\w+)/mi;
+
+ if (!defined($info{'width'})) {
+ # For the cases where mplayer misses frame size (particularly MPEG2-TS
+ # try it using lavf (ffmpeg) as the demuxer
+ my $altdata = `$program $idargs -demuxer lavf '$file' 2>/dev/null`;
+ study $altdata;
+ ($info{'width'}) = $altdata =~ m/^ID_VIDEO_WIDTH=0*([1-9]\d*)/m;
+ ($info{'height'}) = $altdata =~ m/^ID_VIDEO_HEIGHT=0*([1-9]\d*)/m;
+ ($info{'audio_bitrate'}) = $altdata =~ m/^ID_AUDIO_BITRATE=0*([1-9]\d*)/m;
+ ($info{'audio_sample_rate'}) = $altdata =~ m/^ID_AUDIO_RATE=0*([1-9]\d*)/m;
+ ($info{'audio_channels'}) = $altdata =~ m/^ID_AUDIO_NCH=0*([1-9]\d*)/m;
+ ($info{'aspect'}) = $altdata =~ m/^ID_VIDEO_ASPECT=0*([1-9]\d*(?:[\.\,]\d+)?)/m;
+ }
+
# Stream type
$info{'mpeg_stream_type'} = lc($info{'mpeg_stream_type'});
if ($info{'mpeg_stream_type'} && $info{'mpeg_stream_type'} !~ /^mpeg/) {

0 comments on commit 162530a

Please sign in to comment.