ffmpeg -f concat from standard input instead of a file

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

ffmpeg -f concat from standard input instead of a file

Cecil Westerhof-3
The following works without a problem:
    ffmpeg -f concat -i educational.txt -c copy educationalComplete.mov

The file educational text contains:
    file educational01.mov
    file educational02.mov

And with this the complete video is Generated in about 5 seconds.

But I would prefer not to the .txt file. So I tried:
    echo -e "file educational.mov\nfile educational02.mov" | ffmpeg -f concat -i - -c copy educationalComplete.mov

But this results in:
    [file @ 0x556c69d91920] Protocol not on whitelist 'crypto'!
    [concat @ 0x556c69d90e40] Impossible to open 'educational.mov'
    pipe:: Invalid argument

Why is this? Can it be circumvented?

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg -f concat from standard input instead of a file

Gyan Doshi


On 01-07-2018 10:42 PM, Cecil Westerhof wrote:
> echo -e "file educational.mov\nfile educational02.mov" | ffmpeg -f concat -i - -c copy educationalComplete.mov

Add
     -protocol_whitelist file,pipe,crypto

to before
     -i -

Regards,
Gyan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg -f concat from standard input instead of a file

Nicolas George
In reply to this post by Cecil Westerhof-3
Cecil Westerhof (2018-07-01):
>     [concat @ 0x556c69d90e40] Impossible to open 'educational.mov'

> Why is this? Can it be circumvented?

When ffmpeg sees the "-" filename, it translates it to "pipe:"; you
could use "pipe:" directly to read from stdin.

Also, paths in concat scripts are relative, so that when you write
/full/path/to/educational.txt, it knows to find educational01.mov in
/full/path/to/. And you could even write
http://example.com/path/to/educational.txt and have it find
http://example.com/path/to/educational01.mov as expected.

Combine these two informations, and you deduce that ffmpeg is looking
for pipe:educational01.mov, which does not exist, and in fact does not
even make sense.

You can solve the problem by prefixing all file names by $PWD in the
script.

Another option would be to add an option to the concat demuxer, "-base
." to override the base directory deduced from the path to the script.
It would be rather easy to implement.

Regards,

--
  Nicolas George

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg -f concat from standard input instead of a file

Cecil Westerhof-3
In reply to this post by Gyan Doshi
Gyan Doshi <[hidden email]> writes:

> On 01-07-2018 10:42 PM, Cecil Westerhof wrote:
>> echo -e "file educational.mov\nfile educational02.mov" | ffmpeg -f concat -i - -c copy educationalComplete.mov
>
> Add
>     -protocol_whitelist file,pipe,crypto
>
> to before
>     -i -

Works like a charm. I ma now using:
echo "
file educational01.mov
file educational02.mov
" | ffmpeg                               \
    -f concat                            \
    -protocol_whitelist file,pipe,crypto \
    -i -                                 \
    -c copy                              \
    educationalComplete.mov

Thanks.

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg -f concat from standard input instead of a file

Nicolas George
In reply to this post by Nicolas George
Nicolas George (2018-07-01):
> Combine these two informations, and you deduce that ffmpeg is looking
> for pipe:educational01.mov

Apparently, the URL handling functions and whitelist stuff are more
broken than I thought. This is not what actually happens, despite being
what should happen.

Regards,

--
  Nicolas George

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

signature.asc (849 bytes) Download Attachment