AtomicParsley Bug Removes Video After Second Process

March 3, 2009

Update 2009-03-15: See update below.

AtomicParsley is a very cool little program that will allow you to apply metadata to video files on the commandline.

However, it appears that you only get one shot at applying metadata with it, or else the file will be left without video.

Here is what I mean and how to re-create this (apparent) bug:

How To Recreate

  1. Create an .m4v using HandBrake. Let’s call it “File1.m4v” for clarity.

  2. Apply some tags to File1.m4v using AtomicParsley which will create a new file, let’s call that File2.m4v.

  3. Apply some different tags to File2.m4v using AtomicParsley which will create a new file, let’s call that File3.m4v

Warning

AtomicParsley is used in several other GUI programs such as Lostify. If you use AtomicParsley as on File1.m4v and then use Lostify on File2.m4vm the resulting file will lose its video as well.

The same thing will happen if you use Lostify on File1.m4v and then on File2.m4v.

Note

a. This has been how the bug has bitten me. It may affect other formats created in other ways, but I am trying to be as specific as I can in the hopes of getting others to confirm this bug (or not confirm it).

b. This has happened to me on both my iMac and my MacBook, both of which are running 10.5.6.

I do not know if this bug shows up in the GUI programs, but it seems likely that it would, so be careful using those as well.

Result

For me, the result is that File3.m4v always loses its video.

QuickTime and iTunes show the video with a black screen.

VLC doesn’t show any video at all.

How to Work-Around

The key to avoiding this bug? Don’t apply tags with AtomicParsley (or programs that use it) more than once. Which is to say, you’d better keep your “File1.m4v” around until you are absolutely sure that you have all the tags that you want to apply.

Q: “What Do I Do If I Did Not Keep my File1.m4v?”

You can still edit the tags using iTunes. At least that worked for me in (limited) testing.

Final Notes

  1. There may be something that I am doing (or not doing) which is causing this, meaning that it is not a bug in AtomicParsley. But I am skeptical.

  2. I posted on the SourceForge forum for AtomicParsley and it was suggested that I try the “-4” flag to AtomicParsley. That flag had no noticeable effect. It appears that someone else may be running into the same problem.

  3. I also posted about being unable to compile from source on the same forum.

  4. It appears that the existence of AtomicParsley has meant that no other commandline programs for tagging video files has been created.

Sadly, AtomicParsley has not been updated since 2006-09-16 and will not even compile on my Mac OS X 10.5.6 machine:

