[mythtv-users] Transcoding using x264 ffmpeg ubuntu?

belcampo belcampo at zonnet.nl
Sun May 10 21:51:27 UTC 2009


Another Sillyname wrote:
> 2009/5/10 Another Sillyname <anothersname at googlemail.com>:
>> 2009/5/10 jonny Linux <jonnylinux at gmail.com>:
>>>>> I've found several references to it, and I think its been fixed in a
>>>>> later version of ffmpeg. But nuvexport needs ffmpeg 0.5. I've seen a
>>>>> reference to an ATRPMs package for ffmpeg 0.5-30, which I think fixes
>>>>> this problem, but I haven't found the source for this version?
>>>> All bits including sources, patches etc. are here:
>>>>
>>>> http://atrpms.net/name/ffmpeg/
>>>>
>>> Hi Axel,
>>>
>>> Thanks for that (I didn't know I could extract the source like that).
>>> I've extracted it, and I found the actual source code is the same as
>>> the code I was using.
>>>
>>> Does anybody have a version of ffmpeg which is compatible with
>>> nuvexport and can transcode to h264 without the
>>> "av_interleaved_write_frame(): Error while opening file?" Or is there
>>> an easier way to transcode to h264 without using nuvexport?
>>>
>>> Thanks,
>>>
>>> Jonny
>>> _______________________________________________
>>> mythtv-users mailing list
>>> mythtv-users at mythtv.org
>>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>>>
>> Have you tried mencoder?
>>
>> Can you tell us a bit more about the source material (Resolution,
>> Sound Format, Source....)
>>
>> Regards
>>
> 
> I dug up a mencoder line I've used to transcode BBC HD to x264 and
> surround sound (AC3), it does a resize to 720p and reduces a 9GB at 1920
> x 1080 to about 700mb at 1280x720
> 
> mencoder -nosound -ovc x264 -x264encopts
> subq=6:bitrate=2000:frame=3:pass=1 -vf scale=1280x720,softskip,harddup
> -o /path/to/outputfile.pass1.h264 /path/to/masterinputfile
> 
> mencoder -channels 6 -oac lavc -lavcopts acodec=ac3:abitrate=384 -ovc
> x264 -x264encopts  subq=6:bitrate=2000:frame=3:pass=2 -vf
> scale=1280x720,softskip,harddup -o /path/to/outputfile.pass2.h264
> /path/to/masterinputfile
Recent mencoder options have changed
was 1280x720 IS 1280:720
was frame=3 IS frameref=3
> 
> This does a two pass convert, please note that you use the same
> inputfile each time (/path/to/masterinputfile)
> 
> On a decent spec quad core takes about 2.5 hours per pass (I could
> probably further optimise the options but this works!!)
According to 700mb at 1280x720 with above options suggests that is a 40-41 
minutes source. Taking 2.5 hours for 41 min source results in 6.8fps on 
a decent spec quad core ?

If you devide you job as fllows:
41min * 60sec. * 25fps = 60000 frames.
Every core gets 10min. to decode, much more efficient then multithreading.
ffmpeg -ss 0 -vframes 15000 -i /path/to/masterinputfile -an -vcodec 
libx264 (as above) -f rawvideo 1.h264
ffmpeg -ss 0:10:00.00 -vframes 15000 -i /path/to/masterinputfile etc
ffmpeg -ss 0:20:00.00 -vframes 15000 -i /path/to/masterinputfile etc
ffmpeg -ss 0:30:00.00 -i /path/to/masterinputfile etc
cat 1.h264 2.h264 3.h264 4.h264 > outputfile.h264
ffmpeg -i outputfile.h264 -i /path/to/masterinputfile -vcodec copy 
-acodec copy -map 0:0 -map 1:3 -f avi /path/to/outputfile.avi

I think your transcode will be almost in realtime
> 
> Hope it's useful
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users



More information about the mythtv-users mailing list