Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Is there a way for ffmpeg to overlay png subtitles ?
19 mai 2019, par ib11I am working on a project to embed 24-bit png subtitles (they have custom letter and line-spacing as well as diffused dropshadow).
I am trying to find a way to overlay them with ffmpeg.
So far the only way I found was creating a DVDSUB file and overlay that, I simply used the following command from my earlier post:
@echo off set srcVidFile1="myvideo.mov" set srcSubFile=mysub.sub set srcIdxFile=mysub.idx set destFile=D:\testsub.mp4 ffmpeg.exe -i %srcVidFile1% -i %srcSubFile% -i %srcIdxFile% -filter_complex "[0:v][1:s]overlay" -c:s dvdsub -c:v libx264 -crf 24 -c:a aac -b:a 160K -ar 48K -strict -2 -y %destFile%
However I did not find yet a way to create a DVDSUB with the 24-bit png files I have.
I also looked at using SSA format as it does have a picture input, but I was not able to overlay the PNGs with ffmpeg. It seems to me that ffmpeg supports only "Dialogue" events in the SSA file, no "Picture" events.
Is there a way to overlay subtitles that are in PNG format?
-
Trancsode and generate waveform data file in ffmpeg with a single command
19 mai 2019, par user1152226I am trying to transcode and generate a waveform data file in the same command. I cannot figure out how to generate 2 output files from a single input. I want an mp4 file, and the waveform data file. The waveform data needs to be generated from the output of the transcoding step (ie, after the stream has already been transcoded)
The following does not work:
ffmpeg -i "https://mp3l.jamendo.com/?trackid=862797&format=mp31" -map 0:a -c:a libfdk_aac out1.mp4 -f data data.txt Output file #1 does not contain any stream
-
How to create m3u8 playlist from mp4 video url ( stored in amazon S3 ) and store the video chunks ( .ts files) and .m3u8 file back to another S3 ?
19 mai 2019, par dexter2019I am building an application where user can upload video and others can watch them later. I am aiming for HLS streaming of the video on the client side, for which the video format should be .m3u8. I am using node fluent-FFmpeg module to do the processing, however, I have a huge doubt, that, how to ensure that all the .ts files (chunks) are also stored back in s3 bucket along with the m3u8 file after ffmpeg processed the mp4 file?
Because the ffmpeg command only takes the location of the m3u8 file? How handle it when I want the input and output location to be S3?
Any help will be greatly appreciated.
I am following the answer from this question Ffmpeg creating m3u8 from mp4, video file size , which is working absolutely fine in my local machine, how to achieve the same for s3?
-
PHP/FFmpeg can not save video
19 mai 2019, par tour travelThe error is:
[Sun May 19 11:41:03.158185 2019] [php7:error] [pid 32405] [client 85.133.232.4:35172] PHP Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutionFailureException: ffmpeg failed to execute command '/usr/bin/ffmpeg' '-y' '-i' 'Sample.mp4' '-async' '1' '-metadata:s:v:0' 'start_time=0' '-f' 'webm' '-vcodec' 'libvpx' '-acodec' 'libvorbis' '-b:v' '1000k' '-refs' '6' '-coder' '1' '-sc_threshold' '40' '-flags' '+loop' '-me_range' '16' '-subq' '7' '-i_qfactor' '0.71' '-qcomp' '0.6' '-qdiff' '4' '-trellis' '1' '-b:a' '128k' '-vf' '[in]scale=320:240 [out]' 'export-webm.webm' in /vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php:100\nStack trace:\n#0 /vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php(72): Alchemy\BinaryDriver\ProcessRunner->doExecutionFailure(''/usr/bin/ffmpe...')\n#1 /vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php(209): Alchemy\BinaryDriver\ProcessRunner->run(Object(Symfony\Component\Process\Process), Object(SplObjectStorage), false)\n#2 /vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php(137): Alchemy\BinaryDr in /vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractVideo.php on line 106a
What I trying to do is, save video:
require '/vendor/autoload.php'; $ffmpeg = FFMpeg\FFMpeg::create(); $ffprobe = FFMpeg\FFProbe::create(); $video = $ffmpeg->open('Sample.mp4'); $video ->filters() ->resize(new FFMpeg\Coordinate\Dimension(320, 240)) ->synchronize(); $video ->save(new FFMpeg\Format\Video\X264('aac'), 'export-x264.mp4')
What I have done:
I searched and similar topics tell me to set permission to my files and folders, I set user and also set 755 to files and folders but still I have this error and no success, any idea?
Errorlog:
Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutionFailureException: ffmpeg failed to execute command '/usr/bin/ffmpeg' '-y' '-i' 'Sample.mp4' '-async' '1' '-metadata:s:v:0' 'start_time=0' '-vcodec' 'libx264' '-acodec' 'aac' '-b:v' '1000k' '-refs' '6' '-coder' '1' '-sc_threshold' '40' '-flags' '+loop' '-me_range' '16' '-subq' '7' '-i_qfactor' '0.71' '-qcomp' '0.6' '-qdiff' '4' '-trellis' '1' '-b:a' '128k' '-vf' '[in]scale=320:240 [out]' '-pass' '1' '-passlogfile' '/tmp/ffmpeg-passes5ce11d01dc0038yfbl/pass-5ce11d01dc0c7' 'export-x264.mp4' in /vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php:100 Stack trace: #0 /vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php(72): Alchemy\BinaryDriver\ProcessRunner->doExecutionFailure(''/usr/bin/ffmpe...')
1 /vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php(209):
Alchemy\BinaryDriver\ProcessRunner->run(Object(Symfony\Component\Process\Process), Object(SplObjectStorage), false) #2 /vendor/alchemy/binary-driver in /vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractVideo.php on line 106
-
ffmpeg how to automatically detect video format
18 mai 2019, par SulliI am trying to download a bunch of videos from youtube:
while read url channel do step=`youtube-dl -f 'bestvideo' -g $url` ffmpeg -i "$step" -ss 00:00:10.00 -t 00:00:01.00 -c copy frames/"$channel".mp4; done < urls.csv
The problem is that the "bestvideo" format is not always the same, it can be mp4, webm, mov, and so I can't harcode the output format in the ffmpeg command.
Can ffmpeg automatically detect the correct format for the output? Or is there a format that is always available for a youtube video?