alexheretic / ab-av1

AV1 re-encoding using ffmpeg, svt-av1 & vmaf.
MIT License
442 stars 29 forks source link

Feature request: switch to process only video track, nothing else #129

Closed mr44er closed 1 year ago

mr44er commented 1 year ago

I think it would be useful to have a switch to process only the pure video track.

Mostly I convert and mux the tracks separately and for clean 'end-tuning' with mkvtoolnix GUI, so I'd like to avoid wasted cpu cycles. Also I had a file with an embedded jpg. Sure, this does not work in combination with cropping, but in the first place the encoding stopped unexpected.


  Stream #0:29: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 640x360 [SAR 96:96 DAR 16:9], 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      filename        : cover.jpg
      mimetype        : image/jpeg
Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options specified for stream 0, only the last option '-c:v:0 libsvtav1' will be used.
Filtergraph 'crop=1920:1036:0:22' was defined for video output stream 0:29 but codec copy was selected.
Filtering and streamcopy cannot be used together.

On ffmpeg the switches are -an -sn -dn -> audio none / subtitles none / data(streams) none https://ffmpeg.org/ffmpeg.html#Stream-selection

All of the three triggered with: -vo --video-only or -vop --video-only-processing

What do you think?

alexheretic commented 1 year ago

Currently you can handle this with --enc somewhat, you could unmap the other streams this way.

Still i can see that a flag to only output the main video would be much easier to use.

mr44er commented 1 year ago

Yes, my main reason is usage for a batch fashioned way. For example letting it run over night over some files/folders for videos vs. converting audio can be done in ~10 minutes 'manually' and more specific. I think I read something with batch processing on your roadmap already? Maybe then to use -i *.mp4 or something like that.

mr44er commented 1 year ago

Thx for the implementation! :)

I stumbled yesterday over some strange subtitles, which survive a -vcodec copy -an -sn -dn They are definitely not burnt in, in mpv they can be switched off. Funny that only mpv sees them, vlc and mkvtoolnix not at all and ffmpeg only partly, but not as a track. Never seen that before and after googling around it seems it's some old apple implementation that the mkvtoolnix guys don't support. Good decision, imho. I found at least two different types of them and in the end ffmpeg with -map_metadata -1 -map_chapters -1 -bsf:v filter_units=remove_types=6 -vcodec copy -an -sn -dn outvideoonly.mkv got rid of it all.

Some are based on chapters and ffmpeg shows sometimes as mov_text, t3x, closed captions or sometimes completely nothing in the stream. Only in mpv they appear always but only after the first entry happened timewise.

Maybe you want to add this or at least it's good to know how to delete such non-standard stuff.