Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Issue in converting .mov to .mp4 php
30 novembre 2016, par InventillectI am trying to convert a video with extension .mov to .mp4 format. Following is the command that I try to use
$file_name = "abc.mov"; $mp4_file = "abc.mp4"; $cmd = 'sudo /usr/bin/ffmpeg -i /path_to_file' . $file_name . ' -strict experimental -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -preset slower -crf 18 -vf "scale=trunc(in_w/2)*2:trunc(in_h/2)*2" /destination_path/' . $mp4_file; exec($cmd, $out, $res);
However the desired file( with .mp4 ) is not getting created. When I copy the command and paste it inside terminal, the file with the desired format is getting created. However same is not working with exec command in my php code.
I am not able to figure out the actual cause of issue, since it seems out to be strange. Any help shall be appreciated. Thanks in advance
-
How to stop ffmpeg remotely ?
30 novembre 2016, par AdamI'm running ffmpeg on another machine for screen capture. I'd like to be able to stop it recording remotely. FFMPEG requires that q is pressed to stop encoding as it has to do some finalization to finish the file cleanly. I know I could kill it with kill/killall however this can lead to corrupt videos.
Press [q] to stop encoding
I can't find anything on google specifically for this, but some there is suggestion that echoing into /proc//fd/0 will work.
I've tried this but it does not stop ffmpeg. The q is however shown in the terminal in which ffmpeg is running.
echo -n q > /proc/16837/fd/0
So how can I send a character to another existing process in such a way it is as if it were typed locally? Or is there another way of remotely stopping ffmpeg cleanly.
-
How to set rtsp connection timeout in ffmpeg
30 novembre 2016, par Long BaiI'm using ffmpeg library to write to the rtsp stream. It is working well when the rtsp url is correct. But when this rtsp url is incorrect then it is stuck in avformat_write_header. Is there any solution for this problem? Thanks.
-
How to get Bitrate and FPS statistics with ffplay
30 novembre 2016, par S4M11RI would like to measure statistics (FPS, Bitrate) from a ffplay command instead of ffmpeg. This because recording for many hours takes a lot space on disk.
The way I do it now is that I record a video with ffmpeg for a specific duration and save statistics (-qphist) in a file
Command:
ffmpeg -rtsp_transport tcp -t $duration -i rtsp://$cred/axis-media/media.amp?videocodec=h264 -qphist -vcodec copy -r 60 -y $outputDIR/camRecording_h264.avi &> $logfile &
Instead I would like to play a rtsp video and collect statistics so that video is not saved on disk but still get the same statistics.
Command
ffplay "command" &> file
With ffplay I can get some info with loglevel but nothing about FPS or Bitrate
I checked man ffplay and googled around but could not find anything about this.
Is it even possible to get FPS and Bitrate statistics from ffplay?
Best regards
-
ffmpeg scaling and padding error
30 novembre 2016, par jsurfI am trying to scale a video of any dimension to be 720x720, and then centered on a padded background of 1280x720.
ffmpeg -y -i test.mp4 -vf "scale=-1:720,pad=width=1280:height=720:x=280" -c:a copy processed/test.mp4
This command gives the error: "Warning: data is not aligned! This can lead to a speedloss", although the video does scale and center properly.
The same command without the x coordinate of 280px gets rid of the error, but then the video is not centered properly:
ffmpeg -y -i test.mp4 -vf "scale=-1:720,pad=width=1280:height=720" -c:a copy processed/test.mp4
Is there another way I can center the video and get rid of the error?