$ ./build 
Compiling AP_commons.cpp ...
Compiling AtomicParsley_genres.cpp ...
Compiling AP_iconv.cpp ...
Compiling AP_NSFile_utils.mm ...
Compiling AP_NSImage.mm ...
AP_NSImage.mm: In function ‘bool ResizeGivenImage(const char*, PicPrefs, char*)’:
AP_NSImage.mm:204: error: ‘_NSBitmapImageFileType’ was not declared in this scope
AP_NSImage.mm:204: error: expected `;' before ‘filetype’
AP_NSImage.mm:208: error: ‘filetype’ was not declared in this scope
AP_NSImage.mm:212: error: ‘filetype’ was not declared in this scope
AP_NSImage.mm:216: error: ‘filetype’ was not declared in this scope
Compiling AtomicParsley.cpp ...
Compiling AP_AtomExtracts.cpp ...
Compiling APar_sha1.cpp ...
Compiling APar_uuid.cpp ...
Compiling main.cpp ...
Linking AtomicParsley...
i686-apple-darwin9-g++-4.0.1: obj_files/AP_NSImage.o: No such file or directory
strip: can't open file: AtomicParsley (No such file or directory)
[1]    38645 exit 1     ./build

However it is not clear to me that it would even matter if I could compile my own version.

All I am saying is that if you were in the market to develop a program for tagging video files on the commandline, don’t assume that the existence of AtomicParsley means that the market is full. Obviously, if you could build on the code which already exists, that would be excellent. AtomicParsley was released under a GNU license. Sadly, I am no programmer, so I can’t do much by the way of improving it.

Update: 2009-03-15

@schuetzdj suggested that the “Large File” flag may have something to do with it. That would make sense as all my files were done with the AppleTV preset which turns on Large File support, even though these files are less than 4GB in size.

To test this theory, I converted a file (MPEG sequence, v2, program multiplex) using HandBrake and the “AppleTV” preset twice: the first time I did it as the default, with “Large File Size” enabled; the second time I did used the AppleTV preset but turned off the “Large File Size” (LFS).

Then I used a shell script which I wrote which converts a file twice using AtomicParsley.

The results? The LFS file does not show video at all after processing with AtomicParsley. The Non-LFS file shows video even after two conversions with AtomicParsley.

Tentative conclusion: **AtomicParsley cannot handle the “Large File Size” flag that HandBrake sets, even if the file is less than 4GB **

If you would like to attempt to duplicate this bug, here is what I ask you to do:

1) Take a file from any source, and convert it twice: a) for AppleTV + LFS and b) for AppleTV without LFS.

2) Run the script above on both files.

3) Let me know which of the files show video, and which do not (either QuickTime Player or VLC)

The script was written for Mac OS X but ought to work on any Unix system where ‘AtomicParsley’ is installed.

Please leave comments below if you have results you would like to share.

  • Dan

    Confirmed in MetaX for Mac OSX, which uses Atomic Parsley on the back end.

  • mike

    Hmm. Did NOT occur in my test, both files have playable video.


    If it makes any difference, my Atomic Parsley is in a subfolder of my Applications folder, not in the usual path -- I amended the PATH command in the script to make sure it would be found.

  • I can confirm this happened with your script.

  • mike

    Just for good measure, I used Lostify on both the result videos... and they both still play fine.

  • David

    Well, didn't happen with me, using AtomicParsley CLI, on a first-gen G4 Mac Mini (up-to-date Leopard). Both output files played just fine. The source is H.264, AAC Stereo 48 KHz, if that helps. Also, the -t option shows only six atoms in use: @nam, @ART, @gen, tvsh, tven, and @too. @too was HandBrake 0.9.2 2008021900.


    I also tried a different file (mp4 extension, but it's generated by home-rolled ffmpeg scripts so I've no idea whether it's actually an m4v container), and that worked too, with similar atoms (no @too, but had @cmt).


    I don't have much else media-wise on this box (I may have VLC, but that's about as exotic as I get). The HandBrake actually happens on a faster box (Intel MacBook). Maybe I'll try on that box later, if I get a chance.


    Ping me if you'd like me to check any specific atoms, or set any that you have but I don't, and I'll try again.

  • David

    Dang. I finally got around to trying this on an intel box (now that I'm converting TMBG's kid's videos and have lots of short files to tag), and guess what? Didn't work. First video was fine, 2nd had sound but no visual. Grr.


    This time was a straight handbrake rip/encode, with no tags added at all. I also tried adding a couple basic tags in iTunes and then ran the test script again, and again, no video in the second file.


    Maybe it's an intel vs G4 thing? Might even be in a library somewhere. I guess I'll have to do my Parsley tagging on the G4 box for now, or just stick with iTunes. :(

  • David

    Well, shoot. Just tried this again, back on the G4, and the bug's there again. So I'll have to compare the files I just encoded with those that didn't fail and see if I can figure out the difference.


    Have you done any further research on this?

  • I have not. I have heard here and on Twitter that some have made it happen, and some have not.


    Every file that I have, files which are ripped from DVDs, exhibit this behavior.


    I wonder if there is something different about files that come from other sources (AVIs? MOVs?)


    All of my tests are done on an Intel iMac

  • David

    I just found three files that won't even survive the first Atomic Parsley hit. They Might Be Giants "Here Come the ABCs" has three tracks (out of like 40) which go blank after a single pass with AP: Both "A to Z" versions and the "Stalk of Wheat" bonus track. Every other chapter (individually) ripped from that DVD worked fine, though I suspect that they'd fail after a second AP pass.


    My hadbrake settings are very similar to the iPod High Res and Normal presets. Reading down the interface, we have set: MP4 file, Large file size, H.264, frame rate same as source, avg bitrate 1000, (single pass), Track 1 LPCM AAC (faac) stereo 48 khz 160 kbps (and same for track 2 -- other discs have one track as AC3 pass thru and the other as (I believe) an LPCM stereo mix-down.) Chapter marks are created, and I doubt I changed anything in advanced. I'm also generally ripping straight through Handbrake (VLC installed in Applications), rather than using a first MacTheRipper step.


    I tried doing a dump of all the tags before and after an Atomic Parsley step, but didn't see much useful in the diff (granted, I haven't really tried to figure it out yet). But now I've got at least three different cases I can investigate -- no problems, problems after two passes, and now problems after one pass. So hopefully I can find something in there.


    'Cause I gotta agree with you -- a simple script to tag everything at once is SO much easier than doing it in any of the GUIs. :)

  • Hi,
    I am using AtomicParlsey command with -P.


    After using it I tried to altered file using ffmepg. but it does not support it and gives the "moov atom not found" error.


    Anyone knows the solution for this?


    Thanks in advance,
    --Kapil

blog comments powered by Disqus

Previous post: Did HandBrake leave you with a unplayable movie in QuickTime or Muffled Audio in VLC?

Next post: SuperDuper Bash Script to Automatically Mount or Unmount a Hard Drive