Audio pass through from H264 to FLV?
August 9, 2013 11:36 AM   Subscribe

The problem: I've been given H264 files with 8 channels of audio. I need to convert these to FLV files for a live preview.

This means I need the stereo comp left and stereo comp right (Ch. 7 and Ch. 8) because those are where the V.O. resides, and I need this to be an easy repeatable workflow that I can batch or queue. Assume I am an idiot with FCP, Compressor, and CS6 Media Encoder at my disposal. Most of the preset FLV converters I'm finding will only pull stereo at best, so Ch.1 and Ch.2, which in this case is not the total sound, just M&E. Is there a way for me to select discrete channels or do a total pass through? Is this something obvious that I'm just missing?
posted by last night a dj saved my life to Computers & Internet (9 answers total) 1 user marked this as a favorite
 
Best answer: Are you at all comfortable with a command line? This is the sort of thing that can be (fairly) simply done and batched with ffmpeg; the hardest part is figuring out which options to use, but we can help with that.
posted by jammer at 11:48 AM on August 9, 2013


Response by poster: Jammer, I am but this will ultimately be a job for users who will not have command line skills or even admin rights. I'm hoping to make them something like a Compressor droplet. If it must be ffmpeg then I'll take what I can get, though.
posted by last night a dj saved my life at 11:53 AM on August 9, 2013


Gotcha. I'll see if anyone with experience with the software you mentions chimes in; and if not, I'll confirm a functional command line for you tonight if no one beats me to it.

(It always takes me a couple times to get that sort of thing correct. Stupid powerful ffmpeg...)
posted by jammer at 12:03 PM on August 9, 2013


Best answer: Handbrake's the only GUI solution I can think of that has simple selection of audio tracks. It'll add a second step and some loss, but you could do this with with Handbrake and then the media encoder of your choice:

• convert 9-track mp4s to 3-track mp4s (video plus two audio) with generous bitrates

• convert output with Compressor or what have you

It's not optimal, but it's simple

Alternately, if you want to do the ffmpeg route:

ffmpeg -i SOURCE.mp4 -b 1200k -ab 128k -ar 44.1k -minrate 1200k -maxrate 1200k -bufsize 1200k -map 0:0 -map 0:7 -map 0:8 -vcodec libx264 -acodec libfaac OUTPUT.flv

I don't have a 9-track mp4 handy to test on, but using -map 0:0 -map 0:1 and -map 0:2 just provided me with a clean encode on a 3-track.

Adjust the -b and -ab to whatever your desired total bitrate and audio bitrate are, and make -maxrate, -minrate and -bufsize match -b. Those last three are perhaps not strictly necessary to include, but ffmpeg sometimes throws an error or goes way under threshold when you assume, so I always put them in.

You can give the folks handling this written instructions on how to navigate to the proper directory in a terminal and tell them to copy/paste and just replace the desired filenames. If you can get past the initial barrier of getting ffmpeg installed for them, this will actually be pretty easy.
posted by Mayor Curley at 2:17 PM on August 9, 2013


Also, you've probably covered this, but I'll make the suggestion just in case:

Is there a chance that whatever app these are going into could handle mp4s? Flash-based players can handle mp4s natively, and in that case you could just use Handbrake.
posted by Mayor Curley at 2:25 PM on August 9, 2013


Response by poster: Mayor Curley, I wish mp4s would work but this is for a stupid proprietary content management system. Both your suggestion and jammer's worked in ffmpeg and then oddly enough I found a preset in Media Encoder CS6 that worked for all source attributes even though it implied stereo only.
posted by last night a dj saved my life at 3:04 PM on August 9, 2013


You can give the folks handling this written instructions on how to navigate to the proper directory in a terminal and tell them to copy/paste and just replace the desired filenames.

Or you can just write a tiny cmd script that accepts a single input filename as a parameter, generates an output filename by substituting .flv for .mp4, then invokes ffmpeg as above. Your users can just drag and drop a .mp4 file onto the cmd script's icon, and it will run and make the output file.
posted by flabdablet at 9:50 AM on August 10, 2013


The Mayor's syntax will, I think, forcibly reencode the video. Assuming that you want to keep the video as is, use -vcodec copy in place of -vcodec libx264. Will save time.
posted by Gyan at 12:24 PM on August 10, 2013 [1 favorite]


Gyan, I didn't suggest that in the interest of simplicity, but you're right to suggest it.

There's a danger that direct copying won't work quite right, but it's both time and quality-saving and worth a shot. Switching container formats in ffmpeg with a direct copy doesn't always give perfect results-- re-encoding is the safest way to avoid playback problems and make sure that the content complies with the format header and metadata. Problems range from the sync being off to unforgiving playback devices not playing a stream or refusing to play at all.

So if you go that route, test it thoroughly. But it's definitely worth a shot.
posted by Mayor Curley at 4:44 AM on September 25, 2013


« Older Nonfiction books about exciting professions...   |   English to Polish Translation for a Wake Newer »
This thread is closed to new comments.