I'm new to encoding and I like to do my encodings in x265 10bit. Currently, I'm facing a little issue with ffmpeg. I noticed when I'm using libx265 encoder output file looks a little bit blurred or small detail loss. Code I used to do my encodes is
ffmpeg -i input.mp4 -c:v libx265 -preset medium -crf 22 -pix_fmt yuv420p10le -c:a copy -y output-x26510bit.mkv
I've found out psycho-visual options might help in this case. I modified my code in to
ffmpeg -i input.mp4 -c:v libx265 -preset medium -crf 22 -pix_fmt yuv420p10le -psy-rd 2 -psy-rdoq 4 --rdoq-level 1 -c:a copy -y output-x26510bit.mkv
When I issue the above command, I get an error code
C:\Users\abc\Desktop\1>ffmpeg -i input.mp4 -c:v libx265 -preset medium -crf 22 -pix_fmt yuv420p10le -psy-rd 2 -psy-rdoq
4 -rdoq-level 1 -c:a copy -y output-x26510bit.mkv
ffmpeg version git-2020-04-03-52523b6 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3.1 (GCC) 20200328
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enabl
e-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enabl
e-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --
enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-l
ibvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
--enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --en
able-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 42.102 / 56. 42.102
libavcodec 58. 77.101 / 58. 77.101
libavformat 58. 42.100 / 58. 42.100
libavdevice 58. 9.103 / 58. 9.103
libavfilter 7. 77.101 / 7. 77.101
libswscale 5. 6.101 / 5. 6.101
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Unrecognized option 'psy-rdoq'.
Error splitting the argument list: Option not found
How do I solve this issue
These are not valid standalone options for libx265 in ffmpeg. You can see what private options are supported with ffmpeg -h encoder=libx265.
If you want to use additional options you have to use them with the -x265-params option:
ffmpeg -y -i input.mp4 -c:v libx265 -preset medium -crf 22 -pix_fmt yuv420p10le -x265-params psy-rd=2:psy-rdoq=4:rdoq-level=1 -c:a copy output-x26510bit.mkv
Related
Here is the problem. My code is:
cat *.png | ffmpeg -framerate 30 -f image2pipe -i -c:a copy -c:v libx264 -crf 18 -preset veryslow - output.avi
output is:
ffmpeg -framerate 30 -f image2pipe -i -c:a copy -c:v libx264 -crf 18
-preset veryslow - output.avi ffmpeg version 5.1.2-essentials_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers built with gcc 12.1.0 (Rev2, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static
--disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband libavutil 57. 28.100 / 57. 28.100 libavcodec 59. 37.100 / 59. 37.100 libavformat
59. 27.100 / 59. 27.100 libavdevice 59. 7.100 / 59. 7.100 libavfilter 8. 44.100 / 8. 44.100 libswscale 6. 7.100 /
6. 7.100 libswresample 4. 7.100 / 4. 7.100 libpostproc 56. 6.100 / 56. 6.100
-c:a: Protocol not found Did you mean file:-c:a?
I am not sure how to proceed.
A one liner that I found elsewhere.
I'm trying to do video stream via RTMP to Instagram with FFMPEG
I'm able to do it to facebook and twitter, but instagram is an other beast...
when I create a live broadcast in instafeed or yellowduck I get a stream key
when I do this
ffmpeg -rtbufsize 256M -re -i file.webm -acodec libmp3lame -ar 44100 -b:a 128k -pix_fmt yuv420p -profile:v baseline -s 720x1280 -bufsize 6000k -vb 400k -maxrate 1500k -deinterlace -vcodec libx264 -preset veryfast -g 30 -r 30 -f flv rtmps://live-upload.instagram.com:443/rtmp/--key--here--
ffmpeg outputs nothing, no error and I see no video in instafeed panel :(
In other network I got sometimes error in ffmpeg log... but when it's to instagram : just blank nothing
what do I miss?
here the log
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
and completely blank, no error, no framerate infos like any other transcoding...
Wrap the output in quotes:
"rtmps://live-upload.instagram.com:443/rtmp/--key--here--"
The command I'm using :
ffmpeg -f gdigrab -framerate 24 -i desktop -preset ultrafast -pix_fmt yuv420p camera1.mp4
Stream #0: not enough frames to estimate rate; consider increasing probesize
And also :
Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
And then all the time :
Past duration 0.810524 too large
Some info :
ffmpeg -f gdigrab -framerate 24 -i desktop -preset ultrafast -pix_fmt yuv420p camera1.mp4
ffmpeg version N-81045-g450cf40 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 50.100 / 57. 50.100
libavformat 57. 42.100 / 57. 42.100
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 47.100 / 6. 47.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
[gdigrab # 00000000026a24a0] Capturing whole desktop as 1920x1080x32 at (0,0)
ffmpeg tries to guess the effective framerate of the input. It does this by examining input frames to fetch their timestamps. At a minimum, ffmpeg wants 2 frames to make some guess. But there is a limit set to how much of the data ffmpeg will read for this and other information-gathering purposes. The default value is 5 megabytes. Windows GDI supplies uncompressed frames so they can take a lot of space. For a 1920x1080x32 input, you need to read at least 16.6 MB for 2 frames, but ideally 4 to 5 frames for an accurate assessment. So,
ffmpeg -f gdigrab -framerate 24 -probesize 42M -i desktop -preset ultrafast -pix_fmt yuv420p camera1.mp4
gdigrab's framerate option is private to it and only tells the grabber how long to wait between captures.
For the other two messages, you should upgrade ffmpeg. Your build is at least a few years old.
The result of my bellow FFmpeg command has no audio (is silent):
ffmpeg -f gdigrab -framerate 30 -i desktop -video_size 720x480 -c:v libvpx-vp9 -c:a libopus -b:v 1M -b:a 128K -auto-alt-ref 0 -crf 10 -preset ultrafast output.webm
But this one has audio:
ffmpeg -f gdigrab -i desktop -f dshow -i audio="Microphone (4- High Definition Audio Device)" output.mkv
How should I capture as webm file by using libopus or libvorbis?
What is the problem in my first command?
My FFmpeg version:
ffmpeg version N-93439-gb073fb9eea Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20190212
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab
--enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 26.100 / 56. 26.100
libavcodec 58. 47.105 / 58. 47.105
libavformat 58. 26.101 / 58. 26.101
libavdevice 58. 7.100 / 58. 7.100
libavfilter 7. 48.100 / 7. 48.100
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Issues are best troubleshooted by changing one variable at a time. Your 2nd command has two changes - an audio input and a different container profile (webm -> mkv).
gdigrab is a video grabber, so no audio is supplied. You need to feed an audio input.
ffmpeg -f gdigrab -framerate 30 -video_size 720x480 -i desktop -f dshow -i audio="Microphone (4- High Definition Audio Device)" -c:v libvpx-vp9 -b:v 1M -crf 10 -auto-alt-ref 0 -c:a libopus -b:a 128K output.webm
I'm trying to make a stream using a webcam as data input with FFmpeg, but I need to stream a video in addition to the stream. Both features with the same command for a few minutes.
(If placed separately the recording code works perfectly)
FFmpeg code:
ffmpeg -f dshow -i video="Integrated Webcam" -t 300 -c:v libx264 -segment_atclocktime 1 -segment_format mp4 '/meu_video.mp4' | -s 640x360 -ac 2 -f flv -vcodec libx264 -profile:v baseline -maxrate 600000 -bufsize 600000 -r 25 -ar 44100 -c:a libfaac -b:a 128k "http://localhost:3030"
There are two errors, one when I try to join the two codes using | or \ and the other when I put only the stream code to test.
Log multiple outputs:
ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
Input #0, dshow, from 'video=Integrated Webcam':
Duration: N/A, start:
264374.193000, bitrate: N/A
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 30 fps, 30 tbr, 10000k tbn, 10000k tbc
http://localhost:3030/: Unknown error
Edit 3: I ran the command using -report and generated the report, but it's too big to paste into the question.
https://www.dropbox.com/s/2xsuzq5fx464o4w/ffmpeg-20171109-145406.log?dl=0
You don't need a separator.
ffmpeg -f dshow -rtbufsize 32M -i video="Integrated Webcam" -t 300 -c:v libx264 -segment_atclocktime 1
-segment_format mp4 '/meu_video_%d.mp4' -s 640x360 -f flv
-vcodec libx264 -profile:v baseline -maxrate 600000 -bufsize 600000 -r 25 "http://localhost:3030"
(I haven't removed the audio options although you don't have any audio inputs).