[MPlayer-users] Reencoding a broadcast HD-ATSC stream

Philip Prindeville philipp_subx at redfish-solutions.com
Mon Nov 21 09:58:51 CET 2005


Ok, changed the script to:

#!/bin/sh

x() {
echo "$@"
$@
}


bitrate=20000

for file in "$@"; do
dir=`dirname $file`
base=`basename $file .ts`

prog=`echo $base | sed 's/.*\.\([0-9]\)$/\1/'`
base=`echo $base | sed "s/\.$prog$//"`

base="$dir/$base"

for pass in 1 2; do
echo ""
echo "pass $pass..."
echo ""
x mencoder -quiet -sws 2 -oac copy -ovc lavc \
-lavcopts vcodec=mpeg4:vbitrate=$bitrate:vpass=$pass:autoaspect \
-vf crop=1920:1080,scale=1920:1080,pp=hb/vb/dr/al/lb \
-tsprog $prog \
-o "$base.avi" "$file"

done

rm -f $dir/frameno.avi

done


And the results are:


[root at pvr x86_64]# recode /home/share/videos/IdahoEdens.7.ts

pass 1...

mencoder -quiet -sws 2 -oac copy -ovc lavc -lavcopts 
vcodec=mpeg4:vbitrate=20000:vpass=1:autoaspect -vf 
crop=1920:1080,scale=1920:1080,pp=hb/vb/dr/al/lb -tsprog 7 -o 
/home/share/videos/IdahoEdens.avi /home/share/videos/IdahoEdens.7.ts
MEncoder dev-CVS-051008-15:57-3.4.4 (C) 2000-2005 MPlayer Team
CPU: Advanced Micro Devices Athlon 64 Clawhammer (Family: 15, Stepping: 10)
Detected cache-line size is 64 bytes
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2

success: format: 0 data: 0x0 - 0x96722f90
TS file format detected.
DEMUX OPEN, AUDIO_ID: -1, VIDEO_ID: -1, SUBTITLE_ID: -1,
PROBING UP TO 2000000, PROG: 7
VIDEO MPEG2(pid=113)AUDIO A52(pid=116) NO SUBS (yet)! PROGRAM N. 7
Opened TS demuxer, audio: 2000(pid 116), video: 10000002(pid 113)...POS=564
VIDEO: MPEG2 1920x1088 (aspect 3) 29.970 fps 14490.0 kbps (1811.2 kbyte/s)
[V] filefmt:29 fourcc:0x10000002 size:1920x1088 fps:29.97 ftime:=0.0334
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
AC3: 2.0 (stereo) 48000 Hz 256.0 kbit/s
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 256.0 kbit/16.67% (ratio: 32000->192000)
Selected audio codec: [a52] afm:liba52 (AC3-liba52)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [pp=hb/vb/dr/al/lb]
Opening video filter: [scale w=1920 h=1080]
Opening video filter: [crop w=1920 h=1080]
Crop: 1920 x 1080, -1 ; -1
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 1920 x 1088 (preferred csp: Mpeg PES)
[PP] Using external postprocessing filter, max q = 6.
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
Also try adding the scale filter, e.g. -vf spp,scale instead of -vf spp.
VDecoder init failed :(
Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b
Selected video codec: [mpeg12] vfm:libmpeg2 (MPEG-1 or 2 (libmpeg2))
==========================================================================
Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
audiocodec: framecopy (format=2000 chans=2 rate=48000 bits=16 B/s=32000 
sample-244813135873)
Writing AVI header...
ODML: Aspect information not (yet?) available or unspecified, not 
writing vprp header.
VDec: vo config request - 1920 x 1088 (preferred csp: Planar YV12)
[PP] Using external postprocessing filter, max q = 6.
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
SwScaler: using unscaled Planar YV12 -> Planar YV12 special converter
videocodec: libavcodec (1920x1080 fourcc=34504d46 [FMP4])
ODML: vprp aspect is 16384:9149.
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
ODML: vprp aspect is 16384:9149.
ODML: Starting new RIFF chunk at 1023MB.
TS_PARSE: COULDN'T SYNC

Flushing video frames

Writing AVI index...
Fixing AVI header...
ODML: vprp aspect is 16384:9149.

Video stream: 2578.683 kbit/s (322335 B/s) size: 1158620864 bytes 
3594.458 secs 107715 frames

Audio stream: 256.000 kbit/s (32000 B/s) size: 115010992 bytes 3594.094 secs
pass 2...

mencoder -quiet -sws 2 -oac copy -ovc lavc -lavcopts 
vcodec=mpeg4:vbitrate=20000:vpass=2:autoaspect -vf 
crop=1920:1080,scale=1920:1080,pp=hb/vb/dr/al/lb -tsprog 7 -o 
/home/share/videos/IdahoEdens.avi /home/share/videos/IdahoEdens.7.ts
MEncoder dev-CVS-051008-15:57-3.4.4 (C) 2000-2005 MPlayer Team
CPU: Advanced Micro Devices Athlon 64 Clawhammer (Family: 15, Stepping: 10)
Detected cache-line size is 64 bytes
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2

success: format: 0 data: 0x0 - 0x96722f90
TS file format detected.
DEMUX OPEN, AUDIO_ID: -1, VIDEO_ID: -1, SUBTITLE_ID: -1,
PROBING UP TO 2000000, PROG: 7
VIDEO MPEG2(pid=113)AUDIO A52(pid=116) NO SUBS (yet)! PROGRAM N. 7
Opened TS demuxer, audio: 2000(pid 116), video: 10000002(pid 113)...POS=564
VIDEO: MPEG2 1920x1088 (aspect 3) 29.970 fps 14490.0 kbps (1811.2 kbyte/s)
[V] filefmt:29 fourcc:0x10000002 size:1920x1088 fps:29.97 ftime:=0.0334
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
AC3: 2.0 (stereo) 48000 Hz 256.0 kbit/s
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 256.0 kbit/16.67% (ratio: 32000->192000)
Selected audio codec: [a52] afm:liba52 (AC3-liba52)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [pp=hb/vb/dr/al/lb]
Opening video filter: [scale w=1920 h=1080]
Opening video filter: [crop w=1920 h=1080]
Crop: 1920 x 1080, -1 ; -1
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 1920 x 1088 (preferred csp: Mpeg PES)
[PP] Using external postprocessing filter, max q = 6.
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
Also try adding the scale filter, e.g. -vf spp,scale instead of -vf spp.
VDecoder init failed :(
Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b
Selected video codec: [mpeg12] vfm:libmpeg2 (MPEG-1 or 2 (libmpeg2))
==========================================================================
Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
audiocodec: framecopy (format=2000 chans=2 rate=48000 bits=16 B/s=32000 
sample-244813135873)
Writing AVI header...
ODML: Aspect information not (yet?) available or unspecified, not 
writing vprp header.
VDec: vo config request - 1920 x 1088 (preferred csp: Planar YV12)
[PP] Using external postprocessing filter, max q = 6.
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
SwScaler: using unscaled Planar YV12 -> Planar YV12 special converter
videocodec: libavcodec (1920x1080 fourcc=34504d46 [FMP4])
[mpeg4 @ 0xa772f0]requested bitrate is to low
Could not open codec.
FATAL: Cannot initialize video driver.

Exiting...
[root at pvr x86_64]#



No idea why.

-Philip




More information about the MPlayer-users mailing list