How to stop ffmpeg automatically rotating (Iphone 13) videos - iphone

I have a bunch of videos I want to merge into one video.
Therefore I used this ffmpeg command.
ffmpeg -y -loglevel warning -f concat -safe 0 -i "filelist.txt" -c copy "merged.mov"
When I open merged.mov all my videos are rotated -90 degerees but when I open my videos for example in vlc it has the right rotation.
What am I doing wrong?
I tried already adding the "-noautorotate" option but that does not seem to solve the problem.

Related

Issue regarding Slides not being shown in converted video to mp4 in BigBlueButton

We are using BigBlueButton 2.4 for webinars. When an webinar video is processed by bigbluebutton, the presentation shows the slides that were uploaded in the webiner, but the converted video that we are downloading, does not have those slides shown (Rest of the video is okay).
Does anyone know how to fix this for this particular version?
The code that we are using is mentioned below, if it helps:
#!/bin/sh
# Convert the deskshare and webcam to a combined video stream including logo
cd /var/bigbluebutton/published/presentation/
meetingId=$1
cd $meetingId
# add webcam sound to deskshare
if [ -e deskshare/deskshare.webm ]
then
ffmpeg -nostdin -threads 4 -i video/webcams.webm -i deskshare/deskshare.webm -af afftdn deskshare_with_sound.mp4
else
ffmpeg -nostdin -threads 4 -i video/webcams.webm -af afftdn deskshare_with_sound.mp4
fi
ffmpeg -nostdin -threads 4 -i video/webcams.webm -vf

Laggy video when downloading from m3u8 link with ffmpeg

Im trying to download the video in this m3u8 link https://lbs-usp-hls-vod.cmore.se/vod/1aee4/l4fiymehvxx(13287875_ISMUSP).ism/l4fiymehvxx(13287875_ISMUSP).m3u8, and to do that I run this command:
ffmpeg -i "https://lbs-usp-hls-vod.cmore.se/vod/1aee4/l4fiymehvxx(13287875_ISMUSP).ism/l4fiymehvxx(13287875_ISMUSP).m3u8" -vcodec copy -acodec copy output.mp4
The video downloads fine without any errors, but when I play the video it dosen't look great because it looks like the frame rate is very low, but looking in videoproperties in VLC it says that it is 25 fps which is the same as the original video.
The m3u8 link comes from this website if you need to know that: https://www.tv4play.se/program/taskmaster/13287875
Do someone know what is causing this issue and how to fix it?
Thank you for any advice!
EDIT: I did manage to solve it myself after a lot of research. I just needed to add -fflags +igndts before the -i so the command looked like this
ffmpeg -fflags +igndts -i "https://lbs-usp-hls-vod.cmore.se/vod/1aee4/l4fiymehvxx(13287875_ISMUSP).ism/l4fiymehvxx(13287875_ISMUSP).m3u8" -vcodec copy -acodec copy output.mp4

How do you generate a looping animated gif for Facebook with ffmpeg

When I paste a giphy url (like this one) into a facebook post or comment, the gif plays immediately and loops indefinitely. When I upload ones I make from ffmpeg, neither of those things happen. You have to click a play button to start the animation and then it ends after one time through.
I have a couple of ffmpeg commands I use to create the gifs. They are:
ffmpeg -ss 10 -t 5 -i input.m4v -vf "fps=15,scale=800:-2:flags=lanczos,palettegen" -y palette.png
and
ffmpeg -ss 10.6 -t 5 -i input.m4v -i palette.png -filter_complex "fps=15,scale=800:-1:lanczos[video];[video][1:v]paletteuse" output.gif
The first one generates a custom color pallet that's used by the second one to create a high quality animated gif. I've also tried adding -loop 0 (i.e. ffmpeg -ss 10.6 -t 5 -i input.m4v -i palette.png -filter_complex "fps=15,scale=800:-1:lanczos[video];[video][1:v]paletteuse" -loop 0 output.gif) but that didn't work either.
I also tried uploading the ffmpeg generated images to a personal website and calling them from there but those didn't load at all.
In case it helps, here's a copy of one of the gifs (which autostarts and loops on StackOverflow for me but not on FB)
How does one go about creating a gif that will autostart and loop indefinitely for facebook?
(Note: I've got no problem if I need to do something with a personal website, but I don't want to use Giphly or the other animated gif sites directly if at all possible. Also worth pointing out that I discovered if I download the image from giphly and upload it, it doesn't autostart either. So, this may be something internal to FB, but I'd still like to figure that out.)
The file from Giphy appears to be a WebP, not a GIF:
ffmpeg -i giphy
[…]
Stream #0:0: Video: webp, none, 25 tbr, 25 tbn, 25 tbc
Firefox and mediainfo concur.
So try making a WebP instead:
ffmpeg -ss 10.6 -t 5 -i input.m4v -loop 0 output.webp
Your ffmpeg will have to be compiled with --enable-libwebp.
See ffmpeg -h encoder=libwebp and ffmpeg -h muxer=webp for more options.

FFMPEG Streaming updated image in loop to FB Live Video

I am trying to stream image to fb live video using this command :
ffmpeg -loop 1 -re -i "input.jpg" -pix_fmt yuv420p -profile:v baseline -s 720x480 -bufsize 6000k -vb 400k -maxrate 1500k -deinterlace -t 60 -vcodec libx264 -preset veryfast -g 30 -r 30 -f flv "rtmp_link"
This command works perfectly for one single input file. But the problem is that I want ffmpeg to stream the latest and updated version of "input.jpg" file because my app is updating this "input.jpg" after every 2-3 seconds but the image that is streamed is the older version, not the updated one.
If I try to restart this loop, then streaming stops for approx. 4-5 seconds which is sufficient enough for FB live video to consider that streaming has been stopped and it then ends the live video.
So, is it possible to use the latest available version of input file for streaming in this loop? I don't know much about FFMPEG and I tried to search this issue but all in vain.
I have finally figured out a solution for this. When I was directly overwriting ‘input.jpg’ file using my rails app, this process was taking a few miliseconds but during this time too, ffmpeg was streaming this file which was incomplete for few miliseconds.
So, the solution for this issue is that first write the updated image to a temp file like ‘input.tmp.img’ and then move this file to the original file using script or using terminal like
mv input.tmp.img input.jpg
As moving process hardly takes any time, this solved the problem for me.

Use of FFmpeg in the project

I am taking some screens shot images and want to convert them to videos of some format. Iknw FFmpeg is the solution for this but I am unable to find the code for using it in my project and also am unable to find this library. Please give me a step by step process with details of coding this.
An example to help you get started:
ffmpeg -ab 256k -s 640x480 -f image2 -r .1 -b 180000 -i pics*.jpg -i coolmusic.mp3 final-video.mpg
Read the man page for further details.