Here's my third post. This time about H.264 encoding.
I found out from some posts that H.264 is the best way for transcoding for saving some hard disk megabytes and still keeping the best quality.
I know that using postprocessing is the easiest way and the way almost everyone here is doing it. I don't like it much however since I like keeping everything running with the least programs as possible. I'm picky, i know, but well, this is how I got it -kinda- working.
I can now confirm that it's the best encoder. It for certain is a CPU intensive process and a slow one (in an athlon 64 X2 4850e it takes about 2.3x the time to transcode a recording) but the filesize is half the original of MPEG-2 (i'm recording in medium) and the quality is just great. I can't differentiate it from the original. And I'm sure you'd be able to improve it a little bit more, but I'm more than pleased with the results as they are right now.
I googled a lot for this, searched this forum and others, and just couldn't find a concise reference and that's why i'm writing this.
It's more than curious and I haven't been able to get it 100% working. First, I tried a command line I found on a forum somewhere in the internet, but it used libx264 and libfaac codecs which AREN'T included in the ffmpeg that comes with gbpvr. Well, a little background with ffmpeg - the way i see it:
FFMPEG is an extremely powerful very little documented utility. It is intended for people who know what they're doing. As a matter of fact, binaries aren't even provided by the developers and everyone who wants to use it has to compile their own version and so, because there are tons of codecs and just doesn't make sense to compile everything in.
So I went and found out a binary that had libx264 and libfaac compiled in. Found it, didn't work with some of the command line options provided in that forum so I decided I'd better work with the included ffmpeg. Upon inspection, I found the gbpvr included ffmpeg included h264 and mp3. I found a post on this forum (http://forums.nextpvr.com/showthread.php?p=325689), reddwarf posted some command line options. I had to remove a couple of them because they weren't recognized by the ffmpeg binary (specifically sc_treshold). Also, it's more portable because other users can expect the resulting command line to work with the gbpvr included ffmpeg instead of be hunting around for a working binary. In the end, this is what came out:
<Conversion name="H.264" cmd="-y -i {SOURCE_FILE} -threads 2 -vcodec h264 -b 1200k -flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 -crf 22 -me umh -subq 7 -trellis 1 -g 250 -keyint_min 25 -i_qfactor 0.71 -bt 142282 -rc_eq "blurCplx^(1-qComp)" -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -acodec mp3 -ar 44100 -ab 128k {DEST_FILE}" targetExtension=".avi" />
(Included twice on purpose)
Just now I notice that I missed the following part from reddwarf's proposal:
-trellis 1 -refs 6 -bf 16 -directpred 3 -b_strategy 1 -bidir_refine 1 -coder 1 -me_range
Maybe that's why I had to strip sc_treshold (it wasn't a recognized switch by the time I tested it)
I however see a big difference in my converted files and those from reddwarf. He says 350-450 megs for 52 mins whereas with me it would take about 900 mb(http://forums.nextpvr.com/showthread.php?t=41099). Maybe it's the -crf 22 part. I highly doubt the switches I missed would make much difference. Could you state your opinion on this reddwarf??
You of course have to include that line in config.xml at the section of CustomFFmpegConversions. Then, H.264 will appear in the dropdown list of GBPVR config and you can select it.
Notice the " symbols. I mention them because it gave me a Royal PITA to find out how to include them. Typing them wouldn't do and escaping them with a \ wouldn't either.
########################
Anyway here's the fun part:
As you can see, the filename has an AVI extension.
I have run lots and lots of tests. Lots of them. This darn H.264 encoders/decoders are really picky. They wouldn't play. I even ended up installing arcsoft totalmedia theatre to no avail. Upon experimentation I came out with a combination that works in the end. Apparently its ATI MPEG decoder that gets the job done.
The way to do it?
1. FFmpeg to .avi file as output
2. Rename .avi file to .mpeg file.
Yup... If you try to play .avi file in gbpvr it won't play
If you try to ffmpeg to .mpg file as output directly, it won't play either.
So, my solution is to first transcode with the ffmpeg line shown above to .avi and then use the attached postconversion.bat file in the gbpvr root directory
This would work great.. Exceeeeept!! When I change the extension, GBPVR doesn't find the recording anymore and the recording ddissappears from the recordings menu of GBPVR
Any way to make it work??
Find attached the -NON WORKING RIGHT- Postconversion.bat
Just right now it has ocurred to me. I'm going to disable the "delete original after transcoding" and I'm going to rename the original .mpg to something like .mpgback and then the .avi to .mpg. Maybe tomorrow I'll update on how it went.
Well that's it.. any comments??
El Mede
I found out from some posts that H.264 is the best way for transcoding for saving some hard disk megabytes and still keeping the best quality.
I know that using postprocessing is the easiest way and the way almost everyone here is doing it. I don't like it much however since I like keeping everything running with the least programs as possible. I'm picky, i know, but well, this is how I got it -kinda- working.
I can now confirm that it's the best encoder. It for certain is a CPU intensive process and a slow one (in an athlon 64 X2 4850e it takes about 2.3x the time to transcode a recording) but the filesize is half the original of MPEG-2 (i'm recording in medium) and the quality is just great. I can't differentiate it from the original. And I'm sure you'd be able to improve it a little bit more, but I'm more than pleased with the results as they are right now.
I googled a lot for this, searched this forum and others, and just couldn't find a concise reference and that's why i'm writing this.
It's more than curious and I haven't been able to get it 100% working. First, I tried a command line I found on a forum somewhere in the internet, but it used libx264 and libfaac codecs which AREN'T included in the ffmpeg that comes with gbpvr. Well, a little background with ffmpeg - the way i see it:
FFMPEG is an extremely powerful very little documented utility. It is intended for people who know what they're doing. As a matter of fact, binaries aren't even provided by the developers and everyone who wants to use it has to compile their own version and so, because there are tons of codecs and just doesn't make sense to compile everything in.
So I went and found out a binary that had libx264 and libfaac compiled in. Found it, didn't work with some of the command line options provided in that forum so I decided I'd better work with the included ffmpeg. Upon inspection, I found the gbpvr included ffmpeg included h264 and mp3. I found a post on this forum (http://forums.nextpvr.com/showthread.php?p=325689), reddwarf posted some command line options. I had to remove a couple of them because they weren't recognized by the ffmpeg binary (specifically sc_treshold). Also, it's more portable because other users can expect the resulting command line to work with the gbpvr included ffmpeg instead of be hunting around for a working binary. In the end, this is what came out:
Code:
<Conversion name="H.264" cmd="-y -i {SOURCE_FILE} -threads 2 -vcodec h264 -b 1200k -flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 -crf 22 -me umh -subq 7 -trellis 1 -g 250 -keyint_min 25 -i_qfactor 0.71 -bt 142282 -rc_eq "blurCplx^(1-qComp)" -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -acodec mp3 -ar 44100 -ab 128k {DEST_FILE}" targetExtension=".avi" />
<Conversion name="H.264" cmd="-y -i {SOURCE_FILE} -threads 2 -vcodec h264 -b 1200k -flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 -crf 22 -me umh -subq 7 -trellis 1 -g 250 -keyint_min 25 -i_qfactor 0.71 -bt 142282 -rc_eq "blurCplx^(1-qComp)" -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -acodec mp3 -ar 44100 -ab 128k {DEST_FILE}" targetExtension=".avi" />
(Included twice on purpose)
Just now I notice that I missed the following part from reddwarf's proposal:
-trellis 1 -refs 6 -bf 16 -directpred 3 -b_strategy 1 -bidir_refine 1 -coder 1 -me_range
Maybe that's why I had to strip sc_treshold (it wasn't a recognized switch by the time I tested it)
I however see a big difference in my converted files and those from reddwarf. He says 350-450 megs for 52 mins whereas with me it would take about 900 mb(http://forums.nextpvr.com/showthread.php?t=41099). Maybe it's the -crf 22 part. I highly doubt the switches I missed would make much difference. Could you state your opinion on this reddwarf??
You of course have to include that line in config.xml at the section of CustomFFmpegConversions. Then, H.264 will appear in the dropdown list of GBPVR config and you can select it.
Notice the " symbols. I mention them because it gave me a Royal PITA to find out how to include them. Typing them wouldn't do and escaping them with a \ wouldn't either.
########################
Anyway here's the fun part:
As you can see, the filename has an AVI extension.
I have run lots and lots of tests. Lots of them. This darn H.264 encoders/decoders are really picky. They wouldn't play. I even ended up installing arcsoft totalmedia theatre to no avail. Upon experimentation I came out with a combination that works in the end. Apparently its ATI MPEG decoder that gets the job done.
The way to do it?
1. FFmpeg to .avi file as output
2. Rename .avi file to .mpeg file.
Yup... If you try to play .avi file in gbpvr it won't play
If you try to ffmpeg to .mpg file as output directly, it won't play either.
So, my solution is to first transcode with the ffmpeg line shown above to .avi and then use the attached postconversion.bat file in the gbpvr root directory
This would work great.. Exceeeeept!! When I change the extension, GBPVR doesn't find the recording anymore and the recording ddissappears from the recordings menu of GBPVR
Any way to make it work??
Find attached the -NON WORKING RIGHT- Postconversion.bat
Just right now it has ocurred to me. I'm going to disable the "delete original after transcoding" and I'm going to rename the original .mpg to something like .mpgback and then the .avi to .mpg. Maybe tomorrow I'll update on how it went.
Well that's it.. any comments??
El Mede