• Most new users don't bother reading our rules. Here's the one that is ignored almost immediately upon signup: DO NOT ASK FOR FANEDIT LINKS PUBLICLY. First, read the FAQ. Seriously. What you want is there. You can also send a message to the editor. If that doesn't work THEN post in the Trade & Request forum. Anywhere else and it will be deleted and an infraction will be issued.
  • If this is your first time here please read our FAQ and Rules pages. They have some useful information that will get us all off on the right foot, especially our Own the Source rule. If you do not understand any of these rules send a private message to one of our staff for further details.
  • Please read our Rules & Guidelines

    Read BEFORE posting Trades & Request

Need help with creating AVCHD on Mac

seciors

Well-known member
Faneditor
Messages
1,317
Reaction score
2
Trophy Points
41
Hi,

I am trying to make sure I can create an AVCHD with 5.1 surround sound on the mac (with a simple menu) that is as compatible as possible across BD players, with as high quality as possible. Unfortunately, I have not found any piece of software that can do this. Instead, here's what I have found (and what it can do):

1. Apple's Compressor 4
  • Can generate both AVCHD H.264 and Dolby Digital 5.1 AC3 files.
  • CANNOT create a disc image for AVCHD discs (only for blu ray). Can write to actual physical media only for AVCHD. :-(
  • Options when generating the video portion are limited to avg/max bit rate and one or 2 passes.
  • All other h.264 settings are unknown/not exposed to the user.

NOTES: I use Compressor 4 to generate the DD 5.1 AC3 file, as it has lots of flexible options and works well. I have not yet tried using Compressor to generate the H.264 file. (see below for the other options I've tried instead)

2. Roxio's Toast 11
  • Can generate AVCHD H.264 and Dolby Digital 2.0 AC3 files.
  • Can generate AVCHD disc image and allows for very simple top menu (basically a custom background with an image button for the movie).
  • Can create chapter menus but doesn't allow for chapter names, and chapters must be indicated using it's UI by scanning and clicking within a preview of the movie. I've also found that the chapter locations chosen are not reliable in the final product.
  • Options when generating the video portion are limited to avg/max bit rate and a slider for motion detection (good, better, best type of slider)
  • All other h.264 settings are unknown/not exposed to the user
  • Toast can be "tricked" to use outside sources for the video and audio portions of the AVCHD image by keeping the temporary files it creates when encoding, and replacing them with different ones.

NOTES: I have been using Toast 11 to generate my AVCHD discs. I have been replacing the Toast generated .264 file and .ac3 file with other ones (the ac3 file from Compressor, and the .264 file from ffmpeg [see below])

3. ffmpeg
  • has the most flexibility of all tools, but thus is quite overwhelming.
  • Allows for two pass encoding, as well as tweaking just about every available option with regards to h.264 file generation. Does not have any way to ensure AVCHD compatibility though.

NOTES: For my episode 2 release, I used ffmpeg to generate the h.264 portion of the AVCHD disc using the following commands (I got this info after much research on the internet and felt pretty sure these setting would create an AVCHD compliant disc):
Code:
ffmpeg -i infile.mov -map_metadata -1 -vcodec libx264 -preset veryslow -tune film -fastfirstpass 0 -x264opts pass=1:bframes=3:deblock=-1,-1:subme=9:ref=4:weightp=0:bitrate=12000:vbv-maxrate=15000:vbv-bufsize=15000:level=4.0:keyint=48:open-gop=1:slices=1:colorprim=bt709:transfer=bt709:colormatrix=bt709:sar=1/1:nal-hrd=vbr:aud=1:bluray-compat=1:pic-struct=1:stats=pass1stats.log -an -sn -pix_fmt yuv420p -y outfile.h264

ffmpeg -i infile.mov -map_metadata -1 -vcodec libx264 -preset veryslow -tune film -x264opts pass=2:bframes=3:deblock=-1,-1:subme=9:ref=4:weightp=0:bitrate=12000:vbv-maxrate=15000:vbv-bufsize=15000:level=4.0:keyint=48:open-gop=1:slices=1:colorprim=bt709:transfer=bt709:colormatrix=bt709:sar=1/1:nal-hrd=vbr:aud=1:bluray-compat=1:pic-struct=1:stats=pass1stats.log -an -sn -pix_fmt yuv420p -y outfile.h264

Specific sites that helped me come up with these settings include:
http://broadcastengineering.com/production/understanding-avchd
  • This article implies high profile Level 4.0 is a valid choice for playing AVCHD on DVDs given the DVD max data rate of 17Mb/s due to spin speed limits. Level 4.0 supports up to 20Mb/s and [email protected] fps. However, Level 4.1 is what is used by BD. My reviewer suggested using Level 4.1 in my settings, but I don't know if that would fix the problem or is even related. Maybe some players aren't compatible with Level 4.0?
http://www.x264bluray.com/home/1080i-p
  • This site focuses on authoring blu ray discs...the challenge has been figuring out what options need to change for AVCHD discs!

Thus, my process has been as follows:
  1. Generate the source file for encoding from Final Cut Pro X by exporting it in "master file" format (I choose prores 422 LT as the codec)
  2. Generate the DD 5.1 AC3 file using Compressor 4
  3. Generate the .h264 file using ffmpeg (this is probably a 12 hour process in total with both passes)
  4. Create a Toast 11 AVCHD project; add my own custom menu background, and then mux/create a disc image by using the previously created components.

The resulting disc has worked fine in my own BD player (it's a fairly recent Sony player -- I got it about 6 months ago). However, for my episode 1 workprint, one of my reviewers has reported that this process results in an unplayable disc in both his panasonic BD players (he said the sound plays but the video freezes.)

I have created a new AVCHD file using Toast's version of the video component (still replacing the AC3 part to get 5.1 surround sound) and am waiting to hear back from my reviewer as to whether or not that works in his player. I'd be fine with this approach except I'm concerned about quality -- it only takes 2 hours for toast to do the encode. I'm not sure how much quality I am losing by taking this approach (even assuming it works!)

SO....now that I've explained all of what I know and have tried concerning the creation of AVCHD discs on the mac, does anyone have advice on changes/modifications/different approaches? (It needs to be done a mac, I don't have access to a PC, so that's not an option...)

If anyone can shed light on this, and/or provide any help at all, I'd greatly appreciate it.

Thanks!

-Seciors
 
I don't have any handy solutions. Seems like you've done your homework regarding ffmpeg flags. You're way ahead of me on those, so I can't really tell what (if anything) is wrong. It could be a problem with the reviewer's player. Does he have good experiences with other AVCHD discs? It's also POSSIBLE that there's some issue with x264 and Panasonic players, seeing as x264 is rarely used for blurays. But the spec clearly supports it, and Panasonic has a pretty good reputation, so it sounds unlikely.

IMHO: screw Toast. It will suck compared to ffmpeg. No encoder is that optimised. At best it will be almost transparent, at worst you will have significant quality loss. Anyway, it will not look as good as a proper ffmpeg encode at the same bitrate, I'm willing to bet good money on that.
 
theslime said:
I don't have any handy solutions. Seems like you've done your homework regarding ffmpeg flags. You're way ahead of me on those, so I can't really tell what (if anything) is wrong. It could be a problem with the reviewer's player. Does he have good experiences with other AVCHD discs? It's also POSSIBLE that there's some issue with x264 and Panasonic players, seeing as x264 is rarely used for blurays. But the spec clearly supports it, and Panasonic has a pretty good reputation, so it sounds unlikely.

He says he never has had any problems in the past. So it is most likely something about my settings. He did suggest using Level 4.1 instead of 4.0. In thinking about it, I can see that as a valid thing to try since perhaps (like I said before) some Blu Ray players want the level to be 4.1.

IMHO: screw Toast. It will suck compared to ffmpeg. No encoder is that optimised. At best it will be almost transparent, at worst you will have significant quality loss. Anyway, it will not look as good as a proper ffmpeg encode at the same bitrate, I'm willing to bet good money on that.

I agree and that's why I have tried to not use what it generates. I'd much prefer ffmpeg for the reasons you mention. But I just need to figure out what flag/setting I am using and/or missing that is causing the incompatibility (note - the reviewer says he burned it twice on two different discs, and also I think tried my episode 2 with the same results...he has a newish BD player as well as an older player, so 2 different discs, 2 different [panasonic] players, same results...)

The problem for me is:
1. My current settings work with my BD player and I don't have access to any other
2. Changing a setting and re-encoding is basically a 12-24 hour commitment, plus the time to create the rar files, upload the files, create the DLC, and then have someone else download, burn, and test (which requires someone willing to take the time and waste discs doing this too).

Hopefully someone who has some experience creating AVCHD discs can shed some light on what settings are the most important, and especially whether or not I should be using profile level 4.1 instead of 4.0.

Finally, I'm wondering if anyone can shed light on whether or not I'm doing ffmpeg 2 pass correctly -- does it access the first pass info from the log file? I've seen ffmpeg 2 pass examples where a log file isn't even specified. So I'm a bit confused as to whether or not I'm doing that correctly as well

PS - does anyone know any tool that might be able to extract the settings used to create a h264 file (on the mac)? I could run that on what toast spits out and then see if I'm missing something.

PPS - I'm wondering if I should ask a similar question in the general tech forum to get windows people's opinions, focusing solely on how to author an AVCHD with ffmpeg...
 
Panasonic is about the worst for compatibility problems when it comes to BDs and AVCHDs encoded with x264. Asking me about a Mac workflow is like asking a mole to comment on life in the treetops, but here are some general pointers.


  • Make sure that you output an elementary stream, not an MKV.
  • Disable weightp and set b-pyramid to none.
  • Consider closing gops if you continue to experience compatibility problems.

You seem to be implementing most of these anyway. AVCHD Strict (no certificate folder) is more compatible than AVCHD AUX, but I wouldn't know how to output that on a Mac.
 
Captain Khajiit said:
  • Make sure that you output an elementary stream, not an MKV.
Yes, I'm definitely doing that.
  • Disable weightp and set b-pyramid to none.
I'm doing the former, but I'm not specifying b-pyramid. I'm assuming 'bluray-compat' sets this to either none or strict, but I will update my settings to explicitly set it to none.
  • Consider closing gops if you continue to experience compatibility problems.
What are the implications of closing gops? right now I have them open, I think (open-gop=1). Does it impact quality?

AVCHD Strict (no certificate folder) is more compatible than AVCHD AUX, but I wouldn't know how to output that on a Mac.

I'm almost positive Toast takes care of this when it authors the actual disc, but I can confirm by looking at the disc layout.

Any opinion on level=4.0 vs level=4.1?

Thanks for your help, Captain! :)
 
One more question -- should I change my keyint to be 24 (e.g., 1 frame) instead of 48 (e.g., 2 frames)
 
seciors said:
What are the implications of closing gops? right now I have them open, I think (open-gop=1). Does it impact quality?

Closing gops gives a minor gain in compatibility in exchange for an insignificant loss in quality. Closing gops is one of those things that people used to do when trying to make x264 BDs/AVCHDs play on early players. To be honest, I never found it necessary, even with Panasonic players. I mentioned it for the sake of completeness, really.

Any opinion on level=4.0 vs level=4.1?

Either should be fine.

Thanks for your help, Captain! :)

You're welcome, but I'm not much help this time. :-( I gave up on AVCHD long ago.

seciors said:
One more question -- should I change my keyint to be 24 (e.g., 1 frame) instead of 48 (e.g., 2 frames)

EDIT: I use 24 or 16.
 
Well I just checked and unfortunately there's a CERTIFICATE folder on the discs that Toast authors. :-(

How bad is this in terms of compatibility?
 
It's not a big factor. It's just one thing to consider. (Strict AVCHD has less support for menus and the like.) Really, I was listing all the factors that might potentially help.

Another thing you might do is use the default settings of x264 and add any changes that you want to the command-line manually rather than using the veryslow preset.

AVCHD is a finicky format, which is why I stopped using it. I am sorry, but I can't be of any more help.
 
Ok, thanks for all your help. I think the b-pyramids=0 might be a big one, as I did some searches and came across that advice elsewhere as well as being "important" for AVCHD compatibility.

However, I also came across some info saying Toast/FCPX authored AVCHD discs can be finicky, especially with panasonic players. I guess in the end I can only do what I can do.

I'm stuck with AVCHD for now though as my physical medium for HD, as I do not have a BD burner and thus would have no way to test out any of my creations. Plus, I'd rather be distributing 8GB files as opposed to 25GB files. :)

<rant>
Authoring physical media on the mac is just SUCH a pain (and it's by design, I think), it's really the thing I dread the most in this whole process.
</rant>
 
Just a check because I can't remember if you mentioned it or not... Are you using a new ffmpeg build? I had huge compatibility problems with ffmpeg on a colleague's mac some time ago, until I found out that she was simply using an old build. I updated, and I could use the same command without any issue. (This wasn't x264-related, though.)
 
I'm not using a bleeding edge build but I think it's new enough. It's version 0.11.1.
 
That's from last summer or something, right? Should be more than enough.

I'm using ffmpegmac.net (which, for some reason, isn't mentioned on ffmpeg.org) for new builds. Stable ones, not bleeding edge. They're at 1.2.1 now (which isn't saying allt that much, considering they did a jump from 0.11.2 to 1.0 only last September).
 
Cool, thanks for that info. I will check that site out and try updating my ffmpeg so I can stay current. The tricky part of my situation is that I need my version of ffmpeg to properly recognize/use the prores codec as input; I remember this was a bit of a challenge to figure out when I initially installed ffmpeg (yes, from about 9 months ago...that's when I was working on my episode 2 release).

i don't think the ffmpeg version will actually help my situation though, unless they have added the ability to author avchd disc images. :)
 
Probably not. There is, however, a slim chance that a bugfix may have helped. You could check the changelogs - if they're in a human-readable format, that is. ;)
 
Good news -- the changes I made based on the Captains suggestions seemed to have worked, and the new avchd plays fine for the reviewer who had previous problems. My suspicion is that the b-pyramid=0 was a key change. I also disabled the open-GOP, and just to be safe I used profile 4.1 since that's what BDs use and I figured some players might only accept that profile. All my other settings remained the same, and I used toast to mix and author the disc.

thanks again for everyone's help!
 
You're welcome. Yes; 4.1 is the safer option. I am glad that you solved your problem. :)
 
Back
Top Bottom