Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Is /usr/local/lib searched for shared libraries ?
19 août 2017, par Leo IzenIs
/usr/local/lib
searched for shared libraries ? I have this error:[Leo@chessman ~]$ whereis ffmpeg ffmpeg: /usr/local/bin/ffmpeg [Leo@chessman ~]$ ffmpeg ffmpeg: error while loading shared libraries: libavcore.so.0: cannot open shared object file: No such file or directory [Leo@chessman ~]$ ls /usr/local/lib/libav* /usr/local/lib/libavcodec.a /usr/local/lib/libavfilter.a /usr/local/lib/libavcodec.so /usr/local/lib/libavfilter.so /usr/local/lib/libavcodec.so.52 /usr/local/lib/libavfilter.so.1 /usr/local/lib/libavcodec.so.52.108.0 /usr/local/lib/libavfilter.so.1.74.0 /usr/local/lib/libavcore.a /usr/local/lib/libavformat.a /usr/local/lib/libavcore.so /usr/local/lib/libavformat.so /usr/local/lib/libavcore.so.0 /usr/local/lib/libavformat.so.52 /usr/local/lib/libavcore.so.0.16.1 /usr/local/lib/libavformat.so.52.94.0 /usr/local/lib/libavdevice.a /usr/local/lib/libavutil.a /usr/local/lib/libavdevice.so /usr/local/lib/libavutil.so /usr/local/lib/libavdevice.so.52 /usr/local/lib/libavutil.so.50 /usr/local/lib/libavdevice.so.52.2.3 /usr/local/lib/libavutil.so.50.36.0 [Leo@chessman ~]$
-
Android Merging two or more videos from the List to a single synchronised video
18 août 2017, par Alok Kumar VermaI've an activity which has the certain videos inside my recyclerview. I've one button which takes you to the next activity which has the VideoView. Now the main task is to merge the videos to single synchronous video and that video file will be played in the video View.
The mapping is like -> EditVideoActivity.java (List of Videos in recyclerview) -> Processing the video merging into one -> saving somewhere -> the merged video getting played.
I've researched on several sites about this and came to know that two things are available for this, these are :
1. FFMPEG
2. MP4Parser
Now I've followed some questions on StackOverflow about this :
- FFMPEG Usage getting problem in Orientation : This doesn't serve my motive. As this guy has used some coding.
- Mp4Parser : They have moved their site to Github but I got 504 gateway timeout so no guidance for that.
Developer Android has MediaCodec and I went there it was quiet complex
I'm sending out the data in string format or i must say the video path in array format to other activity and is working fine.
I've done some homework what I did is just in media player I appended the videos. But I have to merge the videos and then it has to be played inside the videoplayer.
1. When the button is clicked it merges the videos and saves it in a storage specified
The same videos is now played in videoplayer
EditVideo.java from where the data is passed from the press of the button
audioButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { //the position of the video videoPosition = selectedVideo; if(videoPosition != null){ Intent intent = new Intent(EditVideoActivity.this, AudioActivity.class); intent.putExtra("videoData",videoPosition); Log.e("VIDEO_SENT_DATA=======", videoPosition); startActivity(intent); }else Toast.makeText(EditVideoActivity.this,"You have not selected any video",Toast.LENGTH_LONG) .show(); } });
from here the data is getting passed, I'm working on how to merge the videos with the press of the above button
And PreviewActivity.java is the page where the videoView is there to be played (the merged files)
I've done this : Appending the videos in onCreate()
//getting the passed value from the previous activity Bundle extras = getIntent().getExtras(); final ArrayList
videoReceived = extras.getStringArrayList("videos"); Log.e("VIDEO_RECEIVED",videoReceived.toString()); mVideoPlayer.setVideoPath(String.valueOf(videoReceived.get(0))); mMediaController = new MediaController(this); mMediaController.setMediaPlayer(mVideoPlayer); mVideoPlayer.setMediaController(mMediaController); mVideoPlayer.setBackgroundColor(Color.TRANSPARENT); mVideoPlayer.requestFocus(); mVideoPlayer.start(); Log.e("VIDEO_SIZE===",String.valueOf(videoReceived.size())); mVideoPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mediaPlayer) { if( currentIndex < videoReceived.size()){ String uri = String.valueOf(videoReceived.get(currentIndex)); mVideoPlayer.setVideoPath(uri); mVideoPlayer.start(); currentIndex++; } } }); -
How can I play an audio file while converting it with ffmpeg in Node.js ?
18 août 2017, par Blake AllenI created a simple video-to-audio converter with ffmpeg for my discord.js bot:
let stream = //an mp4 stream ffmpeg(stream) .toFormat("mp3") .stream(fs.createWriteStream("./audio.mp3")) .on("end", () => { connection.playStream(fs.createReadStream("./audio.mp3")) });
This all works fine, but using .on() to play the file - only after it completely finishes converting - can take a while.
Is there an efficient way to use connection.playStream to play the audio file or stream as the ffmpeg conversion is still happening?
-
Out of memory on ffmpeg when converting to H265
18 août 2017, par LionI've a bunch of video files, mostly H264. To save storage, I wrote a batch script, that converts all of them to H265 using ffmpeg. Problem: Some files cause ffmpeg to use ALL my memory (24 GB). Then it crashes (cause it try to allocate even more RAM), which stops the converting process.
I think that these files are corrupt in some kind. Because with other files, it works well with low memory consumption. Now I want to reject those broken ones, so that unattended converting is possible.
How is it possible to detect such corruption? Can ffmpeg do this, or is a third party tool required?
My ffmpeg call
set crf=20 set codec=265 ffmpeg -hide_banner -i "!fullSourcePath!" -c:v libx%codec% -crf %crf% "%targetPath%\!targetFileName!"
mkvalidator can't help
mkvalidator says that a corrupt file is valid:
mkvalidator.exe "V:\Filme\_LegacyFormat\22 Jump Street.mkv" ........................................................................................................................ WRN0D0: There are 5306 bytes of void data.. mkvalidator 0.5.0: the file appears to be valid file created with libebml v1.3.0 + libmatroska v1.4.1 / mkvmerge v6.9.1 ('Blue Panther') 64bit built on Apr 18 2014 18:23:38
eac3to331 can't help, too
I found the tool eac3to331, which has a
check
flag. But it gave me no errors, although the tested file seems corrupt (cause my PC to crash after several minutes running ffmpeg)eac3to.exe -check "V:\Filme\_LegacyFormat\22 Jump Street.mkv" MKV, 1 video track, 2 audio tracks, 1 subtitle track, 1:51:57, 24p /1.001 1: h264/AVC, English, 1920x808 24p /1.001 (240:101) 2: DTS, German, 5.1 channels, 1509kbps, 48kHz 3: DTS, English, 5.1 channels, 1509kbps, 48kHz 4: Subtitle (SRT), German v01 Extracting video track number 1... a02 Extracting audio track number 2... a03 Extracting audio track number 3... s04 Extracting subtitle track number 4... Video track 1 contains 161039 frames. eac3to processing took 1 minute, 26 seconds. Done.
-
Supervisord twidler add ffmpeg job
18 août 2017, par Bino OetomoI need to add a program to supervisor via supervisor twidler.
parameters (from debug) :
groupname = 'aeroponic' pname = 'bino@garasi01' progcfg = {'stderr_logfile_maxbytes': '1MB', 'stdout_events_enabled': 'false', 'stdout_capture_maxbytes': '1MB', 'stopwaitsecs': '10', 'killasgroup': 'false', 'stderr_logfile': '/home/bino/Documents/ipcam/spv/bino@garasi01.err', 'stdout_logfile_backups': '10', 'stdout_logfile_maxbytes': '1MB', 'stopasgroup': 'false', 'command': 'ffmpeg rtsp://10.100.100.1:2000/stream/q1 -acodec copy -vcodec copy -strict -2 -strftime 1 -use_localtime 1 -g 30 -hls_time 2 -hls_list_size 3250 -hls_segment_filename ./%Y-%m-%d_%H-%M-%S.ts -f hls ./index.m3u8', 'autostart': 'false', 'stderr_logfile_backups': '10', 'stdout_logfile': '/home/bino/Documents/ipcam/spv/bino@garasi01.out'}
twidler function call
proxyobj.twiddler.addProgramToGroup(groupname,pname,progcfg)
but it report error :
> xmlrpclib.Fault:
'/home/bino/Documents/ipcam/spv/ffmpeg > rtsp://10.100.100.1:2000/strem/q1 -acodec copy -vcodec copy -strict -2 > -strftime 1 -use_localtime 1 -g 30 -hls_time 2 -hls_list_size 3250 -hls_segment_filename ./%Y-%m-%d_%H-%M-%S.ts -f hls ./index.m3u8' for 'program:bino@garasi01.command' is badly formatted: unsupported format > character 'Y' (0x59) at index 203 in section 'program:bino@garasi01' > (file: '/etc/supervisor/supervisord.conf')"> I thing the problem is that my ffmpeg command has '%Y-%m-%d_%H-%M-%S' in it's parameter. But thats the requirement so that ffmpeg use timestamp to name streams files
Note : when I replace '%Y-%m-%d_%H-%M-%S' with i.e : 'myfilename' the adding process run well ... but thats not what I want.
Kindly please tell me how to fix this.
sincerely
-bino-