How to use ffmpeg command without any codec? - ffmpeg

I am using the following command to create an mp4 container, input in a raw file, and the problem I have is FFmpeg apparently trying to encode me in H264. Is there a way to tell FFmpeg not to use any codec? that is, how do I use FFmpeg without compressing anything? Thanks!
Command statement i'm using:
ffmpeg -f rawvideo -pixel_format rgb24 -video_size 160x120 -framerate 24 -i file out.mp4
Output:

Related

Extracting frames from video while recording using ffmpeg

I am using ffmpeg to record a video using a Raspberry Pi with its camera module.
I would like to run a image classifier on a regular interval for which I need to extract a frame from the stream.
This is the command I currently use for recording:
$ ffmpeg -f video4linux2 -input_format h264 -video_size 1280x720 -framerate 30 -i /dev/video0 -vcodec copy -an test.h264
In other threads this command is recommended:
ffmpeg -i file.mpg -r 1/1 $filename%03d.bmp
I don't think this is intended to be used with files that are still appended to and I get the error "Cannot use -sseof, duration of test.h264 not known".
Is there any way that ffmpeg allows this?
I don't have a Raspberry Pi set up with a camera at the moment to test with, but you should be able to simply append a second output stream to your original command, as follows to get, say, 1 frame/second of BMP images:
ffmpeg -f video4linux2 -input_format h264 -video_size 1280x720 -framerate 30 -i /dev/video0 -vcodec copy -an test.h264 -r 1 frame-%03d.bmp

How to stream webcam video using ffmpeg?

I am very new to ffmpeg and just read some examples on how to open a video file and decode its stream.
But is it possible to open a webcam's stream, something like:
http://192.168.1.173:80/live/0/mjpeg.jpg?x.mjpeg
Is there any examples/tutorials on this?
I need to use ffmpeg as decoder to decode the stream in my own Qt based program.
Nyaruko,
First check if your webcam is supported... Do
ffmpeg -y -f vfwcap -i list
Next ,
ffmpeg -y -f vfwcap -r 25 -i 0 out.mp4 for encoding
This site has helpful info;
http://www.area536.com/projects/streaming-video/
Best of Luck.
This works for live video streaming:
ffplay -f dshow -video_size 1280x720 -i video0
The other option using ffmpeg is:
ffmpeg -f dshow -video_size 1280x720 -i video0 -f sdl2 -
Above both the solution are provided by FFMPED

convert video by ffmpeg

I have problem with converting video.
I have a line in my bash script:
ffmpeg -i in.mp4 -vcodec mjpeg -r 25 out.avi
and I recieve an error when I try to run it
'NULL # 0x1cbeb60] Unable to find a suitable output format for 'out.avi
: Invalid argument
any idea why this is error is coming up?
You might need to specify an output format -f to ffmpeg:
ffmpeg -i in.mp4 -vcodec mjpeg -f avi -r 25 out.avi
-f avi denotes output to avi format.

Ffmpeg to convert gif to webm with reverse function

I'm trying to convert a gif file to webm file using the below which works fine however I’m wondering is it also possible to reverse it as well using ffmpeg or would I need to reverse it using imagemagick first then cover it using ffmpeg
ffmpeg -i your_gif.gif -c:v libvpx -crf 12 -b:v 500K output.webm
Any help is appreciated
The script posted here might help you.
This one seems to be in bash but ripping the commands should work on Windows as well.
https://github.com/WhatIsThisImNotGoodWithComputers/ffmpeg-webm-scripts
These are the relevant lines of code (note that they need to edited for your setup):
ffmpeg -i "${INPUT_FILE}" -ss $START_TIME -to $TO_TIME -an -qscale 1 $TEMP_FOLDER/%06d.jpg
cat $(ls -r $TEMP_FOLDER/*jpg) | ffmpeg -f image2pipe -vcodec mjpeg -r 25 -i - -c:v libvpx -crf 20 -b:v $FRAMERATE $CROPSCALE -threads 0 -an $OUTPUT_FILE
You basically have to convert all stills to jpgs and then back into webm, but in reverse order.
From ffmpeg --help, you can see what codecs ffmpeg supports with ffmpeg -codecs. ffmpeg -codecs|grep -i gif on mine says it supports gif.
ffmpeg checks extensions to get file type if you don't override,
ffmpeg -i onoz.webm onoz.gif
does the trick just fine.

convert yuv to avi using gstreamer

I want to convert an avi file to an yuv file. I tried using
ffmpeg -i <input.avi> <output.yuv>
but not getting converted. can anybody suggest me conversion using gstreamer?
This is how you solve it using ffmpeg
ffmpeg -i in.avi -vcodec rawvideo -pix_fmt yuv420p -o out.yuv
Converts any input to 420 planar yuv.

Resources