[FFmpeg-user] Converting mp4 to mp3 has the mp3 longer than the mp4
Hello, I was trying to rip the audio from an mp4 file and then cut the mp3 file down, when I noticed something. The source video is 24m 50s in length, but when using "ffmpeg -i video.mp4 audio.mp3", the resulting audio file is 25m 28s in length, confirmed in both metadata and the Groove music player. Any idea what's going on? Thanks, Felix ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to set the color background when i use overlay_qsv
On Thu, 2022-01-27 at 21:08 +0800, zha...@bstar.com.cn wrote: > hello: > I check it to tag 5.0 and the command run correctly, but the cpu is very high. > I am not sure it used the gpu to decoder, scale, overlay and encoder. I don't > know how to make sure it used the gpu. You may run `intel_gpu_top` to check the usage of each engine (Render/3D and Video etc) Thanks Haihao > From: zha...@bstar.com.cn > Date: 2022-01-27 20:24 > To: ffmpeg-user@ffmpeg.org > Subject: Re: [FFmpeg-user] how to set the color background when i use > overlay_qsv > Thanks for your answer. I will try the latest version. My ffmpeg download > from https://github.com/FFmpeg/FFmpeg, and i checkout it to tag n4.4 > ,then i build it on the ubuntu system. > > From: Xiang, Haihao > Date: 2022-01-27 14:40 > To: ffmpeg-user@ffmpeg.org > Subject: Re: [FFmpeg-user] how to set the color background when i use > overlay_qsv > On Thu, 2022-01-27 at 11:04 +0800, zha...@bstar.com.cn wrote: > > hello: > > I want to splice four or more video into one video,i want to set the > > background to a fixed size and the color is black, so i must scale the image > > then overlay. > > > > My environment is ubuntu and I used command is: > > > > ffmpeg -i h1.mp4 -i h2.mp4 -i h3.mp4 -i h4.mp4 -filter_complex > > "color=c=black:s=1920x1080[bg];[0:v]scale=iw/2:-1[img0];[1:v]scale=iw/2:- > > 1[img1];[2:v] scale=iw/2:-1[img2];[3:v]scale=iw/2:- > > 1[img3];[bg][img0]overlay=shortest=1[out0];[out0][img1]overlay=shortest=1:x= > > w[ > > out1];[out1][img2]overlay=shortest=1:y=h[out2];[out2][img3]overlay=shortest= > > 1: > > x=w:y=h" -y out.mp4 > > > > > > -- > > > > -- > > - > > the comman is correct,but when i change it to qsv. It's not working > > correctly: > > > > ./ffmpeg -hwaccel qsv -c:v h264_qsv -i h1.mp4 -hwaccel qsv -c:v h264_qsv > > -i h2.mp4 -hwaccel qsv -c:v h264_qsv -i h3.mp4 -hwaccel qsv -c:v h264_qsv -i > > h4.mp4 -filter_complex "color=black:r=30:size=1920x1080:sar=1/1, > > hwupload=extra_hw_frames=64,format=qsv[bg];[0:v]scale_qsv=iw/2:ih/2[img0];[1 > > :v > > ]scale_qsv=iw/2:ih/2[img1];[2:v] > > scale_qsv=iw/2:ih/2[img2];[3:v]scale_qsv=iw/2:ih/2[img3];[bg][img0]overlay_q > > sv > > =shortest=1[out0];[out0][img1]overlay_qsv=shortest=1:x=w[out1];[out1][img2]o > > ve > > rlay_qsv=shortest=1:y=h[out2];[out2][img3]overlay_qsv=shortest=1:x=w:y=h" -y > > out.mp4 > > > > output: > > [hwupload @ 0x5593003e07c0] A hardware device reference is required to > > upload > > frames to. > > [Parsed_hwupload_1 @ 0x5593003e0680] Query format failed for > > 'Parsed_hwupload_1': Invalid argument > > Error reinitializing filters! > > Failed to inject frame into filter network: Invalid argument > > Error while processing the decoded data for stream #3:0 > > Conversion failed! > > > > -- > > > > -- > > > > ./ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -hwaccel qsv -c:v > > h264_qsv -i h1.mp4 -hwaccel qsv -c:v h264_qsv -i h2.mp4 -hwaccel qsv -c:v > > h264_qsv -i h3.mp4 -hwaccel qsv -c:v h264_qsv -i h4.mp4 -filter_complex > > "color=black:r=30:size=1920x1080:sar=1/1, > > hwupload=extra_hw_frames=64,format=qsv[bg];[0:v]scale_qsv=iw/2:ih/2[img0];[1 > > :v > > ]scale_qsv=iw/2:ih/2[img1];[2:v] > > scale_qsv=iw/2:ih/2[img2];[3:v]scale_qsv=iw/2:ih/2[img3];[bg][img0]overlay_q > > sv > > =shortest=1[out0];[out0][img1]overlay_qsv=shortest=1:x=w[out1];[out1][img2]o > > ve > > rlay_qsv=shortest=1:y=h[out2];[out2][img3]overlay_qsv=shortest=1:x=w:y=h" -y > > out.mp4 > > > > > > output: > > [Parsed_overlay_qsv_7 @ 0x563881a99180] Inputs with different underlying QSV > > devices are forbidden. > > [Parsed_overlay_qsv_7 @ 0x563881a99180] Failed to configure output pad on > > Parsed_overlay_qsv_7 > > Error reinitializing filters! > > Failed to inject frame into filter network: Invalid argument > > Error while processing the decoded data for stream #3:0 > > Conversion failed! > > > > -- > > > > -- > > > > I want to know How can I modify my command to run correctly. Thank you. > > What is the version of your FFmpeg? Your command work for me with the latest > FFmpeg (https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/refs/heads/master). > There is a green line at the bottom of each scaled image with your command, > you > may try vpp_qsv instead of scale_qsv. We will fix the green line issue in > scale_qsv > Thanks > Haihao > ___ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-user > To unsubscribe,
Re: [FFmpeg-user] Error while hardcoding subtitles (Invalid object location)
Yes, even if i remove -s the error persists On Thu, 27 Jan 2022, 20:04 Bo Berglund, wrote: > On Wed, 26 Jan 2022 23:34:26 +0100, Carl Eugen Hoyos > wrote: > > >Does the error disappear if you don't use "-s" if you are using > "filter_complex" > >(as you have to)? > > > >> -f mpegts C:\Users\shuts\Desktop\8.ts > > > >"-f mpegts" looks strange in this command line (but that may only be me). > > Docs: > https://ffmpeg.org/ffmpeg-all.html#toc-mpegts-1 > > > > -- > Bo Berglund > Developer in Sweden > > ___ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". > ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Error while hardcoding subtitles (Invalid object location)
On Wed, 26 Jan 2022 23:34:26 +0100, Carl Eugen Hoyos wrote: >Does the error disappear if you don't use "-s" if you are using >"filter_complex" >(as you have to)? > >> -f mpegts C:\Users\shuts\Desktop\8.ts > >"-f mpegts" looks strange in this command line (but that may only be me). Docs: https://ffmpeg.org/ffmpeg-all.html#toc-mpegts-1 -- Bo Berglund Developer in Sweden ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to set the color background when i use overlay_qsv
hello: I check it to tag 5.0 and the command run correctly, but the cpu is very high. I am not sure it used the gpu to decoder, scale, overlay and encoder. I don't know how to make sure it used the gpu. From: zha...@bstar.com.cn Date: 2022-01-27 20:24 To: ffmpeg-user@ffmpeg.org Subject: Re: [FFmpeg-user] how to set the color background when i use overlay_qsv Thanks for your answer. I will try the latest version. My ffmpeg download from https://github.com/FFmpeg/FFmpeg, and i checkout it to tag n4.4 ,then i build it on the ubuntu system. From: Xiang, Haihao Date: 2022-01-27 14:40 To: ffmpeg-user@ffmpeg.org Subject: Re: [FFmpeg-user] how to set the color background when i use overlay_qsv On Thu, 2022-01-27 at 11:04 +0800, zha...@bstar.com.cn wrote: > hello: > I want to splice four or more video into one video,i want to set the > background to a fixed size and the color is black, so i must scale the image > then overlay. > > My environment is ubuntu and I used command is: > > ffmpeg -i h1.mp4 -i h2.mp4 -i h3.mp4 -i h4.mp4 -filter_complex > "color=c=black:s=1920x1080[bg];[0:v]scale=iw/2:-1[img0];[1:v]scale=iw/2:- > 1[img1];[2:v] scale=iw/2:-1[img2];[3:v]scale=iw/2:- > 1[img3];[bg][img0]overlay=shortest=1[out0];[out0][img1]overlay=shortest=1:x=w[ > out1];[out1][img2]overlay=shortest=1:y=h[out2];[out2][img3]overlay=shortest=1: > x=w:y=h" -y out.mp4 > > -- > -- > - > the comman is correct,but when i change it to qsv. It's not working correctly: > > ./ffmpeg -hwaccel qsv -c:v h264_qsv -i h1.mp4 -hwaccel qsv -c:v h264_qsv > -i h2.mp4 -hwaccel qsv -c:v h264_qsv -i h3.mp4 -hwaccel qsv -c:v h264_qsv -i > h4.mp4 -filter_complex "color=black:r=30:size=1920x1080:sar=1/1, > hwupload=extra_hw_frames=64,format=qsv[bg];[0:v]scale_qsv=iw/2:ih/2[img0];[1:v > ]scale_qsv=iw/2:ih/2[img1];[2:v] > scale_qsv=iw/2:ih/2[img2];[3:v]scale_qsv=iw/2:ih/2[img3];[bg][img0]overlay_qsv > =shortest=1[out0];[out0][img1]overlay_qsv=shortest=1:x=w[out1];[out1][img2]ove > rlay_qsv=shortest=1:y=h[out2];[out2][img3]overlay_qsv=shortest=1:x=w:y=h" -y > out.mp4 > > output: > [hwupload @ 0x5593003e07c0] A hardware device reference is required to upload > frames to. > [Parsed_hwupload_1 @ 0x5593003e0680] Query format failed for > 'Parsed_hwupload_1': Invalid argument > Error reinitializing filters! > Failed to inject frame into filter network: Invalid argument > Error while processing the decoded data for stream #3:0 > Conversion failed! > -- > -- > > ./ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -hwaccel qsv -c:v > h264_qsv -i h1.mp4 -hwaccel qsv -c:v h264_qsv -i h2.mp4 -hwaccel qsv -c:v > h264_qsv -i h3.mp4 -hwaccel qsv -c:v h264_qsv -i h4.mp4 -filter_complex > "color=black:r=30:size=1920x1080:sar=1/1, > hwupload=extra_hw_frames=64,format=qsv[bg];[0:v]scale_qsv=iw/2:ih/2[img0];[1:v > ]scale_qsv=iw/2:ih/2[img1];[2:v] > scale_qsv=iw/2:ih/2[img2];[3:v]scale_qsv=iw/2:ih/2[img3];[bg][img0]overlay_qsv > =shortest=1[out0];[out0][img1]overlay_qsv=shortest=1:x=w[out1];[out1][img2]ove > rlay_qsv=shortest=1:y=h[out2];[out2][img3]overlay_qsv=shortest=1:x=w:y=h" -y > out.mp4 > > > output: > [Parsed_overlay_qsv_7 @ 0x563881a99180] Inputs with different underlying QSV > devices are forbidden. > [Parsed_overlay_qsv_7 @ 0x563881a99180] Failed to configure output pad on > Parsed_overlay_qsv_7 > Error reinitializing filters! > Failed to inject frame into filter network: Invalid argument > Error while processing the decoded data for stream #3:0 > Conversion failed! > -- > -- > > I want to know How can I modify my command to run correctly. Thank you. What is the version of your FFmpeg? Your command work for me with the latest FFmpeg (https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/refs/heads/master). There is a green line at the bottom of each scaled image with your command, you may try vpp_qsv instead of scale_qsv. We will fix the green line issue in scale_qsv Thanks Haihao ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org
Re: [FFmpeg-user] how to set the color background when i use overlay_qsv
Thanks for your answer. I will try the latest version. My ffmpeg download from https://github.com/FFmpeg/FFmpeg, and i checkout it to tag n4.4 ,then i build it on the ubuntu system. From: Xiang, Haihao Date: 2022-01-27 14:40 To: ffmpeg-user@ffmpeg.org Subject: Re: [FFmpeg-user] how to set the color background when i use overlay_qsv On Thu, 2022-01-27 at 11:04 +0800, zha...@bstar.com.cn wrote: > hello: > I want to splice four or more video into one video,i want to set the > background to a fixed size and the color is black, so i must scale the image > then overlay. > > My environment is ubuntu and I used command is: > > ffmpeg -i h1.mp4 -i h2.mp4 -i h3.mp4 -i h4.mp4 -filter_complex > "color=c=black:s=1920x1080[bg];[0:v]scale=iw/2:-1[img0];[1:v]scale=iw/2:- > 1[img1];[2:v] scale=iw/2:-1[img2];[3:v]scale=iw/2:- > 1[img3];[bg][img0]overlay=shortest=1[out0];[out0][img1]overlay=shortest=1:x=w[ > out1];[out1][img2]overlay=shortest=1:y=h[out2];[out2][img3]overlay=shortest=1: > x=w:y=h" -y out.mp4 > > -- > -- > - > the comman is correct,but when i change it to qsv. It's not working correctly: > > ./ffmpeg -hwaccel qsv -c:v h264_qsv -i h1.mp4 -hwaccel qsv -c:v h264_qsv > -i h2.mp4 -hwaccel qsv -c:v h264_qsv -i h3.mp4 -hwaccel qsv -c:v h264_qsv -i > h4.mp4 -filter_complex "color=black:r=30:size=1920x1080:sar=1/1, > hwupload=extra_hw_frames=64,format=qsv[bg];[0:v]scale_qsv=iw/2:ih/2[img0];[1:v > ]scale_qsv=iw/2:ih/2[img1];[2:v] > scale_qsv=iw/2:ih/2[img2];[3:v]scale_qsv=iw/2:ih/2[img3];[bg][img0]overlay_qsv > =shortest=1[out0];[out0][img1]overlay_qsv=shortest=1:x=w[out1];[out1][img2]ove > rlay_qsv=shortest=1:y=h[out2];[out2][img3]overlay_qsv=shortest=1:x=w:y=h" -y > out.mp4 > > output: > [hwupload @ 0x5593003e07c0] A hardware device reference is required to upload > frames to. > [Parsed_hwupload_1 @ 0x5593003e0680] Query format failed for > 'Parsed_hwupload_1': Invalid argument > Error reinitializing filters! > Failed to inject frame into filter network: Invalid argument > Error while processing the decoded data for stream #3:0 > Conversion failed! > -- > -- > > ./ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -hwaccel qsv -c:v > h264_qsv -i h1.mp4 -hwaccel qsv -c:v h264_qsv -i h2.mp4 -hwaccel qsv -c:v > h264_qsv -i h3.mp4 -hwaccel qsv -c:v h264_qsv -i h4.mp4 -filter_complex > "color=black:r=30:size=1920x1080:sar=1/1, > hwupload=extra_hw_frames=64,format=qsv[bg];[0:v]scale_qsv=iw/2:ih/2[img0];[1:v > ]scale_qsv=iw/2:ih/2[img1];[2:v] > scale_qsv=iw/2:ih/2[img2];[3:v]scale_qsv=iw/2:ih/2[img3];[bg][img0]overlay_qsv > =shortest=1[out0];[out0][img1]overlay_qsv=shortest=1:x=w[out1];[out1][img2]ove > rlay_qsv=shortest=1:y=h[out2];[out2][img3]overlay_qsv=shortest=1:x=w:y=h" -y > out.mp4 > > > output: > [Parsed_overlay_qsv_7 @ 0x563881a99180] Inputs with different underlying QSV > devices are forbidden. > [Parsed_overlay_qsv_7 @ 0x563881a99180] Failed to configure output pad on > Parsed_overlay_qsv_7 > Error reinitializing filters! > Failed to inject frame into filter network: Invalid argument > Error while processing the decoded data for stream #3:0 > Conversion failed! > -- > -- > > I want to know How can I modify my command to run correctly. Thank you. What is the version of your FFmpeg? Your command work for me with the latest FFmpeg (https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/refs/heads/master). There is a green line at the bottom of each scaled image with your command, you may try vpp_qsv instead of scale_qsv. We will fix the green line issue in scale_qsv Thanks Haihao ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".