[mythtv] ffmpeg and mythtranscode

Stuart Auchterlonie stuarta at squashedfrog.net
Tue Dec 5 17:13:44 UTC 2017


On 04/12/17 21:06, Peter Bennett wrote:
> In my project of updating the deprecated ffmpeg calls, I got to
> "avcodec_encode_video2", which is the function that passes frames to
> ffmpeg for encoding. It is replaced by avcodec_send_frame and
> avcodec_receive_packet.
> 
> It seems the main use of video encoding is for mythtranscode. It is also
> used for nuppelvideo recording.

That used to be true many years ago.

These days I would say that the primary use for transcoding is
"lossless" transcoding to remove commercials.

That way the actual encoding of the file isn't changed, just the
extra junk is removed.

Having said that, however, it currently only works for mpeg2
content, as nobody has ever got around to implementing it for
h264 or other newer container formats.

> 
> I have never used mythtranscode, commercial scan or the editing features.
> 
> I tested transcode without my changes. I selected the highest resolution
> it would allow in the setup (720x480), and selected mpeg-4 (there are
> only 2 options, mjpeg and mpeg-4). I ran it on a 1.0 GB 1080i (mpeg2)
> file and it produced a 1.5 GB 1920x1080 nuppelvideo H263 file. This
> seems less than useful and I question whether it is still used or
> needed. Selecting mjpeg produced a 2.7 GB file, even less useful.
> 
> With my changes, transcoding to mpeg-4 produced a 1.5 GB unplayable
> file, with no error message during transcode but huge numbers of errors
> during failed playback.
> 
> I checked the code and it seems to be calling everything correctly.
> 
> At this point I am leaving the deprecated avcodec_encode_video2 in
> place. Maybe the entire transcode process should be deprecated, or maybe
> it should be fixed so it is useful and actually produce a smaller file
> than the original. H264 would be a better choice.
> 

MKV containers seem to be a favourite target,
using h264 for video and AC-3 for audio

As jya said, the only other "encoding" use case is for frame grabber
type cards which need software encoding. I think these could also
be served by MKV/H264/AC-3 with an option of MKV/MPEG2/MP3 for lower
powered cpu's

Regards
Stuart

> Peter
> 
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org



More information about the mythtv-dev mailing list