[mythtv-users] Help with HDPVR and ffmpeg (slightly off topic)

HP-mini blm-ubunet at slingshot.co.nz
Sat Jan 19 19:31:05 UTC 2013


On Wed, 2013-01-16 at 01:39 -0500, Scott Naef wrote:
> >> Version:
> >>
> >> ffmpeg version git-2013-01-05-7e5d4fa Copyright (c) 2000-2013 the FFmpeg
> >> developers
> >> Any help would be greatly appreciated.  If needed I can grab a few
> >> seconds of a news clip (talking heads help to see this) and offer it up
> >> somewhere.
> >>
> >> Thank you!
> >> -Scott Naef
> > With stream copying you could try options on/around:
> > -vsync 1 or drop
> > -copytb 1
> >
> > the async option has been deprecated to filter aresample
> > ffmpeg stream copying is fast remuxing..
> >
> > If you find a place for a 30 sec clip (use "dd" carefully) I will
> > attempt to find a fix.
> >
> >
> > _______________________________________________
> > mythtv-users mailing list
> > mythtv-users at mythtv.org
> > http://www.mythtv.org/mailman/listinfo/mythtv-users
> 
> HP-mini,
> 
> Thank you for the help.  My sample source file input.mpg is at:
> https://drive.google.com/uc?id=0BzSQuUjfkFN1a191MG9acnFPc3M&export=download
> 
> My resulting output.mp4 is at:
> https://drive.google.com/?tab=oo&authuser=0#folders/0BzSQuUjfkFN1OWIyNEQyRndmWG8
> 
> My ffmpeg command is:
> ffmpeg  -i input.mpg -async 1 -y -vcodec libx264 -r 25 -b:v 1268k -s 512x368 -acodec libmp3lame -threads 2 output.mp4
> 
> Ouput log:
> https://docs.google.com/file/d/0BzSQuUjfkFN1N0VsLXVud2tsV0E/edit
> 
> 
> I also posted this to ffmpeg-users and got a response from Carl Eugen.   It looks like ffmpeg SHOULD handle this media just fine but it might be broken in 10.0+   He has opened a ticket that can be found here:  https://ffmpeg.org/trac/ffmpeg/ticket/2143
> 
> For now (based on his findings) I have gone back to version 8 of ffmpeg and am able to get the transcode to work using the above.   I would really like to get it to work in newer versions of ffmpeg that are faster.  I am only getting about 50fps in verion 8 and got about 80 in the nightly from the 5th.
> 
> -Scott
> 
Hi Scott
Sorry for the delay..exceeded the monthly internet data cap so could not
download.

The ts file is okay apart from the mess at the beginning caused by
mythtv mpegrecorder & h264.  See ticket#11328..

That patch makes a big difference & should fix a lot of hdpvr av sync &
cutlist errors. The patch is still not perfect fix.

Difficult to comment on the AV sync with this sample ts file..
The latest ffmpeg is okay with the file if you increase the analyze time
to beyond the start mess.
"-analyzeduration 2000000"
& use this to skip start
"ffmpeg -ss 1 -analyzeduration 2000000 ..."

I tried video stream copy:
"ffmpeg -ss 1 -analyzeduration 2000000 -c:v copy -c:a libfaac
outputfile.mpg"
& had errors about incomplete E-AC3 packets; the bit that worked had
cleaned up the start mess.
So it seems to prefer transcoding..

You can determine what has happened at start with:
"ffprobe -analyzeduration 30000000  -show_frames -pretty -i
Downloads/41001_20130118153100.mpg | grep  'pkt_pos\|pict_type\|
coded_picture_number' | head -n 150"

The result (mess) is:
   pkt_pos=1032684
   pict_type=I
   coded_picture_number=47
 (also 48 - 51 are missing)

I cut the sample file to remove the mess. (1032684 byte/188 byte)=5493
pkt. 
"dd if=Downloads/41001_20130118153100.mpg ibs=188 skip=5493
of=Downloads/temp.mpg"

So now temp.mpg (cut) ffprobes:
   pkt_pos=0
   pict_type=I
   coded_picture_number=0
 (1 - 3 still missing)


Mediainfo reports different AV sync delay times for the original &
cut-files.
original -914ms
cut:     -735ms

You could try to cut your recording by the similar method & then rebuild
the seektable with mythcommflag --rebuild -f filename.

This hdpvr recording start clean up would make a very useful script.

Brett



More information about the mythtv-users mailing list