Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
22nd July 2011, 23:35 | #1 | Link |
Registered User
Join Date: Aug 2009
Posts: 41
|
Is there a way to pipe video from quicktime into x264?
I've been having a problem, and I can't seem to find a specific solution for this anywhere.
I want to set up an encoder on a Mac OSX 10.6.7 machine to take command line input and encode quicktime files into H.264/AAC mp4 streams, but unfortunately the quicktime files are all unavoidably encoded using a proprietary codec. I have the decoder installed on the system, Quicktime opens them fine, but it's not a codec supported by libavcodec/ffmpeg, and it's not a codec I can get a library for. Is there any way to configure ffmpeg to use the system quicktime to feed it frames, or to call an instance of the quicktime component to pipe frames into ffmpeg? I... know this should go without saying, but no I'm afraid it's not possible to transcode everything in QuickTime Pro to Uncompressed or whatever just so ffmpeg can read them. If this were a windows system, I'd build ffmpeg with avisynth and use an avs script with "QTSource", but avisynth doesn't build outside of windows I'm told, and I'm also told http://avisynth3.unite-video.com/ is not yet in a usable state and was largely abandoned (is this worth trying to compile to test with?) If I just needed to make quicktime files, I'd use the x264 build-as-a-QuickTime-component thing from http://www003.upp.so-net.ne.jp/mycometg3/, but it doesn't have all the options I need or presets I'd prefer, and I don't think would work from the command line. And I can't make .mp4s from it. If I were coming from ProRes, I'd be able to use MPlayer (at least, according to http://doom10.org/index.php?topic=1822.msg8476#msg8476) but as far as I can understand that solution won't work for anything other than ProRes. Though I will try it next. (and I'm very hesitant to start messing around with Wine) And I tried ffmbc from http://code.google.com/p/ffmbc/ but it doesn't include what I need I know that ffmpeg is working, I made sure and built it with libraries for the latest x264 and faac, and I can encode from other sources etc etc. I'm just... at a loss. Anyone have any ideas? Maybe another program that can decode with quicktime system codecs and send data to x264? In case it matters: - The codec I need to decode is called Cineform, though really it's more universally about calling system QT decoders - The build of ffmpeg I'm using looks like: ffmpeg version N-31617-g4095fa9, Copyright (c) 2000-2011 the FFmpeg developers built on Jul 22 2011 18:35:30 with gcc 4.2.1 (Apple Inc. build 5646) configuration: --enable-gpl --enable-nonfree --enable-libx264 --enable-libmp3lame --enable-libfaac --arch=x86_64 --enable-static --disable-shared libavutil 51. 11. 0 / 51. 11. 0 libavcodec 53. 8. 0 / 53. 8. 0 libavformat 53. 6. 0 / 53. 6. 0 libavdevice 53. 2. 0 / 53. 2. 0 libavfilter 2. 27. 2 / 2. 27. 2 libswscale 2. 0. 0 / 2. 0. 0 libpostproc 51. 2. 0 / 51. 2. 0 - The command line I just tested with was: $ ffmpeg -i /Volumes/XXX/master.mov -f mp4 -vcodec libx264 -b 600k /Volumes/XXX/test.mp4 - And the error I got was (in pretty red colours in terminal!): [buffer @ 0x100f05940] Invalid pixel format string '-1' Error opening filters! |
23rd July 2011, 03:15 | #5 | Link | |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Quote:
Some Quicktime proprietary formats do have open source decoders, or will soon (Prores is a WIP). |
|
23rd July 2011, 04:08 | #6 | Link | |
Registered User
Join Date: Aug 2009
Posts: 41
|
Quote:
Oh hmm does this allow me to build DirectShow decoders as a library? Or did they actually build a decoder? http://forums.fedoraforum.org/showthread.php?t=254448 gives me hope! I'll report back whether I have any success. Sadly this won't do what I ultimately will need (ie for ProRes, and whatever comes after it etc) but CineForm support is a huge plus! |
|
23rd July 2011, 12:17 | #8 | Link |
Registered User
Join Date: Mar 2005
Location: Portugal
Posts: 907
|
Altough you're using a Mac have you tried batch remuxing the files to mp4 or hdmov?
in the past whenever i had difficulties converting mov i renamed or remuxed it to mp4 and it solved the problem. here's a link to a bach script (windows though maybe you can adapt it), if you do a bulk rename of the mov extension files to mp4 or hdmov it might work. |
23rd July 2011, 18:24 | #10 | Link | |
Registered User
Join Date: Aug 2009
Posts: 41
|
Quote:
|
|
23rd July 2011, 20:21 | #11 | Link |
Registered User
Join Date: Mar 2005
Location: Portugal
Posts: 907
|
forgot to post the link for the script:
http://forum.videohelp.com/threads/3...ux-FLV-mux-mp4 or use mpeg streamclip to remux mov to mp4 http://www.squared5.com/ its for flv and windows but it might work if you change flv to mov in the script Last edited by ricardo.santos; 23rd July 2011 at 20:28. |
27th July 2011, 21:29 | #12 | Link |
Registered User
Join Date: Aug 2009
Posts: 41
|
mplayer syntax problem?
So I'm trying to compile mplayer on Snow Leopard and it is being a horrible little beast... but for the time being I thought I would use the MacPorts version and at least try testing out some uncompressed files.
I'm having problems getting... some part of it to work though. I suspect I have the syntax wrong? I can't find any documentation for using the yuv4mpeg pipe with mplayer. the input line I'm giving it is Code:
$ mplayer -nosound -benchmark -vo yuv4mpeg:file=>(x264 --demuxer y4m --bitrate 2000 -o /Volumes/Temp_1/test.264) /Volumes/Asset_1/BARS_I420.avi Code:
x264 [error]: No input file. Run x264 --help for a list of options. MPlayer 1.0rc4-4.2.1 (C) 2000-2010 MPlayer Team 158 audio & 340 video codecs Playing /Volumes/Dam_Asset_1/BARS_I420.avi. AVI file format detected. [aviheader] Video stream found, -vid 0 AVI: ODML: Building ODML index (1 superindexchunks). VIDEO: [YUY2] 1920x1080 16bpp 23.976 fps 795467.6 kbps (97103.0 kbyte/s) Using (default) progressive frame mode.========================================================================== Opening video decoder: [raw] RAW Uncompressed Video Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] Movie-Aspect is undefined - no prescaling applied. [swscaler @ 0x101870e00]using unscaled yuyv422 -> yuv420p special converter VO: [yuv4mpeg] 1920x1080 => 1920x1080 Planar YV12 MPlayer interrupted by signal 13 in module: init_video_codec Selected video codec: [rawyuy2] vfm: raw (RAW YUY2) ========================================================================== Audio: no sound Starting playback... MPlayer interrupted by signal 13 in module: flip_page Does this make sense to anyone? Did I write that down right? I'm working under the assumption that it's Code:
-vo yuv4mpeg:file=>(x264 --various-options) input.avi I've also tried the mkfifo method described in http://forum.doom9.org/showthread.ph...94#post1234194 but that didn't work either Code:
$ mkfifo pip.y4m;x264 pipe.y4m --demuxer y4m --bitrate 2000 -o /Volumes/Temp_1/gLuce/test.264 & mplayer -benchmark -vo yuv4mpeg:file=pipe.y4m -ao null /Volumes/Dam_Asset_1/BARS_I420.avi [1] 47342 MPlayer 1.0rc4-4.2.1 (C) 2000-2010 MPlayer Team 158 audio & 340 video codecs Playing /Volumes/Dam_Asset_1/BARS_I420.avi. x264 [error]: could not open input file `pipe.y4m' I've never worked with pipes or anything like them before so i could appreciate whatever help I can get. Note: I'm afraid I need to use mplayer, not ffmpeg or whatever, because i will eventually need to be able to link to .ax binaries on a mac and it seems nothing but mplayer can do that? Also Note: I'm pretty sure I need to run x264 as its own application, since I don't think ffmpeg or whatever supports all the flags (--bluray-compat from http://www.x264bluray.com/home/1080i-p) for instance Last edited by Electron.Rotoscope; 27th July 2011 at 21:35. |
27th July 2011, 23:22 | #13 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
"mkfifo pip.y4m" should probably be "mkfifo pipe.y4m". Also, you cannot redirect the output to a file like you're trying to in the above examples. You either redirect the entire program's stdout or you redirect nothing. IIRC "-" is a special filename that makes the y4m output module write to stdout instead of to a file.
See also http://mplayerhq.hu/DOCS/man/en/mplayer.1.txt |
27th July 2011, 23:40 | #14 | Link | |
Registered User
Join Date: Aug 2009
Posts: 41
|
Quote:
Sadly, the man page isn't quite enough information for me, I'm not familiar at all with pipes or mkfifo or anything like that, so the one little paragraph about how to set it for interlaced sources was unfortunately not enough information. It also doesn't have anything about stdout... could you extrapolate a little? I guess I don't really know what you mean about that. |
|
28th July 2011, 07:03 | #15 | Link | |
Registered User
Join Date: Mar 2005
Location: Finland
Posts: 2,641
|
Quote:
Code:
mplayer -nosound -benchmark -vo yuv4mpeg:file=>(x264 --demuxer y4m --bitrate 2000 -o p.264 -) dvd1.mkv In both cases the data flows through a named pipe. -vo yuv4mpeg doesn't have that functionality unless it's been recently added and I haven't noticed. |
|
28th July 2011, 09:27 | #16 | Link |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
|
MediaPlayer Classic (MPC) offers the ability to call Quicktimes video and audio decoders.
I don't know if you can use MPC to serve to other applications though...
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
|
28th July 2011, 12:42 | #17 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
What about QuickTime Alternative? AFAIK it makes QuickTime decoders available to the DiretShow framework.
Can't it work with DirectShowSource() or DSS2() in Avisynth? Or maybe deliver the content directly to x264 with DirectShow-enabled builds of x264 (Direct264)?
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
28th July 2011, 14:07 | #18 | Link | |
Registered User
Join Date: Aug 2009
Posts: 41
|
Quote:
Oh hey, could I do something like Code:
mplayer -benchmark -vo yuv4mpeg:file=>(x264 --demuxer y4m --bitrate 2000 -o vid.264 -) -ao pcm:fast:file=>(NeroAacEnc -ignorelength -cbr 96000 -if - -of aud.aac) source.avi Last edited by Electron.Rotoscope; 28th July 2011 at 14:21. Reason: code improvements |
|
28th July 2011, 14:13 | #19 | Link | |
Registered User
Join Date: Aug 2009
Posts: 41
|
Quote:
I haven't heard of Direct264, can it be compiled on a system that doesn't have directshow itself? Unfortunately QuickTime Alternative does sort of the opposite of what I need, I'd like to be able to use proprietary .qtx style decoder binaries that can only come from the manufacturers (aka the ones for Cineform HD or RED3D or ProRes 4444) that the open source community has not yet reverse engineered. In a perfect world, all my sources would be uncompressed AVI, or at least something easy to decode, but alas such is life. Also I think QT Alternative is Windows-Only Edit: Actually you know what, QT Alternative would be fantastically useful if I ever need to decode like ProRes4444 with something that only takes DirectShow, I'll definitely keep it in mind if that ever comes up! Last edited by Electron.Rotoscope; 28th July 2011 at 14:24. |
|
Tags |
cineform, ffmpeg, mp4, x264 |
Thread Tools | Search this Thread |
Display Modes | |
|
|