ffmpeg

Ffmpeg concat demuxer shifts video stream start time

[亡魂溺海] 提交于 2021-02-10 17:53:03
问题 Summary Ffmpeg concat demuxer shifts video stream start time when invoked with -c copy option. Reproduction Given an before.mp4 containing video and audio streams both with start_time=0 and start_pts=0 . Given concat demuxer input file concat.txt with contents: file before.mp4 Run command ffmpeg -f concat -i concat.txt -c copy concat.mp4 Run command ffprobe concat.mp4 -show_streams and observe that video stream start_time and start_pts are now non-zero (in my tests, the magnitude of this

Android FFmpeg Unrecognized option

狂风中的少年 提交于 2021-02-10 16:41:36
问题 I am trying to compresses a video in android using ffmepg. Here is my code: String[] cmd = {"-y -i" ,myVideo.getAbsolutePath().replaceAll(" ", "%20"),"-vf","-s 640x480","-threads 5","-preset ultrafast","-strict -2", (local_paths.getLocal_images() + File.separator + "test.mp4")}; FFmpeg ffmpeg = FFmpeg.getInstance(context); try { //Load the binary ffmpeg.loadBinary(new LoadBinaryResponseHandler() { @Override public void onStart() { } @Override public void onFailure() { } @Override public void

Delete Files in subfolders after encode

时间秒杀一切 提交于 2021-02-10 15:48:25
问题 I want to delete files in my subfolders with a PowerShell script. I already tried using Remove-Item in PowerShell, but failed to set it up correctly... This is the code I use for encoding: Get-ChildItem *.mkv | where BaseName -notlike '*`[HEVC]' | foreach { ffmpeg -i $_ -c:v libx265 -c:a copy -x265-params crf=25 "$($_.BaseName) [HEVC].mkv" -n } I want to either include Remove-Item [source file] in this script to delete the source files by checking the name of the file. How would I do that?

VideoWriter OpenCV - cannot put pipeline to play in function CvVideoWriter_GStreamer::open

馋奶兔 提交于 2021-02-10 15:02:13
问题 Almost exactly the same question : OpenCV error - cannot put pipeline to play in function CvVideoWriter_GStreamer::open Context : I'm trying to create a video and save it in a .avi file with OpenCV 3.3.0 and Python 2.7. Problem : This code : fourcc = cv2.VideoWriter_fourcc(*'XVID') out = cv2.VideoWriter('data/out/output.avi', fourcc, 30, (800, 600)) Raises : (python2.7:12345): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed ** (python2.7:12345):

VideoWriter OpenCV - cannot put pipeline to play in function CvVideoWriter_GStreamer::open

微笑、不失礼 提交于 2021-02-10 15:01:36
问题 Almost exactly the same question : OpenCV error - cannot put pipeline to play in function CvVideoWriter_GStreamer::open Context : I'm trying to create a video and save it in a .avi file with OpenCV 3.3.0 and Python 2.7. Problem : This code : fourcc = cv2.VideoWriter_fourcc(*'XVID') out = cv2.VideoWriter('data/out/output.avi', fourcc, 30, (800, 600)) Raises : (python2.7:12345): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed ** (python2.7:12345):

VideoWriter OpenCV - cannot put pipeline to play in function CvVideoWriter_GStreamer::open

久未见 提交于 2021-02-10 15:01:33
问题 Almost exactly the same question : OpenCV error - cannot put pipeline to play in function CvVideoWriter_GStreamer::open Context : I'm trying to create a video and save it in a .avi file with OpenCV 3.3.0 and Python 2.7. Problem : This code : fourcc = cv2.VideoWriter_fourcc(*'XVID') out = cv2.VideoWriter('data/out/output.avi', fourcc, 30, (800, 600)) Raises : (python2.7:12345): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed ** (python2.7:12345):

Why does avcodec_fill_audio_frame return -22 when only sample count is different?

主宰稳场 提交于 2021-02-10 14:19:44
问题 My problem is very fast to explain: I have to encode audio samples using FFmpeg (raw PCM to G.711 mu-law). This is the guilty part of my code (I put raw parameters in this example to be explicit): AVFrame* frame = av_frame_alloc(); frame->nb_samples = 8000; frame->format = AV_SAMPLE_FMT_S16; frame->channels = 1; frame->channel_layout = AV_CH_LAYOUT_MONO; frame->sample_rate = 8000; frame->quality = 1; int res = avcodec_fill_audio_frame(frame, 1, AV_SAMPLE_FMT_S16, /*my samples data*/, 16000, 0

FFMPEG frame extraction - stuck

懵懂的女人 提交于 2021-02-10 14:18:30
问题 trying to extract specific frames from a video with the following command (with specific names of files removed!: ffmpeg -i video.mp4 -vf "select-gte(n\,6956)" -vframes 10262 folder/frame%d.jpg However, in many cases, this results in the same frame (the first one) extracted repeatedly, rather than a progression of frames extracted. 回答1: The image sequence muxer, by default, is set to assume a constant frame rate output, so it will fill in missing timestamp gaps with duplicates. The select

ffmpeg overlay on multiple outputs

半城伤御伤魂 提交于 2021-02-10 13:26:29
问题 I'm using ffmpeg 3.4.1 to transcode a highres video file into several lower resolutions with a logo in the corner: ffmpeg -i "test.mxf" -i "logo.png" ^ -filter_complex "[0:v][1:v] overlay" ^ -s 640x480 -c:v libx264 -b:v 1000K -c:a aac -b:a 96k "test.640x480K.1000K.logo.mp4" ^ -s 1280x720 -c:v libx264 -b:v 2200K -c:a aac -b:a 192k "test.1280x720K.2200K.logo.mp4" But this way there is only a logo in the first output file. I have tried using map, this gives me logos in both output files but then

ubuntu+ndk编译ffmpeg

a 夏天 提交于 2021-02-10 07:35:18
近来想把ffmpeg移植到android上来用,所以就研究了两天,从网上乱搜一通,网上都说在linux系统下比较好编译通过,所以就听取了意见,装了vmware在里面装了个ubuntu13.04的64位系统,紧接着我就迫不及待的 http://developer.android.com/tools/sdk/ndk/index.html 下载了 android-ndk-r9b-linux-x86_64.tar.bz2在ubuntu系统下配置好了NDK的环境变量,又从ffmpeg官网下载了ffmpeg2.0.1版本的源码,可是按照:http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/ 这个教程搞了一天都没编译通过,老是报一些莫名奇妙的错误: “找不到所在目录和文件 ”。 可能是我那个地方配置的不对吧。要就有那位兄弟用这个教程编译ffmpeg成功生成libffmpeg.so文件的告诉我一声。 这个方法不行那就换个方法喽!看到网上说ffmpeg不同版本编译方式也有所不同,既然这样的话,我就换了一个低版本的ffmpeg0.8.1。下载此版本的链接为:http://www.ffmpeg.org/releases/ffmpeg-0.8.1.tar.gz 同样ndk也换了个低版本的。下载链接为:http://dl.google.com