VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. I have ffmpeg ver 3.1.4 using on Windows 7 32 bit with vlc ver 2.2.4.
    I use this command to simultaneously record and play an internet radio station and this works fine.

    Code:
    ffmpeg -i "https://ais-sa1.streamon.fm/7648_48k.aac" ^
        -c copy output.aac ^
        -f wav -acodec pcm_s16le -ac 2 - | "C:\Program Files\videolan\vlc\vlc.exe" -
    I can manually stop ffmpeg record/play by either closing vlc or closing ffmpeg and this leaves me with a completed audio file.

    However, I want to add something to limit the record/play to a certain time, for example 30 seconds, after which ffmpeg will stop recording/playing the radio station (stop using data) and leave me with a completed audio file. I tried adding this to the code:
    Code:
    -t 00:00:30
    in various ways but was unsuccessful. In actual practice, I would like to stop the record/play about 4 hours 30 minutes.
    Could someone give me the exact working code (using above example radio station) that will record/play for specific time and then stop recording/playing and stop using data.
    Thank you.
    Last edited by jimdagys; 25th Mar 2025 at 22:09.
    Quote Quote  
  2. The duration needs to have seconds as a float, not an integer.

    Code:
    -t 00:00:30.0
    I believe it has to be after the input spec too.

    It looks like your batch file needs the time limit twice:
    Code:
    ffmpeg -i "https://ais-sa1.streamon.fm/7648_48k.aac" ^
        -t 00:00:10.0 ^
        -c copy output.aac ^
        -t 00:00:10.0 ^
        -f wav -acodec pcm_s16le -ac 2 - | "G:\program files\videolan\vlc\vlc.exe" -
    Once for the aac output, again for the wav output to VLC.
    Last edited by jagabo; 25th Mar 2025 at 22:20.
    Quote Quote  
  3. Ok, this seems to work (ffmpeg records/plays for 30 seconds).
    Code:
    ffmpeg -i "https://ais-sa1.streamon.fm/7648_48k.aac" ^
        -t 00:00:30.0 ^
        -c copy output.aac ^
        -t 00:00:30.0 ^
        -f wav -acodec pcm_s16le -ac 2 - | "C:\program files\videolan\vlc
    Thank you.
    I do have a question. In the command output, what does the "more' mean (shown four times with red mark)? Also, why do I have to press enter to continue at that point (shown with green mark)?
    Image Attached Thumbnails Click image for larger version

Name:	Clipboard01.jpg
Views:	19
Size:	217.2 KB
ID:	86298  

    Last edited by jimdagys; 26th Mar 2025 at 05:36.
    Quote Quote  
  4. The CLI just telling you it's ready for more input since the previous line ended with a ^. I ran it from a batch file so all the lines were simply concatenated before being executed:
    Code:
    ffmpeg -i "https://ais-sa1.streamon.fm/7648_48k.aac"     -t 00:00:10.0     -c copy output.aac     -t 00:00:10.0     -f wav -acodec pcm_s16le -ac 2 -   | "G:\program files\videolan\vlc\vlc.exe" -
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!