FFMPEG - Convert UInt16 Data to .264 - ffmpeg

At the moment, I'm trying to convert with FFMPEG my raw data in uint16 format from an infrared camera to MP4 format or at least to .h264.
My current command for ffmpeg is here:
ffmpeg -f rawvideo -pix_fmt gray16be -s:v 140x110 -r 30 -i binaryMarianData.bin -c:v libx264 -f rawvideo -pix_fmt yuv420p output.264
But my ouput File is not really looking good :(
Frame of My Input, its a Nose
Frame of My Output
Here is my Input File: http://fileshare.link/91a43a238e0de75b/binaryMarianData.bin
Update 1: Little Endian
Hey guys, would be great if it's possible to get the video output in the little endian byte order.
This is a frame shown with ImageJ with the following settings
Settings of the shown frame above in ImageJ
Unfortunaley my output doesn't look like this.
Output Frame Little Endian
This is my command used to convert the RAW File:
ffmpeg -f rawvideo -pixel_format gray16le -video_size 110x140 -framerate 30 -i binaryMarianData.bin -vf transpose=clock -c:v libx264 -pix_fmt yuv420p output.264

It is sideways, so the stride has to be corrected and the image rotated.
ffmpeg -f rawvideo -pixel_format gray16be -video_size 110x140 -framerate 30 -i binaryMarianData.bin -vf transpose=clock -c:v libx264 -pix_fmt yuv420p output.264

Related

ffmpeg only shows one Image?

Here are the images I have in my folder:
img001.png
img002.png
They are stored in c:/frames.
Because that my frames are not shown correctly, used the FPS filter video shown below (documentation from https://trac.ffmpeg.org/wiki/Slideshow):
ffmpeg -r 1/5 -i img%03d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p out.mp4
I tried running on my VLC media player but it still doesn't work. It only shows one image.
The last frame of an image sequence will only be shown for an instant. Use tpad filter to clone it once and then apply other filters like fps.
ffmpeg -framerate 1/5 -i img%03d.png -vf "tpad=stop=1:stop_mode=clone,fps=25" -pix_fmt yuv420p -c:v libx264 out.mp4

How does FFMPEG change fps without dropping frames?

Here I got a video which has the FPS 30, duration 10s, and has 300 frames. How could I turn the video to 25FPS without dropping frames.
I suppose the -r or fps=fps=25 is kind of resampling method or not working.
My commands are like:
ffmpeg -i input.flv -vf "scale=800:450, fps=25" output1.flv
or
ffmpeg -i intput.flv -filter:v fps=fps=25 -c:v libx264 -c:a copy -pix_fmt yuv420p -profile:v high -f mp4 -vf scale=800:450 output2.mp4
The result is that output1.flv dropped frames, and output2.mp4 didn't work.
If you're re-encoding the video stream, then
ffmpeg -r 25 -i input.flv ...
If there's audio, you'll have to adjust its tempo as well by adding
-af atempo=0.834
where 0.834 is 25/30.

Chroma Subsampling with ffmpeg

I want to create an .mp4 output. But it doesn't work...
I'm using ffmpeg. My input video is a raw video and I want to have an raw video .mp4 at the end.
My code that i use:
ffmpeg.exe -i input.y4m -c:v rawvideo -vf format=yuv420p output.y4m
Can anyone help me out? :)
The correct syntax is: ffmpeg.exe -i input.y4m -pix_fmt yuv420p output.y4m
Test sample:
Build synthetic video y4m file in YUV444 format:
ffmpeg -f lavfi -i testsrc=rate=10:size=160x120 -t 5 -pix_fmt yuv444p input1.y4m
Convert from YUV444 to YUV420:
ffmpeg -i input1.y4m -pix_fmt yuv420p output1.y4m
You can also create AVI raw video:
ffmpeg -i input1.y4m -c:v rawvideo -pix_fmt yuv420p output1.avi
But you can't create raw mp4 video.
Following code: ffmpeg -i input1.y4m -c:v rawvideo -pix_fmt yuv420p output1.mp4 returns error message:
[mp4 # 00000140d77eb9c0] Could not find tag for codec rawvideo in stream #0, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
There is an error because mp4 container doesn't support raw video format.

Seek issue of HEVC streams with ffplay

I'm attempting to perform a seek operation in an MPEG-TS stream that contains a HEVC encoded bit stream. The HEVC stream is encoded using the following command;
ffmpeg -s:v 1920x1080 -i kimono.yuv -c:v libx265 -x265-params crf=23:fps=30:keyint=10:min-keyint=10 -c:a copy -f mpegts testhevc.ts
The seek operation is attempted with ffplay as;
ffplay testhevc.ts -ss 5 -vf showinfo
The information shown gives multiple initial errors with missing POCs, such as;
Could not find ref with POC 126
However, everything works fine when the same operation is performed with H.264. The encoding with H.264/AVC is performed as;
ffmpeg -s:v 1920x1080 -i kimono.yuv -c:v libx265 -c:v libx264 -crf 23 -r 30 -keyint_min 10 -g 10 -c:a copy -f mpegts testh264.ts
Is this an issue with the ffmpeg tools for HEVC or am I missing something in these commands?.
Thanks.

ffmpeg for reducing ratio and quality of YUV to any other format

I have HD 1920x1080 YUV format videos.
I would like to compress them to 640x480and other convert to other format(mp4/avi..)
I used the follwing command:
ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -r 25 -i input.yuv -c:v libx264 output.mp4
It converts the video but it looks **blurry** and **broken**.
Does any one have better solution for my problem?
[There are lot of solutions i found as like as the above one but none of them works good]
I would most appreciate your help.
Your videos are not yuv420p, they are yuv422p. Use the following commandline:
ffmpeg -f rawvideo -pix_fmt yuv422p -s:v 1920x1080 -r 25 -i input.yuv -c:v libx264 output.mp4
And then use rate control variables for H264 encoding as documented here.
You are not specifying a quality factor, or a bit rate, So a default value is being chosen for you. try adding something like -crf 18.

Resources