How to record YUV video and encode it to mp4 using h264 coded for mac application.
Plz suggest me any link on it.
FFMpeg can encode YUV to mp4(H.264) via libx264 encoder. But you have to specify exact YUV pixel format of your source video. There are several YUV formats.
This command converts rawvideo with pixel format of yuv420p to a MPEG-4 or x264 format.
# Converts the raw yuv420p data to a MPEG-4 video
ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1280x720 -framerate 25 -i 'in' -f mp4 'out'
Below list shows YUV pixel formats can be decoded by ffmpeg.
$ ffmpeg -pix_fmts 2>&1 | grep yuv
yuv420p
yuv422p
yuv444p
yuv410p
yuv411p
yuvj420p
yuvj422p
yuvj444p
yuv440p
yuvj440p
yuva420p
yuv420p16le
yuv420p16be
yuv422p16le
yuv422p16be
yuv444p16le
yuv444p16be
yuv420p9be
yuv420p9le
yuv420p10be
yuv420p10le
yuv422p10be
yuv422p10le
yuv444p9be
yuv444p9le
yuv444p10be
yuv444p10le
This is the easiest way to convert video formats using MacOSX command line (any version). First download this compressed file and unpack it to your Movies Folder:
https://drive.google.com/file/d/0B3NlLwMD4yd9QU0yVGJyU1NiUDA/view?usp=sharing
You will then have a MMedia_Converter directory with two apps: MMedia_Convert and Android_Converter. Those are my own developed MacOSX open source applications, bassed on FFMpeg Group and HandBrake Group France previous work. Both are fully compliant Mac compilled applications and you´ll have have to do nothing but extract them to your Movies Folder.
You also have there, 3 folders: clip_in, clip_out and scripts.
You must put the videos you want to be converted in the clip_in folder.
The converted output videos, will be generated automatically in the clip_out folder.
In addition you have 2 bash scripts, that you must move to your Mac OSX Desktop.
Once these bash are on desktop, edit them with TextEdit, and change my user name by your Mac name.
In my case, I use one script to generate thumbnails and the other to generate thumbnails too, and to automatically convert videos from any formar to wathever I choose.
"Whatever" means, that if you want to convert mpeg to mkv, you will have to declare it in line: DEST_EXT=mkv (or wathever known video format you want).
Hope this will help you all.
Best Regards, Tomás Hernández
Related
My goal is transcode this file with ffmpeg.
https://drive.google.com/open?id=1ATuPtSbZeQLexB1HBP509hInDOTyfEV8
ffplay fails to analize or play this file and returns:
Invalid pixel format.
This is the simply command:
ffplay -i testproxy.mxf
ffprobe -i testproxy.mxf -show_stream
It has been encoded by avid Interplay whit this targhet quality:
H.264 800Kbps Proxy 1080i 25
Maybe it's a raw file? and need same specification ahead input file?
Any suggestion is appreciated
Either Interplay doesn't write* a standard MXF or there's a limitation in ffmpeg's mxf demuxer.
But you can play the file with
ffplay -vcodec h264 testproxy.mxf
and similarly, you can transcode using
ffmpeg -vcodec h264 -i testproxy.mxf ...
*more likely, as mediainfo also fails to detect the video codec.
I have a raw YUV video file that I want to do some basic editing to in Adobe CS6 Premiere, but it won't recognize the file. I thought to use ffmpeg to convert it to something Premiere would take in, but I want this to be lossless because afterwards I will need it in YUV format again. I thought of avi, mov, and prores but I can't seem to figure out the proper command line to ffmpeg and how to ensure it is lossless.
Thanks for your help.
Yes, this is possible. It is normal that you can't open that raw video file since it is just raw data in one giant file, without any headers. So Adobe Premiere doesn't know what the size is, what framerate ect.
First make sure you downloaded the FFmpeg command line tool. Then after installing you can start converting by running a command with parameters. There are some parameters you have to fill in yourself before starting to convert:
What type of the YUV pixel format are you using? The most common format is YUV4:2:0 planar 8-bit (YUV420p). You can type ffmpeg -pix_fmts to get a list of all available formats.
What is the framerate? In my example I will use -r 25 fps.
What encoder do you want to use? The libx264 (H.264) encoder is a great one for lossless compression.
What is your framesize? In my example I will use -s 1920x1080
Then we get this command to do your compression.
ffmpeg -f rawvideo -vcodec rawvideo -s 1920x1080 -r 25 -pix_fmt yuv420p -i inputfile.yuv -c:v libx264 -preset ultrafast -qp 0 output.mp4
A little explanation of all other parameters:
With -f rawvideo you set the input format to a raw video container
With -vcodec rawvideo you set the input file as not compressed
With -i inputfile.yuv you set your input file
With -c:v libx264 you set the encoder to encode the video to libx264.
The -preset ultrafast setting is only speeding up the compression so your file size will be bigger than setting it to veryslow.
With -qp 0 you set the maximum quality. 0 is best, 51 is worst quality in our example.
Then output.mp4 is your new container to store your data in.
After you are done in Adobe Premiere, you can convert it back to a YUV file by inverting allmost all parameters. FFmpeg recognizes what's inside the mp4 container, so you don't need to provide parameters for the input.
ffmpeg -i input.mp4 -f rawvideo -vcodec rawvideo -pix_fmt yuv420p -s 1920x1080 -r 25 rawvideo.yuv
I'm trying to create an MP4 video with ffmpeg using JPEG2000 images as frames.
It works when the JPEG2000 is 8bpp, but I need it to work for at least 12 bits (ideally 12, but could be 16). The images are grayscale.
This is the command I'm using:
ffmpeg.exe -i imagen.jp2 video1.mp4
If I try to use -pix_fmt it says it's not supported by the encoder (it doesn't matter which format I use).
Some sample images can be found here:
http://ioingresodemanda.com/jp2.rar
I could also use any other tool, it doesn't need to be ffmpeg.
UPDATE: Adding ffmpeg output - http://pastebin.com/NyY3vgpz
Thanks in advance
If you are ok with mp4 file having a different video format the following will work
ffmpeg -strict -2 -i 12bit.jp2 -vcodec libx264 -an out.mp4
ffmpeg -strict -2 -i 12bit.jp2 -vcodec mpeg4 -an out.mp4
ffmpeg doesn't support 12-bit color. Most of the H264 profiles only support 8-bit color; a few support 10-bit, and only the super-obscure lossless Hi444PP profile supports 14-bit color. The x264 encoder does support some of the profiles with 10-bit color, but that's as far as it goes, and you have to explicitly enable it using the --bit-depth option:
http://git.videolan.org/?p=x264.git;a=commit;h=d058f37d9af8fc425fa0626695a190eb3aa032af
As noted in the commit, you may also want to keep in mind that "very few H.264 decoders support >8 bit depth currently".
I'm converting a file to PNG format using this call:
ffmpeg.exe -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s <width>x<height> -i infile -f image2 -vcodec png out.png
I want to use a converter that can be linked or compiled into a closed-source commercial product, unlike FFmpeg, so I need to understand the format of the input file I'm passing in.
So, what does rawvideo mean to FFmpeg?
Is FFmpeg determining what type of raw format the input file has, or does rawvideo denote something distinct?
What does rgb32 mean here?
The size of the input file is a little more than (width * height * 8) bytes.
Normally a video file contains a video stream (whose format is specified using -vcodec), embedded in a media container (e.g. mp4, mkv, wav, etc.). The -f option is used to specify the container format. -f rawvideo is basically a dummy setting that tells ffmpeg that your video is not in any container.
-vcodec rawvideo means that the video data within the container is not compressed. However, there are many ways uncompressed video could be stored, so it is necessary to specify the -pix_fmt option. In your case, -pix_fmt rgb32 says that each pixel in your raw video data uses 32 bits (1 byte each for red, green, and blue, and the remaining byte ignored).
For more information on what the options mean, see the ffmpeg documentation.
We're converting a bunch of .RM files to .MP4 and wondered what the best way is. Here are the details:
Convert the files to H.264.
Keep the filename but add .mp4 to the end.
Also extract a JPG image of the video at about 5 seconds in for each file and name it the original filename + .jpg.
This is on a Windows system. Is there a free tool you recommend for this? Thank you.
ffmpeg is pretty much the defacto standard app for transcoding video.
http://www.ffmpeg.org/
Convert to h264/mp4:
ffmpeg.exe -i inputFile.rm -vcodec libx264 -s 320x240 -acodec libfaac outputFile.mp4