Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#9341 closed defect (invalid)

aselect: Invalid chars

Reported by: xamarin Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug: Can't create output video extracting 2 slices of input video and joining them.
How to reproduce: use command:

% ffmpeg -report -y -i in.mp4 -vf "select='between(t,01:12.75,01:14)+between(t,12:44.7,12:56)', setpts=N/FRAME_RATE/TB" -af "aselect='between(t,01:12.75,01:14)+between(t,12:44.7,12:56)', asetpts=N/SR/TB" -c:v libx265 -x265-params pass=1 -b:v 1700k -c:a aac -b:a 160k -f mp4 NUL && ffmpeg -y -i in.mp4 -vf "select='between(t,01:12.75,01:14)+between(t,12:44.7,12:56)', setpts=N/FRAME_RATE/TB" -af "aselect='between(t,01:12.75,01:14)+between(t,12:44.7,12:56)', asetpts=N/SR/TB" -c:v libx265 -x265-params pass=2 -b:v 1700k -c:a aac -b:a 160k -f mp4 out.mp4
ffmpeg version 4.4-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (3)

comment:1 by xamarin, 3 years ago

ffmpeg log:

ffmpeg started on 2021-07-21 at 12:56:35
Report written to "ffmpeg-20210721-125635.log"
Log level: 48
Command line:
"C:\\ProgramData\\chocolatey\\lib\\ffmpeg\\tools\\ffmpeg\\bin\\ffmpeg.exe" -report -y -i in.mp4 -vf "select='between(t,01:12.75,01:14)+between(t,12:44.7,12:56)', setpts=N/FRAME_RATE/TB" -af "aselect='between(t,01:12.75,01:14)+between(t,12:44.7,12:56)', asetpts=N/SR/TB" -c:v libx265 -x265-params "pass=1" -b:v 1700k -c:a aac -b:a 160k -f mp4 NUL
ffmpeg version 4.4-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Splitting the commandline.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-i' ... matched as input url with argument 'in.mp4'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'select='between(t,01:12.75,01:14)+between(t,12:44.7,12:56)', setpts=N/FRAME_RATE/TB'.
Reading option '-af' ... matched as option 'af' (set audio filters) with argument 'aselect='between(t,01:12.75,01:14)+between(t,12:44.7,12:56)', asetpts=N/SR/TB'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx265'.
Reading option '-x265-params' ... matched as AVOption 'x265-params' with argument 'pass=1'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '1700k'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'aac'.
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '160k'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'mp4'.
Reading option 'NUL' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url in.mp4.
Successfully parsed a group of options.
Opening an input file: in.mp4.
[NULL @ 0000018d83db0400] Opening 'in.mp4' for reading
[file @ 0000018d83db0c80] Setting default whitelist 'file,crypto,data'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] Processing st: 0, edit list 0 - media time: 512, duration: 46016000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] stts: 0 ctts: 512, ctts_index: 0, ctts_count: 89875
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] stts: 512 ctts: 2560, ctts_index: 1, ctts_count: 89875
[...]
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] stts: 46015488 ctts: 0, ctts_index: 89874, ctts_count: 89875
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] Offset DTS by 512 to make first pts zero.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] Setting codecpar->delay to 1 for stream st: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] Processing st: 1, edit list 0 - media time: 0, duration: 158539809
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] Before avformat_find_stream_info() pos: 2678022 bytes read:2678896 seeks:0 nb_streams:2
[h264 @ 0000018d83db2c00] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0000018d83db2c00] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0000018d83db2c00] nal_unit_type: 5(IDR), nal_ref_idc: 1
[h264 @ 0000018d83db2c00] Format yuv420p chosen by get_format().
[h264 @ 0000018d83db2c00] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 0000018d83db2c00] no picture 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018d83db0400] After avformat_find_stream_info() pos: 2729873 bytes read:2754523 seeks:0 frames:3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
  Duration: 00:59:55.01, start: 0.000000, bitrate: 1712 kb/s
  Stream #0:0(und), 2, 1/12800: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1578 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc. Created on: 07/13/2021.
      vendor_id       : [0][0][0][0]
  Stream #0:1(eng), 1, 1/44100: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc. Created on: 07/13/2021.
      vendor_id       : [0][0][0][0]
Successfully opened the file.
Parsing a group of options: output url NUL.
Applying option vf (set video filters) with argument select='between(t,01:12.75,01:14)+between(t,12:44.7,12:56)', setpts=N/FRAME_RATE/TB.
Applying option af (set audio filters) with argument aselect='between(t,01:12.75,01:14)+between(t,12:44.7,12:56)', asetpts=N/SR/TB.
Applying option c:v (codec name) with argument libx265.
Applying option b:v (video bitrate (please use -b:v)) with argument 1700k.
Applying option c:a (codec name) with argument aac.
Applying option b:a (video bitrate (please use -b:v)) with argument 160k.
Applying option f (force format) with argument mp4.
Successfully parsed a group of options.
Opening an output file: NUL.
[file @ 0000018d83e6c8c0] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
detected 8 logical cores
[h264 @ 0000018d83daf6c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0000018d83daf6c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[h264 @ 0000018d83daf6c0] nal_unit_type: 5(IDR), nal_ref_idc: 1
[h264 @ 0000018d83daf6c0] Format yuv420p chosen by get_format().
[h264 @ 0000018d83daf6c0] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 0000018d83daf6c0] no picture 
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[h264 @ 0000018d8428e840] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 1
[Parsed_aselect_0 @ 0000018d825c8800] Setting 'expr' to value 'between(t,01'
[Parsed_aselect_0 @ 0000018d825c8800] Setting 'outputs' to value '12.75,01'
[aselect @ 0000018d85ee3a40] [Eval @ 0000004b537fe220] Invalid chars ',01' at the end of expression '12.75,01'
[aselect @ 0000018d85ee3a40] Unable to parse option value "12.75,01"
[Parsed_aselect_0 @ 0000018d825c8800] No option name near '14)+between(t,12:44.7,12:56)'
[AVFilterGraph @ 0000018d84812000] Error initializing filter 'aselect' with args 'between(t,01:12.75,01:14)+between(t,12:44.7,12:56)'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:1
[AVIOContext @ 0000018d847672c0] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0000018d83db8ec0] Statistics: 2754523 bytes read, 0 seeks
Conversion failed!

comment:2 by Gyan, 3 years ago

Resolution: invalid
Status: newclosed

The time values must be in seconds.

comment:3 by xamarin, 3 years ago

Thank you very much. Now worked perfectly fine using seconds even with decimals:

ffmpeg -report -y -i in.mp4 -vf "select='between(t,72.75,74)+between(t,644.7,670)', setpts=N/FRAME_RATE/TB" -af "aselect='between(t,72.75,74)+between(t,644.7,670)', asetpts=N/SR/TB" -c:v libx265 -x265-params pass=1 -b:v 1700k -c:a aac -b:a 160k -f mp4 NUL && ffmpeg -y -i in.mp4 -vf "select='between(t,72.75,74)+between(t,644.7,670)', setpts=N/FRAME_RATE/TB" -af "aselect='between(t,72.75,74)+between(t,644.7,670)', asetpts=N/SR/TB" -c:v libx265 -x265-params pass=2 -b:v 1700k -c:a aac -b:a 160k -f mp4 out.mp4

Note: See TracTickets for help on using tickets.