This next example will do the same thing: $ ffmpeg -i input_0.mp4 -i input_1.mp4 -c copy -map 0:v:0 -map 1:a:0 -shortest out.mp4 To copy the video from input_0.mp4 and audio from input_1.mp4: $ ffmpeg -i input_0.mp4 -i input_1.mp4 -c copy -map 0:0 -map 1:1 -shortest out.mp4 The -map option instructs ffmpeg what streams you want. Also, it is less prone to accidental mapping because 1:1 can refer to any type of stream, while 2:v:3 only refers to the fourth video stream of the third input file. I prefer this method because it's more efficient. For example, you can tell ffmpeg that you want the first video stream from the first input ( 0:v:0), and the first audio stream from the second input ( 1:a:0). This can be enhanced with stream specifiers. Since ffmpeg starts counting from 0, stream 1:1 refers to the audio from input_1.mp4. The format is input_file_id:input_stream_id. Stream #1:1(und): Audio: aac (LC) (mp4a / 0圆134706D), 48000 Hz, stereo, fltp, 55 kb/s (default)įfmpeg refers to input files and streams with index numbers. In ffmpeg the streams look like this: $ ffmpeg -i input_0.mp4 -i input_1.mp4 Input_0.mp4 has the desired video stream and input_1.mp4 has the desired audio stream: It's better on a newer computer, but soft decoder is better.ĭxva2_retrieve_data_call and sws_swale consume lot of time when hwaccel is enabled. Problem solved i didn't check if I got a picture before retreiving it.īut the performance are very poor on my desktop cmputer (intel core i5 650, 4GB RAM, ATI HD5800) it consumes 5% more of CPU, 3 times more RAM, and lot of corrupt frame. I got my picture but with lot of artefact and after few seconds I got a segmentation fault in dxva2_retrieve_data_call(pCodecCtx, pFrame, &gotPic, &packet) I tried to convert it sws_scale(img_convert_affic, pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize) Īnd copy the buffer to a Qimage LastFrame=QImage(w,h,QImage::Format_RGB888) įor(int y=0 ydata+y*pFrameRGB->linesize,w*3) I decode the packet with avcodec_decode_video2(pCodecCtx, pFrame, &gotPic, &packet) Īnd I'm getting my decoded frame with dxva2_retrieve_data_call(pCodecCtx, pFrame, &gotPic, &packet) Hello, I use this post to help me in my HW acceleration with FFMPEGįailed to execute: 0x80070057, when decoding video via ffmpeg with dxva2 I have never use Direct X, do I need Direct X knowledge, or ffmpeg with -enable-dxva2 and -enable-hwaccel=h264_dxva2 care of everything ? I have to build FFMPEG with -enable-dxva2 and -enable-hwaccel=h264_dxva2 ? or Zeranoe build I really want to try hardware acceleration with DXVA2 to see if I can get better performance especially in slowest CPU.īut i really don't know how to proceed. I code under windows with Qt.I need the lowest latency as possible and the best result I can get is done whith :īut with "slow" CPU I have lot of latency if the bitrate is too high or it can't handle 1080p. I've made a player for IP camera (fullHD H264) with FFMPEG
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |