[mythtv] ffmpeg and mythtranscode

Peter Bennett pb.mythtv at gmail.com
Mon Dec 4 21:06:19 UTC 2017


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.

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.

Peter



More information about the mythtv-dev mailing list