Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Creating clips from tv recordings:

    ffmpeg -ss 01:59:00.000 -i "interlaced.ts" -ss 00:00:12.000 -t 26 -max_muxing_queue_size 1024 -c:a libopus -b:a 96k -c:v libx264 -crf 20 -vf "yadif=1" -profile:v baseline -level 3.0 -pix_fmt yuv420p -movflags +faststart -y clip.mp4
Make clip compatible with WhatsApp:

    ffmpeg -i in.mp4 -map 0:v:0 -map 0:a:0 -map_metadata -1 -map_chapters -1 -c:v libx264 -preset slow -tune film -crf 32 -c:a aac -b:a 128k -profile:v baseline -level 3.0 -pix_fmt yuv420p -movflags +faststart out.mp4
Copying in various terminals:

    PuTTY: select
    tmux: Shift + select
    cmd: select + Enter in quick edit mode
    Windows Terminal: select + Right Click


Most streaming sites break a video into many small fragments, which are listed in a m4mu file. I have a script to download the fragments one by one using curl. To merge the video fragments back into one file, I do the following.

  Merge video files with ffmpeg
  - Make a file listing all the videos in sequence. E.g.
     file 'video01.ts'
     file 'video02.ts'
     file 'video03.ts'
     ...
  - Generate the file list for files in the current directory.
      (for %i in (*.ts) do @echo file '%i') > filelist.txt
  - ffmpeg command to combine videos
     ffmpeg -f concat -safe 0 -i filelist.txt -c copy output.mp4


For anyone needing this youtube-dl (and ffmpeg if you need post-dl conversion) can do this for you if it's any easier, point it at the index file and let it do its thing


Youtube-dl is great. I just wanted to build it from scratch, and it was very simple once the underlying streaming tech was understood.


I find -vf bwdif much smoother than yadif for action sport replays.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: