đŸ Archived View for gemini.ctrl-c.club âș ~ssb22 âș video.gmi captured on 2024-07-09 at 04:39:28. Gemini links have been rewritten to link to archived content
âŹ ïž Previous capture (2024-03-21)
-=-=-=-=-=-=-
These are some quick notes I made to provide starting points for mencoder command lines.âIt is meant for conversions that are legal (own work, personal use of products without DRM, etc).âI am not an mencoder expert but just collected some options that worked for me.
Input from: DVD | video file | rtmp stream | Flash audio | edits | audio file | FM | language merge | desktop | pictures
Output to: Android, iPhone or Mac | Nokia S60, S40 etc | Windows 10 | Zoom Cloud Meetings | Old Windows or Windows Mobile | MP3 audio | DVD, VCD or SVCD
dvd://1 -dvd-device PATH -sid 31 (where PATH is the path to the DVD image)
cd $DVD_DIR/VIDEO_TS && ffmpeg -i "concat:$(echo *.VOB|tr ' ' '|')" -map 0:1 -map 0:3
or cat $DVD_DIR/VIDEO_TS/*.VOB | ffmpeg -i - -map 0:1 -map 0:3
where for a multi-title DVD youâll need to figure out the correct set of VOB files, and -map 0:1 and -map 0:3 might need to be refined according to ffmpegâs output of the language list; youâll also need to add some ffmpeg *output* options, e.g. -vcodec mpeg4 -b:v 600k -strict -2 -g 50 -vf yadif -c:a aac -b:a 160k output.mp4
These commands do *not* handle subtitles.
Some discs work better with mencoder, while other discs work better with ffmpeg, so *both* commands are useful to keep.
You need root access to a GNU/Linux machine with rtmpdump
iptables -t nat -A OUTPUT -p tcp --dport 1935 -m owner \! --uid-owner root -j REDIRECT
rtmpsuck
On a GNU/Linux machine with ~/.asoundrc set to
pcm.teeraw { type empty
slave.pcm "tee:default,'/tmp/out.raw',raw" }
use FLASH_ALSA_DEVICE=teeraw firefox and (e.g.) sox -t raw -r 44100 -c 2 -b 16 -s /tmp/out.raw /tmp/out.wav then proceed with out.wav.â(To reduce risk of /tmp/out.raw being overwritten, start sox *before* interacting with the browser to stop the stream.)âThis method was last tested in 2017 and is unlikely to work in the latest non-Flash browsers.
Use -edl filename, where each line of the file is start-second end-second 0 (use mplayer to find the seconds and to test the EDL).âYou can add up the total number of minutes youâve cut by piping the EDL through python2 -c 'import sys;print sum(float(l.split()[1])-float(l.split()[0]) for l in sys.stdin)/60.0'
This might be useful for porting audio to old DVD players that donât support MP3 etc.âYou need to first add the audio to blank video using ffmpeg: (command adapted from Stefano Sabatiniâs suggestion on ffmpeg-user)
ffmpeg -i input-audio.wav -s 640x480 -f rawvideo -pix_fmt rgb24 -r 25 -i /dev/zero -shortest -vcodec libx264 -preset medium -tune stillimage -crf 24 -acodec copy output.mkv
then proceed with output.mkv (convert it to .mpg as per DVD output below, etc)
You can also use ffmpeg to attach audio to a still image:
ffmpeg -i audio.mp3 -loop 1 -i picture.jpg -shortest -vcodec mpeg4 -b:v 800k audio.avi
(then convert audio.avi into the required output format)
Or to replace the soundtrack of an existing video (for language dubbing etc),
ffmpeg -i video.mp4 -i sound.wav -map 0:v -map 1:a -vcodec copy output.mkv
then proceed with output.mkv
As above, but if recording the audio to MP3 you might want to avoid wasting space encoding any frequencies above 15kHz.âThis is because FM stereo requires a 4kHz guard band around the 19kHz pilot signal, therefore any audio you get above 15kHz *must* be the result of equipment noise; therefore the option of a 32kHz sample rate (Nyquist cutoff 16kHz) makes sense, but your ADC circuitry might not do that well so itâs probably best to convert in software:
rec --input-buffer=1048576 -t raw -r 44100 -c 2 -b 16 -e signed-integer - | sox -t raw -r 44100 -c 2 -b 16 -e signed-integer - -t raw -r 32000 -c 2 -b 16 -e signed-integer - | lame -h -s 32 -r - -o output.mp3
(older versions of sox might need -2 -s or -w -s instead of -b 16 -e signed-integer in three places of the above command)
If a video is available in two versions with different-language sound tracks:
ffmpeg -i videoS.mp4 -i videoP.mp4 -map 0:a:0 -map 1:v:0 -map 1:s:0 -c copy -c:s mov_text output.mp4
To play the two videos on separate devices but time-synchronised over a local network:
mplayer -udp-