I'm new to FFMPEG. I'd used:
ffmpeg -re -y -f rawvideo -vcodec rawvideo -s 1920x1080 -pix_fmt bgr24 -i - -an -preset ultrafast -pix_fmt yuv420p -vcodec libx264 -f flv rtmp://rtmp_url/app/instance
this command. I'd got the successful streaming but the frames are distorted and moving upside down.
Below is the link to the snapshot of the frame.
Image of the upside down frame
Please help me out with this one.
Related
In twitter studio to stream they specify
RTMP URL rtmp://va.pscp.tv:80/x
RTMPS URL rtmps://va.pscp.tv:443/x
but when I do
ffmpeg -re -i file.webm -c:v libx264 -preset ultrafast -vf "scale=-2:1080" -g 60 -pix_fmt yuv420p -c:a aac -b:a 128k -ac 2 -r 30 -vb 900k -minrate 900k -maxrate 900k -bufsize 900k -ar 44100 rtmps://va.pscp.tv:443/x/
I get this error
Unable to find a suitable output format for rtmps://va.pscp.tv:443/x/key: Invalid argument
I tried with and without the x but nothing goes, still same error
how to fix this
Turns out it was only missing -f flv
ffmpeg -re -i str_CAM_HGgs_con_XZQOm4Zem0.webm -c:v libx264 -preset ultrafast -vf "scale=-2:1080" -g 60 -pix_fmt yuv420p -c:a aac -b:a 128k -ac 2 -r 30 -vb 900k -minrate 900k -maxrate 900k -bufsize 900k -ar 44100 -f flv rtmps://va.pscp.tv:443/x/{KEY}
How to create an image using images with FFMPEG? Something like below?
-f lavfi -i color=c=white:s=1080x1920 -loop 1 -i 1.png -loop 1 -i 2.png -filter_complex [0:v][1:v]overlay=shortest=1:x=0:y=0[v1];[v1][2:v]overlay=shortest=1:x=10:y=10 -vframes 1 -q:v 5
Found out by myself
-f lavfi -i color=c=white:s=1080x1920 -loop 1 -i 1.png -loop 1 -i 2.png -filter_complex [0:v][1:v]overlay=shortest=1:x=0:y=0[v1];[v1][2:v]overlay=shortest=1:x=10:y=10 -r 1 -vframes 1 -pix_fmt yuv420p -c:v libx264 export.jpg
I downloaded opencv 3.2,and run:
cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=$(python -c "import sys; print(sys.prefix)") -D PYTHON_EXECUTABLE=$(which python)
-D OPENCV_EXTRA_MODULES_PATH=/home/alex/Software/opencv_contrib/modules
-D WITH_OPENGL=ON
-D WITH_JPPEG=ON
-D WITH_PNG=ON
-D WITH_CUDA=ON
-D ENABLE_FAST_MATH=1
-D WITH_CUBLAS=1 ..
under ubuntu 16.04 got:
- Media I/O:
....
-- JPEG: NO
-- WEBP: build (ver 0.3.1)
-- PNG: NO
........
as you can see that both JPEG and PNG give 'NO',and I hava got libjpeg-dev,libgtk2.0-dev and libpng-dev installed.So how to make opencv to support jpeg and png?
I have the following ffmpeg-cli command which does not produce the described effect in documentation. Could this be a bug, or I have something wrong with the command.
ffmpeg \
-y \
-i small.mp4 \
-i monkey/monkey_%04d.png \
-filter_complex "[0:v][1:v]overlay=enable='between(t,1,5)'[out1]" \
-map '[out1]' \
output.mp4
I expect it to overlay the #1 stream on top of #0 between seconds 1 and 5.
You may download the test tarball from this link:
https://drive.google.com/file/d/0BxIQVP1zErDPYXRveG9hN0c0Qjg/view?usp=sharing
It includes assets for the test case.
The build I tried with:
ffmpeg-3.0.2-64bit-static (available online)
FFmpeg is a time-based processor i.e. it aligns packets by timestamps, so you have to align the start of the image sequence to the start of the overlay.
ffmpeg \
-y \
-i small.mp4 \
-i monkey/monkey_%04d.png \
-filter_complex "[1:v]setpts=PTS-STARTPTS+(1/TB)[1v]; \
[0:v][1v]overlay=enable='between(t,1,5)'[out1]" \
-map '[out1]' \
output.mp4
I have this command
ffmpeg -i "D:\Neuer Ordner\Test.mkv" -c copy -ss 00:00:00 -t 00:08:00 -sn "D:\Neuer Ordner\Test1.mkv" -c copy -ss 00:08:00 -t 00:08:00 -sn "D:\Neuer Ordner\Test2.mkv" -c copy -ss 00:16:00 -t 00:08:00 -sn "D:\Neuer Ordner\Test3.mkv" -c copy -ss 00:24:00 -sn "D:\Neuer Ordner\Test4.mkv"
My goal is to upload them to youtube. Yet I need to swap each pair before converting it, so left becomes right and right becomes left.
I found the complex filter and tried
ffmpeg -i "D:\Neuer Ordner\Test.mkv" -filter:v "crop=1280:720:0:0" -i "D:\Neuer Ordner\Test.mkv" -filter:v "crop=1280:720:1280:0" -filter_complex "pad=in_w*2:in_h, overlay=main_w/2:0, scale=in_w/2:in_h, scale=-1:720" -c:a copy "D:\Neuer Ordner\output.mkv"
Which led to
Option filter:v (set stream filtergraph) cannot be applied to input file D:\Neuer Ordner\Test.mkv -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for input file D:\Neuer Ordner\Test.mkv.
Error opening input files: Invalid argument
Which command solves this?
Try this instead:
ffmpeg -i "D:\Neuer Ordner\Test.mkv" \
-c copy -ss 00:00:00 -t 00:08:00
-metadata stereo_mode=right_left -sn "D:\Neuer Ordner\Test1.mkv" \
-c copy -ss 00:08:00 -t 00:08:00 \
-metadata stereo_mode=right_left -sn "D:\Neuer Ordner\Test2.mkv" \
-c copy -ss 00:16:00 -t 00:08:00 \
-metadata stereo_mode=right_left -sn "D:\Neuer Ordner\Test3.mkv" \
-c copy -ss 00:24:00 -metadata stereo_mode=right_left -sn "D:\Neuer Ordner\Test4.mkv"