[mythtv] resampling & mythtranscode

Craig Longman craigl at begeek.com
Wed May 21 16:24:10 EDT 2003


Geoffrey Hausheer wrote:

>On Wed, 21 May 2003 11:05:21 -0400, "Craig Longman craigl-at-begeek.com
>|mythtv/1.0-Allow|" <sa9nhe32c40t at sneakemail.com> said:
>  
>
>>when you say 'make the transcoding thread do the resampling', i'm not 
>>sure what you mean.  the _thread_ that was doing it was the resampling 
>>thread.  so, do you mean the transcoding program (ie, not libmythtv)? 
>> if so, then i'm not going to bother even trying.  the whole point of 
>>using the mythtranscode was that it used ReencodeFile() to do the real 
>>work.  or do you mean you only want resampling done in 
>>NuppelVideoPlayer::ReencodeFile()?
>>    
>>
>Sorry, I kinda disappeared for a while (after all I got mythtranscode
>written, and incorporated, and so now mythtv works exactly as i need it
>to).
>
hi!  thanks for the work there, aside from a couple problems, it works 
very well!

>However, the reencoding should be done in Reencode file. 
>Specifically, it is writen in such a way that you can get raw or encoded
>video/audio (even if it is not fully implemented).  Since it is in raw
>format, it should not be difficult to reprocess.  I had initially planned
>on supporting two-pass encoding, though this has fallen by the wayside as
>I dont really have a need for it, but resizing is something that could be
>added quite easily (though once again, I'm not sure what the use would
>be).  I was never too interested in the audio stuff, but I'd suggest that
>anything that is needed get added to ReencodeFile, since that is where
>all the work happens.
>
what i want is to convert it from the native pvr-250 format (mpeg1/2 i 
think) into mpeg-4, and drop the bitrate down for some things i want to 
archive.  i had also wanted to resample the audio down from 48K to 32K, 
in some cases.  initially i had been using the lame libs to do the 
resampling, but my patch had a couple bugs in it and it was rejected.  i 
have all the work being done ReencodeFile() myself also working now 
though, and now that the blip bug is out of the way, i'm happy.  both of 
these problem occur when re-encoding from non-nupple sources though, so 
raw format is not an option (afaict).  which is fine.  at some point i 
might try and figure out how to allow the audio to come accross raw, but 
that would require a layer2 sound encoding option in the profile stuff, 
and i'm not sure if the current decoder stuff can handle a mpeg-4 video 
with layer2 audio, i don't know if the lame libs support that.

anyway, i'll presume then that resampling in ReencodeFile() is ok, and 
will get that going, then submit the blip fix and re-encoding 
enhancements at the same time.

btw, i'm trying to figure out a decent way of calculating the max size 
of the audioframe i could receive.  the code in ReencodeFile() sets a 
variable called audioframesize to 4096 * 4, but i've seen that not big 
enough, some calls to audiolen() produce frame sizes of 18K+.  i had 
thought that taking samplerate*samplebytes*samplechannels/fps, but there 
are definitely audioframes larger than that.
is there any 100% reliable way of calculating the maximum decoded audio 
bytes per frame?

thanks!

    CraigL->Thx();




More information about the mythtv-dev mailing list