Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
How to mux video and audio without using FFMPEG ?
20 janvier 2019, par Yekta SarıoğluI need to mux video(mp4) and audio(wav) into a single MP4 file on the Android platform. I don't want to use FFMPEG due to its legal issues. I tried to do with MediaMuxer. And I used this solution as an example Muxer Example but I could not succeed and got an error failed to instantiate extractor where you set data source as a string path. I looked up for more answers but wherever I search on the Internet, all I found was FFMPEG based on solutions. I could not find any reliable answers. I hope you guys can help with it. Thanks in advance.
-
How to combine a video and an image using "reverse" vstack ?
20 janvier 2019, par user8272359I have an image and a video (same width). I now want to use ffmpeg to add the image above the video. Google and other SO threads the use of the vstack filter_complex tag, which works great - except that it puts the image under the video.
I've tried putting the image first and then the video, but this doesnt work. I've also tried giving the vstack command reverse inputs, but also didnt work!
The video may also contain audio which I would need to keep.
See code below:
// Works, but puts image below video (instead of above) ffmpeg -i test.mp4 -i text.png -filter_complex vstack result.mp4 // Doesn't work at all ffmpeg -i test.mp4 -i text.png -filter_complex '[1:v][0:v]vstack' result.mp4 // Doesn't work at all ffmpeg -i test.mp4 -i text.png -filter_complex '[1:v][0:v]vstack=inputs=2[v]' -map '[v]' -map 0:a result.mp4
Google / SO did not yield any tips on how to achieve this so far. Do you know a solution?
-
Split videos into five segment using ffmpeg
20 janvier 2019, par RJFFI have 10000 videos and I want to split each video into five segments
I know previously how to segment video using ffmpeg but I do not know how to use it with a large number of videos
the names of videos are: 1.avi, 2.avi, 3.avi, ....... ....., 10000.avi
I want to use for loop with ffmpeg can you please help me?!!!!
-
split the video into five chunks using ffmpeg
20 janvier 2019, par RJFFI want to split videos into five chunks using ffmpeg
the first chunk represents 20% of the whole video
the second chunk represents 40% of the whole video
the third chunk represents 60% of the whole video
the fourth chunk represents 80% of the whole video the fifth chunk represents 100% of the whole videocan you please help me?
-
Ffmpeg does not properly convert videos when run as daemon
20 janvier 2019, par DGoikoI'm using ffmpeg to convert and split videos from a Python process. When I run it from console as a normal user everything works as expected, however, if I run it as a daemon it produces the same amount of files but with silence in almost the whole file.
This is the line I execute from python:
def convert_to_ffmpeg(file, ffmpeg_folder, chunk_length): res = -1 try: file_name = os.path.join(ffmpeg_folder, ntpath.basename(file) + ".flac") res = os.system("ffmpeg -i " + file + " -f segment -segment_time "+str(chunk_length)+" " + file_name + " -y >/dev/null 2>&1") except Exception as e: raise MyException(code=210005, detalails=file, cause=e) if not res == 0: raise MyException(code=210004, detalails=str(res) + " - " + file) return file_name
When I run it from a normal console it works as expected: it splits the video in chunks of "self._chunk_length" seconds.
However, if I run the program using python-daemon with this code:
if daemon_run: pid_file = check_unclean_exit(config['pidfile'], log) context = daemon.DaemonContext( working_directory=approot, umask=0o002, pidfile=pid_file, ) context.signal_map = { signal.SIGTERM: programa_cleanup, signal.SIGHUP: 'terminate', # signal.SIGUSR1: reload_program_config, } with context: convert_to_ffmpeg("/foo/testfile.mkv", "/foo/ffmpeg", 40)
It produces EXACTLY the same chunks, however, most of the content of the chunks is just silence. It splits in the proper point, but doesn't fill the contents of the audio output properly. Of course, no exception is thrown, as ffmpeg always returns 0
I did even install a completly fresh Debian 9 into a virtual machine to discard problems with ffmpeg and my old-good computer's setup.
Of course this is a simplified example. The real thing is a multithread application which watches a directory for files to convert.