[FFmpeg-user] Webcam capture
Hi all. When capturing video from webcam, with: $ ffmpeg -f video4linux2 -s 3200x2400 -i /dev/video0 -vb 20M out.mpg , out.mpg stops, freezes, gets stuck at the beginning for a few seconds. Only at the beginning and only for a few seconds. I thought the problem was related to the cheap low-quality webcam but it completely disappears when I do instead: $ mencoder tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0:forceaudio:alsa:adevice=hw.1,0 -ovc lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o webcam.avi So what could the cause be of the problem with ffmpeg? Thanks for any help. Rodolfo ___ 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] Webcam capture
Paul B Mahol writes: > On 7/20/20, Rodolfo Medina wrote: >> Hi all. >> >> When capturing video from webcam, with: >> >> $ ffmpeg -f video4linux2 -s 3200x2400 -i /dev/video0 -vb 20M out.mpg > > 3200x2400 is very big resolution Same problem also with simply: $ ffmpeg -f alsa -i hw:1,0 -f video4linux2 -i /dev/video0 out.mpg , and audio completely out of sync... Thanks, Rodolfo ___ 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] Webcam capture
Carl Zwanzig writes: > On 7/22/2020 6:22 AM, Rodolfo Medina wrote: >> Same problem also with simply: >> >> $ ffmpeg -f alsa -i hw:1,0 -f video4linux2 -i /dev/video0 out.mpg >> >> , and audio completely out of sync... > > And complete command output is still missing (it's always helpful) > > Since this works-- > mencoder tv:// -tv driver=v4l2:width=640:height=480 [...] > > The computer you're using may not have enough resources to process those large > frames. If the native resolution of the devices is 3200x2400, that's > 23MB/frame, and encoding often needs to keep a few in memory at once. As you > tried in mencover, dial down the capture size in ffmpeg and see if that work. Same problem also with: -s 640x480 $ ffmpeg -f alsa -i hw:1,0 -f video4linux2 -s 640x480 -i /dev/video0 out.mpg > log ffmpeg version 4.1.4-1+b2 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 9 (Debian 9.2.1-1) configuration: --prefix=/usr --extra-version=1+b2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat58. 20.100 / 58. 20.100 libavdevice58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc55. 3.100 / 55. 3.100 Guessed Channel Layout for Input Stream #0.0 : stereo Input #0, alsa, from 'hw:1,0': Duration: N/A, start: 1595439555.172771, bitrate: 1536 kb/s Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s Input #1, video4linux2,v4l2, from '/dev/video0': Duration: N/A, start: 23292.147778, bitrate: 147456 kb/s Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc File 'out.mpg' already exists. Overwrite ? [y/N] y Stream mapping: Stream #1:0 -> #0:0 (rawvideo (native) -> mpeg1video (native)) Stream #0:0 -> #0:1 (pcm_s16le (native) -> mp2 (native)) Press [q] to stop, [?] for help [alsa @ 0x55b787639980] ALSA buffer xrun. [mpeg @ 0x55b787656ec0] VBV buffer size not set, using default size of 230KB If you want the mpeg file to be compliant to some specification Like DVD, VCD or others, make sure you set the correct buffer size Output #0, mpeg, to 'out.mpg': Metadata: encoder : Lavf58.20.100 Stream #0:0: Video: mpeg1video, yuv420p(progressive), 640x480, q=2-31, 200 kb/s, 30 fps, 90k tbn, 30 tbc Metadata: encoder : Lavc58.35.100 mpeg1video Side data: cpb: bitrate max/min/avg: 0/0/20 buffer size: 0 vbv_delay: -1 Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s Metadata: encoder : Lavc58.35.100 mp2 [video4linux2,v4l2 @ 0x55b787653d00] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8) [alsa @ 0x55b787639980] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8) frame= 991 fps= 32 q=7.5 size=2382kB time=00:00:32.96 bitrate= 592.0kbits/s dup=200 drop=0 speed=1.07x thank you.., rodolfo ___ 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] Webcam capture
Leonardo via ffmpeg-user writes: > Hello, > > as an alternative, you can display your webcam at screen with mplayer > > $ mplayer tv:// -tv > driver=v4l2:width=640:height=480:device=/dev/video0:fps=30:outfmt=yuy2 > -noborder -geometry 640x480+0+0 > > and record your screen+audio with ffmpeg (here I'm using pulseaudio because of > the "noise-reduction") > > > $ ffmpeg -thread_queue_size 1024 -f pulse -sample_rate 44100 -i default > -video_size 640x480 -probesize 10M -framerate 30 -thread_queue_size 512 -f > x11grab -i :0.0 -c:a aac -b:a 128k -c:v libx264 -vf "format=yuv420p" -crf 0 > -preset ultrafast output.mp4 > > You can use > > $ uvcdynctrl -f > > to identify which resolution/fps your webcam supports and edit commands above > to your needs. Thank you, Leonardo... but the problem remains: when I watch the resulting video, it freezes for many seconds at start... $ uvcdynctrl -f Listing available frame formats for device video0: Pixel format: YUYV (YUYV 4:2:2; MIME type: video/x-raw-yuv) Frame size: 640x480 Frame rates: 30, 30 Frame size: 320x240 Frame rates: 30 Frame size: 160x120 Frame rates: 30 Frame size: 640x480 Frame rates: 30, 30 $ mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0:fps=30:outfmt=yuy2 -noborder -geometry 640x480+0+0 MPlayer 1.3.0 (Debian), built with gcc-8 (C) 2000-2016 MPlayer Team do_connect: could not connect to socket connect: No such file or directory Failed to open LIRC support. You will not be able to use your remote control. Playing tv://. TV file format detected. Selected driver: v4l2 name: Video 4 Linux 2 input author: Martin Olschewski comment: first try, more to come ;-) v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead. Selected device: BZ IR: BZ IR Capabilities: video capture streaming supported norms: inputs: 0 = Camera 1; Current input: 0 Current format: YUYV tv.c: norm_from_string(pal): Bogus norm parameter, setting default. v4l2: ioctl enum norm failed: Inappropriate ioctl for device Error: Cannot set norm! Selected input hasn't got a tuner! v4l2: ioctl set mute failed: Invalid argument == Opening video decoder: [raw] RAW Uncompressed Video Movie-Aspect is undefined - no prescaling applied. VO: [vdpau] 640x480 => 640x480 Packed YUY2 Selected video codec: [rawyuy2] vfm: raw (RAW YUY2) == Audio: no sound Starting playback... V: 0.0 154/154 ??% ??% ??,?% 0 0 $ ffmpeg -thread_queue_size 1024 -f pulse -sample_rate 44100 -i default -video_size 640x480 -probesize 10M -framerate 30 -thread_queue_size 512 -f x11grab -i :0.0 -c:a aac -b:a 128k -c:v libx264 -vf "format=yuv420p" -crf 0 -preset ultrafast output.mp4 ffmpeg version 4.1.4-1+b2 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 9 (Debian 9.2.1-1) configuration: --prefix=/usr --extra-version=1+b2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat58. 20.100 / 58. 20.100 libavdevice58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc55. 3.100 / 55. 3.100 Guessed Channel Layout for Input Stream #0.0 : stereo Input #0, pulse, from 'default': Duration: N/A, start: 1595442907.483712, bitrate: 1411 kb/s Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s Input #1, x11grab, from ':0.0': Duration: N/A, start: 1595442908.796004, bitrate: N/A Stream #1:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 640x480, 30 fps, 30 tbr, 1000k tbn, 1000k tbc File 'output.mp4' already exists. Overwrite
Re: [FFmpeg-user] Webcam capture
Leonardo via ffmpeg-user writes: > What is the output of > > $ cat /proc/cpuinfo > > ? Here it is: processor : 0 vendor_id : AuthenticAMD cpu family : 22 model : 48 model name : AMD A6-7310 APU with AMD Radeon R4 Graphics stepping: 1 microcode : 0x7030105 cpu MHz : 998.353 cache size : 2048 KB physical id : 0 siblings: 4 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt topoext perfctr_nb bpext ptsc perfctr_llc cpb hw_pstate ssbd vmmcall bmi1 xsaveopt arat npt lbrv svm_lock nrip_save tsc_scale flushbyasid decodeassists pausefilter pfthreshold overflow_recov bugs: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass bogomips: 3992.78 TLB size: 1024 4K pages clflush size: 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts ttp tm 100mhzsteps hwpstate cpb acc_power [13] processor : 1 vendor_id : AuthenticAMD cpu family : 22 model : 48 model name : AMD A6-7310 APU with AMD Radeon R4 Graphics stepping: 1 microcode : 0x7030105 cpu MHz : 1003.070 cache size : 2048 KB physical id : 0 siblings: 4 core id : 1 cpu cores : 4 apicid : 1 initial apicid : 1 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt topoext perfctr_nb bpext ptsc perfctr_llc cpb hw_pstate ssbd vmmcall bmi1 xsaveopt arat npt lbrv svm_lock nrip_save tsc_scale flushbyasid decodeassists pausefilter pfthreshold overflow_recov bugs: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass bogomips: 3992.78 TLB size: 1024 4K pages clflush size: 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts ttp tm 100mhzsteps hwpstate cpb acc_power [13] processor : 2 vendor_id : AuthenticAMD cpu family : 22 model : 48 model name : AMD A6-7310 APU with AMD Radeon R4 Graphics stepping: 1 microcode : 0x7030105 cpu MHz : 998.310 cache size : 2048 KB physical id : 0 siblings: 4 core id : 2 cpu cores : 4 apicid : 2 initial apicid : 2 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt topoext perfctr_nb bpext ptsc perfctr_llc cpb hw_pstate ssbd vmmcall bmi1 xsaveopt arat npt lbrv svm_lock nrip_save tsc_scale flushbyasid decodeassists pausefilter pfthreshold overflow_recov bugs: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass bogomips: 3992.78 TLB size: 1024 4K pages clflush size: 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts ttp tm 100mhzsteps hwpstate cpb acc_power [13] processor : 3 vendor_id : AuthenticAMD cpu family : 22 model : 48 model name : AMD A6-7310 APU with AMD Radeon R4 Graphics stepping: 1 microcode : 0x7030105 cpu MHz : 998.258 cache size : 2048 KB physical id : 0 siblings: 4 core id : 3 cpu cores : 4 apicid : 3 initial apicid : 3 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc cpuid
Re: [FFmpeg-user] Webcam capture
Leonardo via ffmpeg-user writes: > Since you have an AMD cpu/apu, one last resort that I can think of is to > capture webcam with hardware acceleration. > > > Extracted from https://trac.ffmpeg.org/wiki/Hardware/VAAPI > > Also, you need to verify what "-vaapi_device" is the correct one for your > machine. > The wiki has much more information. > > > "Camera Capture > > > Capture a raw stream from a V4L2 camera device and encode it as H.264: > > > $ ffmpeg -vaapi_device /dev/dri/renderD128 -f v4l2 -video_size 1920x1080 -i > /dev/video0 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4 > > > ... " Nothing, the problem remains... it gets stuck for some seconds... rodolfo ___ 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] Webcam capture
Rodolfo Medina writes: > Leonardo via ffmpeg-user writes: > >> Since you have an AMD cpu/apu, one last resort that I can think of is to >> capture webcam with hardware acceleration. >> >> > > > Nothing, the problem remains... it gets stuck for some seconds... The problem also occurs with another computer of mine, Intel, old: $ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N270 @ 1.60GHz stepping: 2 microcode : 0x212 cpu MHz : 1210.046 cache size : 512 KB physical id : 0 siblings: 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug: no f00f_bug: no coma_bug: no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts cpuid aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm movbe lahf_lm dtherm bugs: bogomips: 3192.03 clflush size: 64 cache_alignment : 64 address sizes : 32 bits physical, 32 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N270 @ 1.60GHz stepping: 2 microcode : 0x212 cpu MHz : 1159.421 cache size : 512 KB physical id : 0 siblings: 2 core id : 0 cpu cores : 1 apicid : 1 initial apicid : 1 fdiv_bug: no f00f_bug: no coma_bug: no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts cpuid aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm movbe lahf_lm dtherm bugs: bogomips: 3192.03 clflush size: 64 cache_alignment : 64 address sizes : 32 bits physical, 32 bits virtual power management: $ ffmpeg -f alsa -i hw:0,0 -f video4linux2 -s 640x480 -i /dev/video0 out.mpg ffmpeg version 4.1.4-1~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 8 (Debian 8.3.0-6) configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/i386-linux-gnu --incdir=/usr/include/i386-linux-gnu --arch=i386 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --ignore-tests='hapenc-hap-none,hapenc-hapa-none,hapenc-hapq-none' --enable-shared libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat58. 20.100 / 58. 20.100 libavdevice58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc55. 3.100 / 55. 3.100 Guessed Channel Layout for Input Stream #0.0 : stereo Input #0, alsa, from 'hw:0,0': Duration: N/A, start: 1595450904.939058, bitrate: 1536 kb/s Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s Input #1, video4linux2,v4l2, from '/dev/video0': Duration: N/A, start: 556.262393, bitrate: 147456 kb/s Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc File 'out.mpg' already exists. Overwrite ? [y/N] y Stream mapping: Stream #1:0 -> #0:0 (rawvideo (native) -> mpeg1video (native)) Stream #0:0 -> #0:1 (pcm_s16le (native) -> mp2 (native)) Press [q] to stop, [?] for help [alsa @ 0x1464ac0] ALSA buffer xrun. [mpeg @ 0x147a040] VBV buffer size not set, using default size of 230KB If you want the mpeg file to be compliant to some
[FFmpeg-user] Output file size
Hi all. I'm adding id3 tags to a 208M mp3 file, with: $ ffmpeg -i input.mp3 -metadata artist="Caterina Pontrandolfo Quartett" -metadata album="concerto di Fonte Avellana" -metadata genre="popular" -metadata composer="tradizione lucana" output.mp3 . Now, the output.mp3 is only 83M. Why this? Does it mean a quality loss? How can I avoid it? How can I have output.mp3 the same size as input.mp3? Adding `-qscale 0' does not help. Thanks for any help, Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Output file size
Gyan writes: > On Mon, May 29, 2017 at 9:29 PM, Rodolfo Medina > wrote: > >> I'm adding id3 tags to a 208M mp3 file, with: >> >> $ ffmpeg -i input.mp3 -metadata artist="Caterina Pontrandolfo Quartett" >> -metadata album="concerto di Fonte Avellana" -metadata genre="popular" >> -metadata composer="tradizione lucana" output.mp3 >> >> . Now, the output.mp3 is only 83M. Why this? Does it mean a quality >> loss? >> How can I avoid it? How can I have output.mp3 the same size as input.mp3? >> > > Unless specified otherwise, ffmpeg will transcode streams. You have to add > > -c copy > > to force stream copy (if the output format supports it). So, > > $ ffmpeg -i input.mp3 -c copy -metadata artist="Caterina Pontrandolfo > Quartett" -metadata album="concerto di Fonte Avellana" -metadata > genre="popular" -metadata composer="tradizione lucana" output.mp3 Great. Many thanks. Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] id3 tags not really removed? (was: Output file size)
Rodolfo Medina writes: > Gyan writes: > >> Unless specified otherwise, ffmpeg will transcode streams. You have to add >> >> -c copy >> >> to force stream copy (if the output format supports it). So, >> >> $ ffmpeg -i input.mp3 -c copy -metadata artist="Caterina Pontrandolfo >> Quartett" -metadata album="concerto di Fonte Avellana" -metadata >> genre="popular" -metadata composer="tradizione lucana" output.mp3 > > > Great. Many thanks. It works fine... But now I want to modify, to change some of those id3 tags. Apparently, it is done with simply giving the above command once again, with values changed at my pleasure: when afterwards I run `ffmpeg -i' on the file, everything is fine and the values have changed as desired. But when I read the file using the mp3 reader which is in my car, the old tags are still there...! They have not changed at all! How comes, and how to solve it? Thanks for any help, Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] id3 tags not really removed?
Rodolfo Medina writes: > Rodolfo Medina writes: > >> Gyan writes: >> >>> Unless specified otherwise, ffmpeg will transcode streams. You have to add >>> >>> -c copy >>> >>> to force stream copy (if the output format supports it). So, >>> >>> $ ffmpeg -i input.mp3 -c copy -metadata artist="Caterina Pontrandolfo >>> Quartett" -metadata album="concerto di Fonte Avellana" -metadata >>> genre="popular" -metadata composer="tradizione lucana" output.mp3 >> >> >> Great. Many thanks. > > It works fine... But now I want to modify, to change some of those id3 tags. > Apparently, it is done with simply giving the above command once again, with > values changed at my pleasure: when afterwards I run `ffmpeg -i' on the file, > everything is fine and the values have changed as desired. But when I read > the file using the mp3 reader which is in my car, the old tags are still > there...! They have not changed at all! How comes, and how to solve it? > > Thanks for any help, > > Rodolfo ... I also tried to remove all the tags with: $ ffmpeg -i input.mp3 -map 0:a -map_metadata -1 -c copy out.mp3 and then put them again, but the problem remains... Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] id3 tags not really removed?
Ron Sparks writes: > On 05/29/2017 06:03 PM, Rodolfo Medina wrote: >> Rodolfo Medina writes: >> >>> Rodolfo Medina writes: >>> >>>> Gyan writes: >>>> >>>>> Unless specified otherwise, ffmpeg will transcode streams. You have to >>>>> add >>>>> >>>>> -c copy >>>>> >>>>> to force stream copy (if the output format supports it). So, >>>>> >>>>> $ ffmpeg -i input.mp3 -c copy -metadata artist="Caterina Pontrandolfo >>>>> Quartett" -metadata album="concerto di Fonte Avellana" -metadata >>>>> genre="popular" -metadata composer="tradizione lucana" output.mp3 >>>> >>>> >>>> Great. Many thanks. >>> >>> It works fine... But now I want to modify, to change some of those id3 >>> tags. Apparently, it is done with simply giving the above command once >>> again, with values changed at my pleasure: when afterwards I run `ffmpeg >>> -i' on the file, everything is fine and the values have changed as desired. >>> But when I read the file using the mp3 reader which is in my car, the old >>> tags are still there...! They have not changed at all! How comes, and how >>> to solve it? >>> >>> Thanks for any help, >>> >>> Rodolfo >> >> >> ... I also tried to remove all the tags with: >> >> $ ffmpeg -i input.mp3 -map 0:a -map_metadata -1 -c copy out.mp3 >> >> and then put them again, but the problem remains... >> >> Rodolfo > > I suspect the problem might be that ffmpeg works with the id3v2 tags, while > your mp3 reader works with the id3v1 tags. > Ron Sparks Thanks... My reader reads fine the tags created by ffmpeg... But when they are changed by ffmpeg itself, my reader still sees the old ones... Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] id3 tags not really removed?
Moritz Barsnick writes: > On Mon, May 29, 2017 at 18:37:31 -0400, Ron Sparks wrote: >> > ... I also tried to remove all the tags with: >> > $ ffmpeg -i input.mp3 -map 0:a -map_metadata -1 -c copy out.mp3 >> > and then put them again, but the problem remains... >> >> I suspect the problem might be that ffmpeg works with the id3v2 tags, >> while your mp3 reader works with the id3v1 tags. > > I had the same thought, but why would ffmpeg, when remuxing, re-insert > the original id3v1 tags? Perhaps they're considered part of the stream, > *then* they would survive "-c:a copy". > > You may want to try adding "-write_id3v1 1", as hinted in the docs: > https://www.ffmpeg.org/ffmpeg-formats.html#mp3 > > In both cases, that should either drop the metadata or insert both > versions. (I didn't manage to test, because I don't have any tools at > hand which expose both/all types of tags in MP3 files. exiftool should > manage.) > > Other suggestion (never confirmed): > https://lists.ffmpeg.org/pipermail/ffmpeg-user/2011-June/001365.html > > Actually, there are so many forms of tags (incl. EXIF), metadata, and > so on, that other tools may be much more suitable for such operations. > > Cheers, > Moritz > > P.S.: I found "-map_metadata -1" on lists and superuser.com, but > neither in the docs nor the wiki. Hmmm. Unfortunately "-write_id3v1 1" seems to have no effect. I wish I could understand what the problem is. Let input.mp3 be our file. I do: $ ffmpeg -i input.mp3 - c copy -metadata composer="Bach" output.mp3 $ mv -vi output.mp3 input.mp3 , then get on my car and the reader reads fine the `composer' tag as `Bach'. Then I remember that J. S. Bach had children who were composers as well, get off the car, go to the PC and do: $ ffmpeg -i input.mp3 - c copy -metadata composer="Bach J. S." output.mp3 $ mv -vi output.mp3 input.mp3 . Then I get back to the car and the reader keeps on reading simply `Bach' instead of `Bach J. S.' I.e., it does not see the change occurred. Now, you listers say that the problem is in that ffmpeg works with id3v2 tags whereas my car's mp3 reader does it with id3v1. But, if so, why does it read them correctly the first time they are created and not the second time, when they have been changed? Besides, it seems that sometimes, when the above ffmpeg command is repeated many times, at least the change is somewhat by my reader finally seen: but only after repeating it at least twice. Thanks, Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] id3 tags not really removed?
Rodolfo Medina writes: > Moritz Barsnick writes: > >> On Mon, May 29, 2017 at 18:37:31 -0400, Ron Sparks wrote: >>> > ... I also tried to remove all the tags with: >>> > $ ffmpeg -i input.mp3 -map 0:a -map_metadata -1 -c copy out.mp3 >>> > and then put them again, but the problem remains... >>> >>> I suspect the problem might be that ffmpeg works with the id3v2 tags, >>> while your mp3 reader works with the id3v1 tags. >> >> I had the same thought, but why would ffmpeg, when remuxing, re-insert >> the original id3v1 tags? Perhaps they're considered part of the stream, >> *then* they would survive "-c:a copy". >> >> You may want to try adding "-write_id3v1 1", as hinted in the docs: >> https://www.ffmpeg.org/ffmpeg-formats.html#mp3 >> >> In both cases, that should either drop the metadata or insert both >> versions. (I didn't manage to test, because I don't have any tools at >> hand which expose both/all types of tags in MP3 files. exiftool should >> manage.) >> >> Other suggestion (never confirmed): >> https://lists.ffmpeg.org/pipermail/ffmpeg-user/2011-June/001365.html >> >> Actually, there are so many forms of tags (incl. EXIF), metadata, and >> so on, that other tools may be much more suitable for such operations. >> >> Cheers, >> Moritz >> >> P.S.: I found "-map_metadata -1" on lists and superuser.com, but >> neither in the docs nor the wiki. Hmmm. > > > Unfortunately "-write_id3v1 1" seems to have no effect. I wish I could > understand what the problem is. Let input.mp3 be our file. I do: > > $ ffmpeg -i input.mp3 - c copy -metadata composer="Bach" output.mp3 > $ mv -vi output.mp3 input.mp3 > > , then get on my car and the reader reads fine the `composer' tag as `Bach'. > Then I remember that J. S. Bach had children who were composers as well, get > off the car, go to the PC and do: > > $ ffmpeg -i input.mp3 - c copy -metadata composer="Bach J. S." output.mp3 > $ mv -vi output.mp3 input.mp3 > > . Then I get back to the car and the reader keeps on reading simply `Bach' > instead of `Bach J. S.' I.e., it does not see the change occurred. Now, you > listers say that the problem is in that ffmpeg works with id3v2 tags whereas > my car's mp3 reader does it with id3v1. But, if so, why does it read them > correctly the first time they are created and not the second time, when they > have been changed? Besides, it seems that sometimes, when the above ffmpeg > command is repeated many times, at least the change is somewhat by my reader > finally seen: but only after repeating it at least twice. Further tests show that changes in tags are actually detected by the reader but with a delay: in a first moment they are not, then I `play' again with tags using ffmpeg and then the reader finally reads them... Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] id3 tags not really removed?
Moritz Barsnick writes: > On Wed, May 31, 2017 at 13:10:18 +0200, Cley Faye wrote: >> A shot in the dark here since I didn't have the patience to look at how >> -write_id3v1 work; but if I remember correctly, id3v1 tags are actually >> appended at the end of the mp3 stream in such a way that some older player >> would even play them, causing a small burst of audio at the end of such >> file. >> >> If ffmpeg really doesn't handle them when reading the stream, it would >> explain why 1- they get copied during stream copy, 2- why older tag would >> still show up first, and maybe also 3- why the new tag would show up after >> initial playing of the file, if the reader actually move from the end of >> the file to detect them after reading. > > That was my assumption, and why I suggested using the additional > option. But I have had enough of shooting in the dark. I created a file > with both v1 and v2 ID3 tags: > $ ffmpeg -f lavfi -i anoisesrc -c:a libmp3lame -metadata title='Where is this > found?' -write_id3v1 1 -t 1 -ac:a 1 -b:a 24k tmp/id3tagtest.mp3 > > and converted it in three different ways: $ ffmpeg -i tmp/id3tagtest.mp3 > -metadata title='This is the new tag!' -c copy > tmp/id3tagtest_copied_and_new_matadate_no_explicit_id3v1.mp3 $ ffmpeg -i > tmp/id3tagtest.mp3 -write_id3v1 1 -metadata title='This is the new tag!' -c > copy tmp/id3tagtest_copied_and_new_matadate_explicit_id3v1.mp3 $ ffmpeg -i > tmp/id3tagtest.mp3 -map_metadata -1 -c copy > tmp/id3tagtest_copied_and_map_metadata_minus_1.mp3 > > and apparently ffmpeg *always* overwrites or at least deletes the old > ID3v1 tag. None of the three resulting files contained a leak of the > old tag. (Inspected with "strings".) Period, 'nuff said. > > So, unless I missed something, it's the player's fault. It seems so. Sorry for having engaged people in a problem that does not concern ffmpeg. Now I changed not only tags, but also file names and the player still sees old file names. When I click over them to listen to them, another song is played in place of them. It's sort of been crazy (after having driven *me* crazy! ;-) ). I know I shouldn't ask, but... Do you know how this is possibile and... well, how could I work it out...? Thanks, cheers Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] id3 tags not really removed?
Rodolfo Medina writes: > Moritz Barsnick writes: > >> On Wed, May 31, 2017 at 13:10:18 +0200, Cley Faye wrote: >>> A shot in the dark here since I didn't have the patience to look at how >>> -write_id3v1 work; but if I remember correctly, id3v1 tags are actually >>> appended at the end of the mp3 stream in such a way that some older player >>> would even play them, causing a small burst of audio at the end of such >>> file. >>> >>> If ffmpeg really doesn't handle them when reading the stream, it would >>> explain why 1- they get copied during stream copy, 2- why older tag would >>> still show up first, and maybe also 3- why the new tag would show up after >>> initial playing of the file, if the reader actually move from the end of >>> the file to detect them after reading. >> >> That was my assumption, and why I suggested using the additional option. But >>I have had enough of shooting in the dark. I created a file with both v1 and >>v2 ID3 tags: $ ffmpeg -f lavfi -i anoisesrc -c:a libmp3lame -metadata >>title='Where is this found?' -write_id3v1 1 -t 1 -ac:a 1 -b:a 24k >>tmp/id3tagtest.mp3 >> >> and converted it in three different ways: $ ffmpeg -i tmp/id3tagtest.mp3 >> -metadata title='This is the new tag!' -c copy >> tmp/id3tagtest_copied_and_new_matadate_no_explicit_id3v1.mp3 $ ffmpeg -i >> tmp/id3tagtest.mp3 -write_id3v1 1 -metadata title='This is the new tag!' -c >> copy tmp/id3tagtest_copied_and_new_matadate_explicit_id3v1.mp3 $ ffmpeg -i >> tmp/id3tagtest.mp3 -map_metadata -1 -c copy >> tmp/id3tagtest_copied_and_map_metadata_minus_1.mp3 >> >> and apparently ffmpeg *always* overwrites or at least deletes the old >> ID3v1 tag. None of the three resulting files contained a leak of the >> old tag. (Inspected with "strings".) Period, 'nuff said. >> >> So, unless I missed something, it's the player's fault. > > > It seems so. Sorry for having engaged people in a problem that does not > concern ffmpeg. Now I changed not only tags, but also file names and the > player still sees old file names. When I click over them to listen to them, > another song is played in place of them. It's sort of been crazy (after > having driven *me* crazy! ;-) ). ...then, after a while, say some hours, it suddenly detects the changes and shows the right new file names and tags. So it seems that Moritz was right when speaking of some sort of `cache' my mplayer is doing... Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] id3 tags not really removed?
Moritz Barsnick writes: > On Wed, May 31, 2017 at 13:56:40 +0100, Rodolfo Medina wrote: >> well, how could I work it out...? > [...] >> ...then, after a while, say some hours, it suddenly detects the changes and >> shows the right new file names and tags. So it seems that Moritz was right >> when speaking of some sort of `cache' my mplayer is doing... > > https://youtu.be/nn2FB1P_Mn8 > > Sorry, I truly couldn't resist. Yes, I did try turning it off and then on again... :-) > Honestly: no clue. What sort of player > do you have? (This isn't the place to discuss this though. ;-)) I don't know, it came with the car, as part of it... It sounds perfectly... ;-) Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] id3 tags not really removed?
Rodolfo Medina writes: > Rodolfo Medina writes: > >> Moritz Barsnick writes: >> >>> On Wed, May 31, 2017 at 13:10:18 +0200, Cley Faye wrote: >>>> A shot in the dark here since I didn't have the patience to look at how >>>> -write_id3v1 work; but if I remember correctly, id3v1 tags are actually >>>> appended at the end of the mp3 stream in such a way that some older player >>>> would even play them, causing a small burst of audio at the end of such >>>> file. >>>> >>>> If ffmpeg really doesn't handle them when reading the stream, it would >>>> explain why 1- they get copied during stream copy, 2- why older tag would >>>> still show up first, and maybe also 3- why the new tag would show up after >>>> initial playing of the file, if the reader actually move from the end of >>>> the file to detect them after reading. >>> >>> That was my assumption, and why I suggested using the additional >>>option. But I have had enough of shooting in the dark. I created a file with >>>both v1 and v2 ID3 tags: $ ffmpeg -f lavfi -i anoisesrc -c:a libmp3lame >>>-metadata title='Where is this found?' -write_id3v1 1 -t 1 -ac:a 1 -b:a 24k >>>tmp/id3tagtest.mp3 >>> >>> and converted it in three different ways: $ ffmpeg -i tmp/id3tagtest.mp3 >>> -metadata title='This is the new tag!' -c copy >>> tmp/id3tagtest_copied_and_new_matadate_no_explicit_id3v1.mp3 $ ffmpeg -i >>> tmp/id3tagtest.mp3 -write_id3v1 1 -metadata title='This is the new tag!' -c >>> copy tmp/id3tagtest_copied_and_new_matadate_explicit_id3v1.mp3 $ ffmpeg -i >>> tmp/id3tagtest.mp3 -map_metadata -1 -c copy >>> tmp/id3tagtest_copied_and_map_metadata_minus_1.mp3 >>> >>> and apparently ffmpeg *always* overwrites or at least deletes the old >>> ID3v1 tag. None of the three resulting files contained a leak of the >>> old tag. (Inspected with "strings".) Period, 'nuff said. >>> >>> So, unless I missed something, it's the player's fault. >> >> >> It seems so. Sorry for having engaged people in a problem that does not >> concern ffmpeg. Now I changed not only tags, but also file names and the >> player still sees old file names. When I click over them to listen to them, >> another song is played in place of them. It's sort of been crazy (after >> having driven *me* crazy! ;-) ). > > > ...then, after a while, say some hours, it suddenly detects the changes and > shows the right new file names and tags. So it seems that Moritz was right > when speaking of some sort of `cache' my mplayer is doing... ...Unless this caching problem is not concerning the USB stick memory though... Possibile? Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Adding metadata tags to wav files
Hi. I successfully add metadata tags (album, artist, title, genre...) to mp3 files using ffmpeg: $ ffmpeg -i input.mp3 -c copy -metadata title="Yesterday" output.mp3 . When I try to do the same with wav format, the tags are then properly shown by ffmpeg itself, but they aren't by common media players. Has anyone ever experimented that? Thanks, Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Adding metadata tags to wav files
Paul B Mahol writes: > On 6/11/17, Rodolfo Medina wrote: >> I successfully add metadata tags (album, artist, title, genre...) to mp3 >> files >> using ffmpeg: >> >> $ ffmpeg -i input.mp3 -c copy -metadata title="Yesterday" output.mp3 >> >> . When I try to do the same with wav format, the tags are then properly >> shown >> by ffmpeg itself, but they aren't by common media players. Has anyone ever >> experimented that? > > Common media players do not support riff metadata. So what are they supported by? Thanks, Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Conversion wav -> mp3 -> wav
Hi all. As an experiment, I converted a .wav file to mp3 format and then back into wav again, just to see what happens: $ ffmpeg -i file1.wav file1.mp3 $ ffmpeg -i file1.mp3 file2.wav I've always heard and read that the first step produces a loss in quality. So I would expect that to be seen in a reduction of size. Instead, I was suprised to see that file1.wav and file2.wav are both 154M large. Also the output of `ffmpeg -i' is almost the same for the two: in both cases, there is: Duration: 00:15:10.84, bitrate: 1411 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s So I wonder, and am asking to you listers, in where that quality loss is shown and how it can be detected. Or maybe should we think and conclude that the original quality is restored with the second step...? Thanks for any help, Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Conversion wav -> mp3 -> wav
Kieran O Leary writes: >> As an experiment, I converted a .wav file to mp3 format and then back into >> wav >> again, just to see what happens: >> >> $ ffmpeg -i file1.wav file1.mp3 >> $ ffmpeg -i file1.mp3 file2.wav >> >> I've always heard and read that the first step produces a loss in quality. > > > Yes, it is lossy compression. > > >> So >> I would expect that to be seen in a reduction of size. > > > Yes, your mp3 is much much smaller than the WAV. > > >> Instead, I was suprised >> to see that file1.wav and file2.wav are both 154M large. > > > Your WAV files contain 16-bit, 44khz stereo streams at 1411 kb/second. They > will always be the same file size, regardless of what values the samples > hold. > > >> Also the output of >> `ffmpeg -i' is almost the same for the two: in both cases, there is: >> >> Duration: 00:15:10.84, bitrate: 1411 kb/s >> Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, >> stereo, s16, 1411 kb/s >> >> Why should it be any different? > > >> So I wonder, and am asking to you listers, in where that quality loss is >> shown >> and how it can be detected. > > > You'd have to analyze the samples in some way. I am more familiar with > video, so if I did something similar like: > File1.mov is 8-bit uncompressed video and 100 MB and it looks nice. > File 2.mpeg is an 8-bit mpeg1video and is 1MB and it looks TERRIBLE. > File3.mov is an 8-bit uncompressed transcode of File2.mpeg and it is 100MB > and looks TERRIBLE. But it's the same file size and ffmpeg -i probably > looks very similar. > > If a better codec was used and it was difficult to tell the difference by > eye, i'd use something like QCTools which would allow me to view the > components of the video, and very quickly detect that a lossy compression > stage had occured. > > Or maybe should we think and conclude that the >> original quality is restored with the second step...? >> > > No, it hasn't. You just have the same loss of quality in File3.WAV that > existed in file2.mp3. It's just a bigger file size. Thanks all of you... Now it's much clearer to me. I will certainly use Audacity, as you suggest, to compare the two files. Can it do the same also with two mp3's? The reason of my question and the present thread is the following. Nowadays there are so many different possibilities to fetch, say, a certain musical execution over the net, or from audio CD. There is Youtube, of course, and also other platforms or simply capturing audio stream from any site and place. So it happened to me to have the same musical masterpiece and execution, but downloaded, or recorded, or simply copied from CD, from various different `places' and sources. I wish to compare all those, curious to see what the best and most reliable among all those sources is or are... I'll be trying the comparison as suggested and hope it's simple to do... Regards, Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Conversion wav -> mp3 -> wav
Steve Boyer writes: > If you want to see what really happened, import both files into Audacity, > use a filter to invert one of the files, and slide it around until they are > 1:1 (it's off slightly IIRC) and then hit "Play" or downmix to a single > track. If both tracks are aligned correctly, you will hear the discarded > portions of the original WAV file during the MP3 conversion. In the two files music starts with a slight delay from one another, and it seems I don't manage to slide them so to eliminate that delay... Any suggestion? Thanks, Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Conversion wav -> mp3 -> wav
Steve Boyer writes: > On Fri, Jun 23, 2017 at 7:11 AM, Rodolfo Medina > wrote: > >> Steve Boyer writes: >> >> > If you want to see what really happened, import both files into Audacity, >> > use a filter to invert one of the files, and slide it around until they >> are >> > 1:1 (it's off slightly IIRC) and then hit "Play" or downmix to a single >> > track. If both tracks are aligned correctly, you will hear the discarded >> > portions of the original WAV file during the MP3 conversion. >> >> >> In the two files music starts with a slight delay from one another, and it >> seems I don't manage to slide them so to eliminate that delay... Any >> suggestion? >> > > Trial and error - zoom in as far as you can, hit play, realize that it's > off slightly, shift using the Time Shift Tool (looks like <> in the > toolbar) very very slightly, repeat. It takes some time, but I've done this > comparing FFmpeg's encoding using the libfdk_aac encoder vs the aac encoder. Now I managed to synchronize them... but all happens is that they play together now... Where's the comparison...? On the first of the two, I applied the `invert' effect. Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Compare quality of 2 audio files (was: Conversion wav -> mp3 -> wav)
Maik Waschfeld writes: > Hi Rodolfo, > >> but all happens is that they play together now… > > Perfect! > For now. > >> On the first of the two, I applied the `invert’ effect. > > Are you sure? > >> Where’s the comparison…? > > That’s what you hear! If you play two exact files „in sync“, and one of them > is inverted, you should hear … nothing. > > Try with two instances of the same file, not one wav-mp3-wav and the other > one wav. > > The process in detail: > - select one file in the Finder > - right click and „Open with“ Audacity > - select the imported file in Audacity; be sure, that the hole file is > selected > and stays selected for the next step! > - >Effects>Inverted (my version is german, so it could be named otherwise in > english) > - >Import>Sound and select the exact same file, you used on „Open with“ > - Play. > - If you hear nothing, then the process is correct. If you hear anything but > silence, then one of your steps was not correct. > - If you select „Solo“ on one of the tracks, the other track gets muted and > you > can toggle between „the difference“ and the „Solo-ed track. Thanks... Yes, now it works also for me exactly as you described. But my impression is that the whole thing only works when file1.wav and file2.wav are the same file (silence) or file2.wav is the result of a conversion of file1.wav. Instead, I want to compare the quality of file1.wav and file2.wav fetched, over the net, or copied from CD, from sources completely different and independent one another. For example (I suppose and I see that it works also with mp3 format), now file1.mp3 is fetched from Youtube: https://www.youtube.com/watch?v=SgKHI4jEFEo , and it's Brahms 4th symphony directed by Kurt Sanderling (great!), first movement; and file2.mp3 is the same piece but copied and converted from audio CD: same piece, director, execution: all. In this case, I import file1.mp3, I invert it, then I import file2.mp3: the game does not succeed: what I hear is not the difference between them - as it is when file2.mp3 = file1.mp3 -; what I hear seems rather to be the sum of the two... Am I wrong? I hope to be well explaining myself... In other words, I wish a tool that detect the differences from files with different origines, sources and respective histories... Is that possibile? Thanks, Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Compare quality of 2 audio files
Maik Waschfeld writes: >> Am 24.06.2017 um 09:22 schrieb Rodolfo Medina : > […] >> In this case, I import file1.mp3, I invert it, then I import file2.mp3: the >> game does not succeed: what I hear is not the difference between them - as >> it is when file2.mp3 = file1.mp3 -; what I hear seems rather to be the sum >> of the two... > > > That’s strange! > > As playing two files at the same time, technically is a summing-function, if > the result is louder than the single pieces, the invert didn’t work. > Maybe one of the files was already inverted, before you got it. > Just invert on one of the tracks again. > > Essential to the process is too, that both tracks sync exactly. > So when you manually sync the beginning, do they still sync-match at or near > the end of the file? > You can and should zoom in on the waveform to do the syncing and checking. > > If they don’t sync-match completely, they are not identical, source-wise. > >> I wish a tool that detect the differences >> from files with different origines, sources and respective histories... Is >> that possibile? > > > I’m not aware of an application to do this job, automatically. > Sorry! Yes, the two tracks are perfectly synchronized from beginning to end, the first one is inverted and second isn't. Playing them together is louder than each of them as `Solo'. Same piece, same execution, same recording... Only, one was fetched from Youtube and the other was extracted from audio CD... Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Compare quality of 2 audio files
Maik Waschfeld writes: > Hi Rodolfo, > >> Am 24.06.2017 um 13:17 schrieb Rodolfo Medina : >> >> the first >> one is inverted and second isn't. Playing them together is louder than each >> of >> them as `Solo'. > > > Then don’t invert the first one. Same result... I wish I could send the two files to the list... Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Compare quality of 2 audio files
With Maik's kind help, I managed to sync the two files I wanted to compare: within Audacity I had to shift one of the two exactly 34ms to the right. Then, after inverting it, by playing them together their difference can be heard. Now, supposed one doesn't know, how is it possibile to tell which one of the two is best quality and which one is the worst? Thanks, Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Compare quality of 2 audio files
Harold Tessmann writes: > On Thu, Jun 29, 2017 at 12:37 PM, Moritz Barsnick wrote: > >> And unlike video, it seems there are few, if any, methods to measure >> the *perceived* quality of audio. Check here for some ramblings: >> https://stackoverflow.com/questions/2945531/determining- >> the-best-audio-quality >> >> But I challange you to find an algorithm which can compare two audio >> tracks. (And you need someone with a good ear to confirm its findings. >> Or reference material and encodings such as SQAM.) But if you do find >> it, and it's "free" to use, please implement an ffmpeg filter with it. >> :-) >> > > To continue along those lines, I don’t think this is even a problem that > one can precisely define. I will start by acknowledging that there exists a > boundary where you can define audio quality objectively. Clipping, for > instance, destroys sound data, and is objectively bad < > https://en.wikipedia.org/wiki/Loudness_war> (but even then, some musicians > or sound designers may want that, for industrial or other effects). But > there is a difference between objective quality and what people want. > Consider the ability of a display to reproduce an image accurately. You can > make an objective comparison, but if you go by the display section of an > electronics store, you’d find out that people tend to like oversaturated, > objectively worse, color < > http://www.flatpanelshd.com/focus.php?subaction=showfull&id=1328263571>. > > And then you have to consider the environment of your audience, which you > can’t necessarily control. Audio played in a car has to contend with road > noise, while pictures on a TV will look significantly different in a bright > store vs. a customer’s home < > https://www.cnet.com/news/why-do-plasma-tvs-look-washed-out-in-the-store/>. > > And then there’s the question of how much quality your audience can detect. > The MythBusters did a test with different grades of vodka and determined > that yes, an expert can taste the difference between high end and cheap > liquor, but your average person doesn’t have so discriminating a palate < > http://kwc.org/mythbusters/2006/04/episode_50_bullets_fired_up_vo.html>. So > even if you did come up with a good metric, perhaps you don’t _want_ to > check it against an audiophile, or a recording engineer, or somebody who > has particularly good hearing. But suppose you have a song, or any piece of music... a certain particular precise recording, just that one... and that you find in internet two mp3 different files of that song, from two different web sites, both same size in megabytes. Suppose that the test with Audacity, which we have earlier much spoken of, reveals a difference between them: this means that a portion of the original WAV file during the MP3 conversion has been discarded in more quantity in, say, file1.mp3 than in file2.mp3 (in fact it can be heared). Or also suppose that both files are in wav format but still Audacity reveals a difference between them (because one of them could be - as far as we know - the result of a previous unknown conversion). Then I expect if would be technically possible that we could give an algebraic plus or minus sign to that discarded portion and tell - objectively and not by a simple personal listening feeling - which of the two is the one that contains more information and which less - that's what I would reasonably expect. Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Compare quality of 2 audio files
Rodolfo Medina writes: > Harold Tessmann writes: > >> On Thu, Jun 29, 2017 at 12:37 PM, Moritz Barsnick wrote: >> >>> And unlike video, it seems there are few, if any, methods to measure >>> the *perceived* quality of audio. Check here for some ramblings: >>> https://stackoverflow.com/questions/2945531/determining- >>> the-best-audio-quality >>> >>> But I challange you to find an algorithm which can compare two audio >>> tracks. (And you need someone with a good ear to confirm its findings. >>> Or reference material and encodings such as SQAM.) But if you do find >>> it, and it's "free" to use, please implement an ffmpeg filter with it. >>> :-) >>> >> >> To continue along those lines, I don’t think this is even a problem that >> one can precisely define. I will start by acknowledging that there exists a >> boundary where you can define audio quality objectively. Clipping, for >> instance, destroys sound data, and is objectively bad < >> https://en.wikipedia.org/wiki/Loudness_war> (but even then, some musicians >> or sound designers may want that, for industrial or other effects). But >> there is a difference between objective quality and what people want. >> Consider the ability of a display to reproduce an image accurately. You can >> make an objective comparison, but if you go by the display section of an >> electronics store, you’d find out that people tend to like oversaturated, >> objectively worse, color < >> http://www.flatpanelshd.com/focus.php?subaction=showfull&id=1328263571>. >> >> And then you have to consider the environment of your audience, which you >> can’t necessarily control. Audio played in a car has to contend with road >> noise, while pictures on a TV will look significantly different in a bright >> store vs. a customer’s home < >> https://www.cnet.com/news/why-do-plasma-tvs-look-washed-out-in-the-store/>. >> >> And then there’s the question of how much quality your audience can detect. >> The MythBusters did a test with different grades of vodka and determined >> that yes, an expert can taste the difference between high end and cheap >> liquor, but your average person doesn’t have so discriminating a palate < >> http://kwc.org/mythbusters/2006/04/episode_50_bullets_fired_up_vo.html>. So >> even if you did come up with a good metric, perhaps you don’t _want_ to >> check it against an audiophile, or a recording engineer, or somebody who >> has particularly good hearing. > > > But suppose you have a song, or any piece of music... a certain particular > precise recording, just that one... and that you find in internet two mp3 > different files of that song, from two different web sites, both same size in > megabytes. Suppose that the test with Audacity, which we have earlier much > spoken of, reveals a difference between them: this means that a portion of > the original WAV file during the MP3 conversion has been discarded in more > quantity in, say, file1.mp3 than in file2.mp3 (in fact it can be heared). Or > also suppose that both files are in wav format but still Audacity reveals a > difference between them (because one of them could be - as far as we know - > the result of a previous unknown conversion). Then I expect if would be > technically possible that we could give an algebraic plus or minus sign to > that discarded portion and tell - objectively and not by a simple personal > listening feeling - which of the two is the one that contains more > information and which less - that's what I would reasonably expect. It's as if in Algebra we can do |a - b| but don't know wether it's a < b or b < a... Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] flac format
Hi to all ffmpeg users. In order to backup store my audio CDs, I collect them into wav files using icedax, because I read that wav format is lossless. Now, I've just read that also flac format would be, with the advantage of occupying much less memory space than wav. As far as you listers know, is that true? If so, what should the magic formula be to losslessly convert wav to flac and viceversa...? Thanks in advance for any help... Regards, Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] flac format
Cley Faye writes: > 2017-09-01 10:55 GMT+02:00 Rodolfo Medina : > >> Hi to all ffmpeg users. >> >> In order to backup store my audio CDs, I collect them into wav files using >> icedax, because I read that wav format is lossless. Now, I've just read >> that >> also flac format would be, with the advantage of occupying much less memory >> space than wav. As far as you listers know, is that true? If so, what >> should >> the magic formula be to losslessly convert wav to flac and viceversa...? > > > Yes, FLAC is lossless. Using ffmpeg to convert from wav to flac is pretty > straightforward: > > $ ffmpeg -i input.wav output.flac > > can't be much simpler than that :) > Of course you can specify a lot of flags for encoding, but by default it > will try to match the input, which is probably what you want. Thanks. Also the viceversa is as much simpler? And, please, what about wma format? Is it also lossless? I saw that the conversion wav > wma and wma > wav is simple as well... Thanks, Rodolfo ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".